sparql-examples

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

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

NXQ_00002

rq turtle/ttl

Proteins that are located in both the nucleus and in the cytoplasm

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot_cv: <http://nextprot.org/rdf/terminology/>

SELECT DISTINCT ?entry WHERE {
 values ?cytoloc {nextprot_cv:GO_0005737 nextprot_cv:SL-0086} # GO and SL values for cytoplasm
 values ?nucloc {nextprot_cv:GO_0005634 nextprot_cv:SL-0191} # GO and SL values for nucleus
 ?entry :isoform ?iso.
 ?iso :cellularComponent ?loc1, ?loc2 .
 ?loc1 :term /:childOf ?cytoloc .
 ?loc2 :term /:childOf ?nucloc .
 filter not exists {?loc1 :negativeEvidence ?negev} # No negative localization evidence
 filter not exists {?loc2 :negativeEvidence ?negev} # No negative localization evidence
}

# Note the dot "." at the end of statements.
# If missing, you will get a syntax error.
#
# Use a comma to retrieve two localizations in:
# ?iso :cellularComponent ?loc1, ?loc2 .
:negativeEvidence
:negativeEvidence
:isoform
:cellularComponent
:cellularComponent
:term
:childOf
:term
:childOf
EXISTS
EXISTS
Exists Clause
:negativeEvidence
?negev
?loc1
Exists Clause
:negativeEvidence
?negev
?loc2
?cytoloc
?entry
?iso
?loc1
?loc2
?negev
?nucloc
not
c1
not
VALUES ?cytoloc
:terminology/GO_0005737
:terminology/SL-0086
VALUES ?nucloc
:terminology/GO_0005634
:terminology/SL-0191