Project:SPARQL/examples: Difference between revisions

no edit summary
No edit summary
Line 133: Line 133:
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
}
</sparql>
== USGS Climate Change Science Ontology ==
=== Climate Change Science Topics ===
<sparql tryit="1">
PREFIX wd: <https://geokb.wikibase.cloud/entity/>
PREFIX wdt: <https://geokb.wikibase.cloud/prop/direct/>
SELECT ?loi ?loiLabel ?loiDescription
?topic ?topicLabel ?topicDescription
?subject ?subjectLabel ?subjectDescription
WHERE {
  ?loi wdt:P62 wd:Q160059 . # Highest level grouping concepts representing broad scientific lines of inquiry
  ?topic wdt:P62 ?loi . # Next-level set of research topics and scientific methods directly associated with the lines of inquiry
  {
    ?subject wdt:P94* ?topic . # addresses subject
  } UNION {
    ?subject wdt:P95* ?topic . # addresses place
  } UNION {
    ?subject wdt:P208* ?topic . # uses
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
</sparql>
=== Climate Change Science Linked Entities ===
<sparql tryit="1">
PREFIX wd: <https://geokb.wikibase.cloud/entity/>
PREFIX wdt: <https://geokb.wikibase.cloud/prop/direct/>
SELECT ?loi ?loiLabel
?topic ?topicLabel
?subject ?subjectLabel
?person ?personLabel
WHERE {
  ?loi wdt:P62 wd:Q160059 .
  ?topic wdt:P62 ?loi .
  {
    ?subject wdt:P94* ?topic . # addresses subject
  } UNION {
    ?subject wdt:P95* ?topic . # addresses place
  } UNION {
    ?subject wdt:P208* ?topic . # uses
  }
  {
    ?person wdt:P203 ?topic .
  } UNION {
    ?person wdt:P203 ?subject .
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
LIMIT 1000
</sparql>
</sparql>