Project:SPARQL/examples: Difference between revisions

Jump to navigation Jump to search
Line 586: Line 586:
===Host taxa sorted by number of interactions===
===Host taxa sorted by number of interactions===


Treat these counts with a pinch of salt, because species concepts differ.
Counting natural interactions only. Treat these counts with a pinch of salt, because species concepts differ.


<sparql tryit="1">
<sparql tryit="1">
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|ppt:P41 ?symbiont.
   ?host ppt:P19 ?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)

Navigation menu