Help:SPARQL query examples: Difference between revisions

From DataTrek
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
<div class="mw-heading mw-heading2">
<div class="mw-heading mw-heading2">
   <h2>Queries with cats</h2>
   <h2>Queries with cats</h2>

Revision as of 23:37, 9 January 2025

Queries with cats

Cats

SELECT ?cat ?catLabel WHERE {
  ?cat prefix:P1 prefix:Q2
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}

Queries with dogs

Dogs

SELECT ?dog ?dogLabel WHERE {
  ?dog prefix:P1 prefix:Q3
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}