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_00248

Variants with phenotype annotation that map to a 3D structure

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?entry (str(?pfname) as ?phenovar) (concat(str(sample(?pdbac)),"...") as ?pdbsample) WHERE {
 ?entry :gene / :name / rdfs:label ?gen .
 ?entry :isoform ?iso.
 ?iso :proteoform ?pf .
 ?pf rdfs:label ?pfname .
 ?pf :phenotypicVariation ?pv1 .
 ?pf :difference ?pfmod .
 ?pfmod a :Variant .
 ?pfmod :start ?vstart; :end ?vend .
 ?iso :pdbMapping ?pdbmap.
 ?pdbmap rdfs:comment ?pdbac.
 ?pdbmap :start ?pdbstart ; :end ?pdbend.
 filter(?pdbstart <= ?vstart && ?pdbend >= ?vend )
} group by ?entry ?pfname
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v14("?_anon_aaf95e3c346c4c97af230d5bcfeba8ab2668"):::projected 
  v5("?entry"):::projected 
  v6("?gen")
  v7("?iso")
  v13("?pdbac")
  v3("?pdbend")
  v12("?pdbmap")
  v16("?pdbsample")
  v1("?pdbstart")
  v8("?pf")
  v11("?pfmod")
  v9("?pfname"):::projected 
  v15("?phenovar")
  v10("?pv1")
  v4("?vend")
  v2("?vstart")
  a1((" "))
  a2((" "))
  c9([":Variant"]):::iri 
  f0[["?pdbstart <= ?vstart?pdbend >= ?vend"]]
  f0 --> v1
  f0 --> v2
  f0 --> v3
  f0 --> v4
  v5 --":gene"-->  a1
  a1 --":name"-->  a2
  a2 --"rdfs:label"-->  v6
  v5 --":isoform"-->  v7
  v7 --":proteoform"-->  v8
  v8 --"rdfs:label"-->  v9
  v8 --":phenotypicVariation"-->  v10
  v8 --":difference"-->  v11
  v11 --"a"-->  c9
  v11 --":start"-->  v2
  v11 --":end"-->  v4
  v7 --":pdbMapping"-->  v12
  v12 --"rdfs:comment"-->  v13
  v12 --":start"-->  v1
  v12 --":end"-->  v3
  bind2[/"sample(?pdbac)"/]
  v13 --o bind2
  bind2 --as--o v14
  bind3[/"str(?pfname)"/]
  v9 --o bind3
  bind3 --as--o v15
  bind4[/"concat(str(),'...')"/]
  null --o bind4
  bind4 --as--o v16