SPARQL Examples

From Semantic Lab
Revision as of 05:22, 8 March 2024 by MattTest (talk | contribs) (Created page with "=== Cats === This query looks at all items whose value of {{P|31}} is {{Q|146}}. It uses the service wikibase:label to return the labels in your default language or in English. {{SPARQL|query=# All records associated with our various projects on Wikibase SELECT DISTINCT ?item ?itemLabel ?type ?typeLabel ?project ?projectLabel WHERE { ?item wdt:P1 ?type. ?item wdt:P11 ?project. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Cats

This query looks at all items whose value of Template:P is Template:Q. It uses the service wikibase:label to return the labels in your default language or in English.


 # All records associated with our various projects on Wikibase

SELECT DISTINCT ?item ?itemLabel ?type ?typeLabel ?project ?projectLabel WHERE {

   ?item wdt:P1 ?type.
   ?item wdt:P11 ?project.
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
 

} ORDER BY ?projectLabel