sparql-examples

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

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

144

rq turtle/ttl

Project aspect: Statistics for projects identifiers

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
# title: Statistics for projects identifiers
SELECT ?count ?description {
  {
    { SELECT (COUNT(*) AS ?count) WHERE { [] wdt:P3400 []. } }
    BIND("Total number of projects with a CORDIS number" AS ?description)
  }
  UNION 
  {
    { SELECT (COUNT(*) AS ?count) WHERE { [] wdt:P4870 []. } }
    BIND("Total number of projects with a GEPRIS number" AS ?description)
  }
  UNION 
  {
    { SELECT (COUNT(*) AS ?count) WHERE { [] wdt:P6536 []. } }
    BIND("Total number of projects with a Gateway to Research Project ID" AS ?description)
  }
}
ORDER BY DESC(?count)

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?count"):::projected 
  v3("?description"):::projected 
  a1((" "))
  a2((" "))
  a3((" "))
  a4((" "))
  a5((" "))
  a6((" "))
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    subgraph union1[" Union "]
    subgraph union1l[" "]
      style union1l fill:#abf,stroke-dasharray: 3 3;
      a5 --"wdt:P6536"-->  a6
      bind1[/"count(*)"/]
      bind1 --as--o v3
      bind2[/"'Total number of projects with a Gateway to Research Project ID'"/]
      bind2 --as--o v3
    end
    subgraph union1r[" "]
      style union1r fill:#abf,stroke-dasharray: 3 3;
      a3 --"wdt:P4870"-->  a4
      bind4[/"count(*)"/]
      bind4 --as--o v3
      bind5[/"'Total number of projects with a GEPRIS number'"/]
      bind5 --as--o v3
    end
    union1r <== or ==> union1l
    end
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    a1 --"wdt:P3400"-->  a2
    bind7[/"count(*)"/]
    bind7 --as--o v3
    bind8[/"'Total number of projects with a CORDIS number'"/]
    bind8 --as--o v3
  end
  union0r <== or ==> union0l
  end