Skip to content

kw geo slow #259

Description

@valentinedwv

Describe the bug
slow 9sec

PREFIX schema: <https://schema.org/>
PREFIX sschema: <https://schema.org/>
PREFIX bds: <http://www.bigdata.com/rdf/search#>
PREFIX ql: <http://qlever.cs.uni-freiburg.de/builtin-functions/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX sf: <http://www.opengis.net/ont/sf#>

SELECT ?g ?subj ?name ?description
  (SAMPLE(?datep_raw) AS ?datep)
  (GROUP_CONCAT(DISTINCT ?pubname_raw; SEPARATOR=", ") AS ?pubname)
  (SAMPLE(?temporalCoverage_raw) AS ?temporalCoverage)
  (GROUP_CONCAT(DISTINCT ?url1; SEPARATOR=", ") AS ?disurl)
  (GROUP_CONCAT(DISTINCT ?placename; SEPARATOR=", ") AS ?placenames)
  (GROUP_CONCAT(DISTINCT ?kwu; SEPARATOR=", ") AS ?kw)
  (GROUP_CONCAT(DISTINCT ?resourceType_u; SEPARATOR=", ") AS ?resourceType)
  (MAX(?maxDepth_raw) AS ?maxDepth)
  (MIN(?minDepth_raw) AS ?minDepth)
WHERE {
  {
    SELECT DISTINCT ?g ?subj ?name ?description ?type
    WHERE {
      VALUES ?sosType {
        sschema:Dataset
        schema:Dataset
      }
      ?subj a ?sosType .
      VALUES (?type ?resourceType_u) {
        (schema:Dataset "data")
        (sschema:Dataset "data") 
        (schema:SoftwareApplication "tool")
        (sschema:SoftwareApplication "tool")
        (schema:DataCatalog "DataCatalog")
        (sschema:DataCatalog "DataCatalog")
      }
      ?subj a ?type .
      ?subj schema:keywords|sschema:keywords "Temperature" .
      ?subj schema:spatialCoverage ?spatialCov .
          ?spatialCov schema:geo ?geo .
          ?geo schema:latitude ?lat .
          ?geo schema:longitude ?lon .
          FILTER(?lat >= 20 && ?lat <= 60 && ?lon >= -80 && ?lon <= 0) .
          ?subj ?o ?item .
      ?text ql:contains-entity ?item .
      ?text ql:contains-word "water" .
      GRAPH ?g {
        ?subj schema:name|sschema:name ?name .
        ?subj schema:description|sschema:description ?description .
      }

    }
    LIMIT 10
    OFFSET 0
  }
  OPTIONAL {?subj sschema:distribution/sschema:url|sschema:subjectOf/sschema:url|schema:distribution/schema:url|schema:subjectOf/schema:url ?url1 .}
  OPTIONAL {?subj schema:datePublished|sschema:datePublished ?datep1 .}
  OPTIONAL {?subj schema:dateCreated|sschema:dateCreated ?datec .}
  OPTIONAL {?subj schema:dateModified|sschema:dateModified ?datem .}
  OPTIONAL {?subj schema:temporalCoverage|sschema:temporalCoverage ?temporalCoverage_raw .}
  OPTIONAL {?subj schema:publisher/schema:name|sschema:publisher/sschema:name|schema:publisher/schema:legalName|sschema:publisher/sschema:legalName ?pub_name .}
  OPTIONAL {?subj schema:spatialCoverage/schema:name|sschema:spatialCoverage/sschema:name|sschema:sdPublisher ?place_name .}
  OPTIONAL {?subj schema:keywords|sschema:keywords ?kwu .}



  BIND (COALESCE(?datec,?datem,?datep1) AS ?datep_raw)
  BIND (IF(BOUND(?pub_name), ?pub_name, "No Publisher") AS ?pubname_raw)
  BIND (IF(BOUND(?place_name), ?place_name, "No Placenames") AS ?placename)
}
GROUP BY ?g ?subj ?name ?description

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions