DS Catalog:SPARQL Query Service/example queries: Difference between revisions

Jump to navigation Jump to search
Line 1,702: Line 1,702:


===Places===
===Places===
<syntaxhighlight lang="SPARQL">
# prefixes
PREFIX wd: <https://catalog.digital-scriptorium.org/entity/>
PREFIX wds: <https://catalog.digital-scriptorium.org/entity/statement/>
PREFIX wdv: <https://catalog.digital-scriptorium.org/value/>
PREFIX wdt: <https://catalog.digital-scriptorium.org/prop/direct/>
PREFIX p: <https://catalog.digital-scriptorium.org/prop/>
PREFIX ps: <https://catalog.digital-scriptorium.org/prop/statement/>
PREFIX pq: <https://catalog.digital-scriptorium.org/prop/qualifier/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?authorityValue ?authorityValueLabel ?authorityTypeLabel ?externalID
WHERE {
BIND (wd:Q16 as ?authorityType) # place authority
?authorityValue wdt:P16 ?authorityType .
    # find authority records by authority type specified above
OPTIONAL { ?authorityValue wdt:P44 ?externalID . }
    # find external IDs matched to authority value
 
    SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
      # allows English language labels to be returned for Wikibase items
  }
}
ORDER BY ASC (?authorityValueLabel)
</syntaxhighlight>


===Standard Titles===
===Standard Titles===
Bots, Bureaucrats, emailconfirmed, Administrators
30,537

edits

Navigation menu