SPARQL Examples: Difference between revisions

From Semantic Lab
Jump to navigation Jump to search
(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"....")
(No difference)

Revision as of 05:22, 8 March 2024

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