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_00279

Proteins for which an interaction mapping region is described for both interactants

Use at

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

SELECT DISTINCT ?entry (str(?gen) AS ?gene) ?entry2 (str(?gen2) AS ?gene2) WHERE {
 ?entry :isoform ?iso; :gene / :recommendedName / rdfs:label ?gen .
 ?iso :interactionMapping / :interactant ?entry2.
 ?entry2 :gene / :recommendedName / rdfs:label ?gen2 .
 filter exists { ?entry2 :isoform / :interactionMapping / :interactant ?entry.}
} order by ?entry
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?entry"):::projected 
  v2("?entry2"):::projected 
  v4("?gen"):::projected 
  v5("?gen2"):::projected 
  v6("?gene")
  v7("?gene2")
  v3("?iso")
  a3((" "))
  a4((" "))
  a5((" "))
  a6((" "))
  a7((" "))
  a1((" "))
  a2((" "))
  f0[[" "]]
  subgraph f0e0["Exists Clause"]
    e0v1 --":isoform"-->  e0a1
    e0a1 --":interactionMapping"-->  e0a2
    e0a2 --":interactant"-->  e0v2
    e0v2("?entry"):::projected 
    e0v1("?entry2"):::projected 
    e0a1((" ")):::projected 
    e0a2((" ")):::projected 
  end
  f0--EXISTS--> f0e0
  f0 --> v2
  f0 --> c1
  f0 --> a1
  f0 --> c2
  f0 --> a2
  f0 --> c3
  f0 --> v1
  v2 --":isoform"-->  a1
  a1 --":interactionMapping"-->  a2
  a2 --":interactant"-->  v1
  v1 --":isoform"-->  v3
  v1 --":gene"-->  a3
  a3 --":recommendedName"-->  a4
  a4 --"rdfs:label"-->  v4
  v3 --":interactionMapping"-->  a5
  a5 --":interactant"-->  v2
  v2 --":gene"-->  a6
  a6 --":recommendedName"-->  a7
  a7 --"rdfs:label"-->  v5
  bind1[/"str(?gen)"/]
  v4 --o bind1
  bind1 --as--o v6
  bind2[/"str(?gen2)"/]
  v5 --o bind2
  bind2 --as--o v7