Project:SPARQL/examples: Difference between revisions

Line 592: Line 592:


SELECT  ?host ?hostLabel (COUNT (DISTINCT ?symbiont) AS ?count) WHERE {
SELECT  ?host ?hostLabel (COUNT (DISTINCT ?symbiont) AS ?count) WHERE {
   ?host ppt:P19 ?symbiont.
   ?host ppt:P19|ppt:P41 ?symbiont.
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?host ?hostLabel ORDER BY DESC(?count)
} GROUP BY ?host ?hostLabel ORDER BY DESC(?count)