sparql-examples

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

View the Project on GitHub sib-swiss/sparql-examples

56_Distribution_of_GenericParticipant

rq turtle/ttl

Distribution of GenericParticipant

Use at

PREFIX rh: <http://rdf.rhea-db.org/>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>

SELECT
  ?genericSubClass
  ?labelGenericSubClass
  (count(?genericParticipant) as ?countGenericParticipant)
WHERE
{
  ?genericSubClass rdfs:subClassOf rh:GenericParticipant .
  ?genericSubClass rdfs:label ?labelGenericSubClass .
  ?genericParticipant rdfs:subClassOf* ?genericSubClass .
}
GROUP BY ?genericSubClass ?labelGenericSubClass

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?countGenericParticipant")
  v3("?genericParticipant"):::projected 
  v1("?genericSubClass"):::projected 
  v2("?labelGenericSubClass"):::projected 
  c2(["rh:GenericParticipant"]):::iri 
  v1 --"rdfs:subClassOf"-->  c2
  v1 --"rdfs:label"-->  v2
  v3 --"rdfs:subClassOf"-->  v1
  bind1[/"count(?genericParticipant)"/]
  v3 --o bind1
  bind1 --as--o v4