A set of SPARQL examples that are used in different SIB resources
Count the number of Human Transporter Proteins
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rh: <http://rdf.rhea-db.org/>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
PREFIX faldo: <http://biohackathon.org/resource/faldo#>
SELECT
(COUNT(DISTINCT ?protein) AS ?humanTransportEnzymes)
WHERE {
GRAPH <http://sparql.uniprot.org/uniprot> {
?protein up:organism taxon:9606 ;
up:annotation ?a .
?a a up:Catalytic_Activity_Annotation ;
up:catalyticActivity ?ca .
?ca up:catalyzedReaction ?rhea .
}
GRAPH <https://sparql.rhea-db.org/rhea>{
?rhea rh:isTransport true .
}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?a")
v3("?ca")
v5("?humanTransportEnzymes")
v1("?protein"):::projected
v4("?rhea")
c10(["true^^xsd:boolean"]):::literal
c6(["up:Catalytic_Activity_Annotation"]):::iri
c2(["taxon:9606"]):::iri
v1 --"up:organism"--> c2
v1 --"up:annotation"--> v2
v2 --"a"--> c6
v2 --"up:catalyticActivity"--> v3
v3 --"up:catalyzedReaction"--> v4
v4 --"rh:isTransport"--> c10
bind1[/"count(?protein)"/]
v1 --o bind1
bind1 --as--o v5