Anonymous

Project:SPARQL/examples: Difference between revisions

From geokb
no edit summary
No edit summary
 
Line 120: Line 120:
   ?item wdt:P2* wd:Q158710 ;
   ?item wdt:P2* wd:Q158710 ;
         skos:altLabel ?itemAltLabel .
         skos:altLabel ?itemAltLabel .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
</sparql>
= USGS Model Catalog =
<sparql tryit="1">
PREFIX wd: <https://geokb.wikibase.cloud/entity/>
PREFIX wdt: <https://geokb.wikibase.cloud/prop/direct/>
SELECT ?item ?itemLabel ?instance_of ?instance_ofLabel
?model_cat_id ?pub_date
?author ?authorLabel ?has_part ?has_partLabel
?subject_of ?subject_ofLabel
?addresses_subject ?addresses_subjectLabel
WHERE {
  ?item wdt:P219 ?model_cat_id ;
        wdt:P1 ?instance_of .
  OPTIONAL {
    ?item wdt:P7 ?pub_date .
  }
  OPTIONAL {
    ?item wdt:P102 ?author .
  }
  OPTIONAL {
    ?item wdt:P63 ?has_part .
  }
  OPTIONAL {
    ?item wdt:P218 ?subject_of .
  }
  OPTIONAL {
    ?item wdt:P94 ?addresses_subject .
  }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
}