sparql-examples

A set of SPARQL examples that are used in different TGX resources

View the Project on GitHub BiGCAT-UM/sparql-examples

073

rq turtle/ttl

Counts the data nodes per data source in WikiPathways.

Use at

PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>

SELECT (str(?datasourceLit) as ?datasource)
       (count(DISTINCT ?dataNode) as ?numberEntries)
WHERE {
  ?concept dc:source ?datasourceLit ;
    wp:isAbout ?dataNode .
}
GROUP BY ?datasourceLit
ORDER BY DESC(?numberEntries)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?concept")
  v4("?dataNode"):::projected 
  v5("?datasource")
  v3("?datasourceLit"):::projected 
  v6("?numberEntries")
  v2 --"dc:source"-->  v3
  v2 --"wp:isAbout"-->  v4
  bind1[/"str(?datasourceLit)"/]
  v3 --o bind1
  bind1 --as--o v5
  bind2[/"count(?dataNode)"/]
  v4 --o bind2
  bind2 --as--o v6