Project:SPARQL/examples: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
<sparql tryit="1" list="1"> | <sparql tryit="1" list="1"> | ||
PREFIX wbt: <http://trex-taxonomy.wiki.opencura.com/prop/direct/> | |||
PREFIX wbt: <http:// | |||
SELECT | SELECT DISTINCT ?class ?classLabel (COUNT(?class) AS ?counts) WHERE { | ||
?item wbt:P1 ?class | ?item wbt:P1 ?class . | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |||
} | } | ||
GROUP BY ?class ?classLabel | |||
</sparql> | </sparql> |
Revision as of 12:32, 14 September 2020
Counts of classes
The following query uses these:
PREFIX wbt: <http://trex-taxonomy.wiki.opencura.com/prop/direct/>
SELECT DISTINCT ?class ?classLabel (COUNT(?class) AS ?counts) WHERE {
?item wbt:P1 ?class .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?class ?classLabel