A set of SPARQL examples that are used in different SIB resources
Proteins with subcellular location gold and list of all these locations
PREFIX : <http://nextprot.org/rdf/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entry (group_concat(distinct str(?loclab); SEPARATOR = ",") as ?locs) WHERE {
?entry :isoform ?iso.
?iso :cellularComponent ?locannot .
?locannot :term ?locterm .
?locterm rdfs:label ?loclab .
?locannot :evidence ?locev .
?locev :quality :GOLD .
filter not exists {?locannot :negativeEvidence ?locev .}
}
GROUP BY ?entry
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?entry"):::projected
v4("?iso")
v1("?locannot")
v2("?locev")
v6("?loclab"):::projected
v7("?locs")
v5("?locterm")
c8([":GOLD"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --":negativeEvidence"--> e0v2
e0v1("?locannot"):::projected
e0v2("?locev"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --":negativeEvidence"--> v2
v3 --":isoform"--> v4
v4 --":cellularComponent"--> v1
v1 --":term"--> v5
v5 --"rdfs:label"--> v6
v1 --":evidence"--> v2
v2 --":quality"--> c8
bind2[/"str(?loclab)"/]
v6 --o bind2
bind2 --as--o v7