sparql-examples

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

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

neXtProt/NXQ_00297

PDB structures spanning the complete sequence of the mature protein

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX db: <http://nextprot.org/rdf/db/>

select ?entry (group_concat(distinct str(?pdbac); SEPARATOR = ",") as ?pdbacs) WHERE {
 ?entry :isoform ?iso.
 ?iso :pdbMapping ?pdbmap.
 ?pdbmap :evidence /:reference ?ref.
 ?ref :provenance db:PDB.
 ?ref :accession ?pdbac.
 ?pdbmap :start ?pdbstart ; :end ?pdbend.
 ?iso :matureProtein [ :start ?mstart ; :end ?mend]
 filter (?mend-?mstart > 0)
 filter ((?pdbstart <= ?mstart) && (?pdbend >= ?mend))
} group by ?entry
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?entry"):::projected 
  v6("?iso")
  v4("?mend")
  v2("?mstart")
  v9("?pdbac"):::projected 
  v10("?pdbacs")
  v3("?pdbend")
  v7("?pdbmap")
  v1("?pdbstart")
  v8("?ref")
  a1((" "))
  a2((" "))
  c7([":db/PDB"]):::iri 
  f0[["?pdbstart <= ?mstart?pdbend >= ?mend"]]
  f0 --> v1
  f0 --> v2
  f0 --> v3
  f0 --> v4
  f1[["?mend - ?mstart > '0^^xsd:integer'"]]
  f1 --> v4
  f1 --> v2
  v5 --":isoform"-->  v6
  v6 --":pdbMapping"-->  v7
  v7 --":evidence"-->  a1
  a1 --":reference"-->  v8
  v8 --":provenance"-->  c7
  v8 --":accession"-->  v9
  v7 --":start"-->  v1
  v7 --":end"-->  v3
  a2 --":start"-->  v2
  a2 --":end"-->  v4
  v6 --":matureProtein"-->  a2
  bind3[/"str(?pdbac)"/]
  v9 --o bind3
  bind3 --as--o v10