A set of SPARQL examples that are used in different SIB resources
List all xrefs attached to the groups annotated with at least three Interpro domains (IPR011990, IPR013083 and IPR001841)
PREFIX : <http://purl.orthodb.org/>
PREFIX interpro: <http://www.ebi.ac.uk/interpro/entry/>
SELECT ?og ?og_description (group_concat(distinct ?xref; SEPARATOR="; ") as ?xrefs)
WHERE {
?og a :OrthoGroup; :name ?og_description.
?og :xref [a :Xref; :xrefResource ?xref].
?og :xref [a :Xref; :xrefResource interpro:IPR011990].
?og :xref [a :Xref; :xrefResource interpro:IPR013083].
?og :xref [a :Xref; :xrefResource interpro:IPR001841].
} GROUP BY ?og ?og_description
ORDER BY ?og_description
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?og"):::projected
v1("?og_description"):::projected
v3("?xref"):::projected
v4("?xrefs")
a1((" "))
a2((" "))
a3((" "))
a4((" "))
c4([":Xref"]):::iri
c9(["interpro:IPR001841"]):::iri
c2([":OrthoGroup"]):::iri
c8(["interpro:IPR013083"]):::iri
c7(["interpro:IPR011990"]):::iri
v2 --"a"--> c2
v2 --":name"--> v1
a1 --"a"--> c4
a1 --":xrefResource"--> v3
v2 --":xref"--> a1
a2 --"a"--> c4
a2 --":xrefResource"--> c7
v2 --":xref"--> a2
a3 --"a"--> c4
a3 --":xrefResource"--> c8
v2 --":xref"--> a3
a4 --"a"--> c4
a4 --":xrefResource"--> c9
v2 --":xref"--> a4
bind1[/"?xref"/]
v3 --o bind1
bind1 --as--o v4