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_00284

Distribution of interaction detection methods for each year (ENYO data)

Use at

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

select distinct (str(?y) as ?year) (str(?psimi) as ?method) (count (distinct ?itid) as ?itcnt) where {
 ?entry :isoform / :binaryInteraction ?interaction.
 ?interaction :evidence ?ev; :entryAnnotationId ?itid .
  ?ev :reference ?publi; :interactionDetectionMethod / rdfs:label ?psimi .
 ?publi :year ?y.
} group by ?y ?psimi
order by desc(?year) desc(?itcnt)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?entry")
  v5("?ev")
  v4("?interaction")
  v11("?itcnt")
  v6("?itid"):::projected 
  v10("?method")
  v8("?psimi"):::projected 
  v7("?publi")
  v9("?y"):::projected 
  v10("?year")
  a1((" "))
  a2((" "))
  v3 --":isoform"-->  a1
  a1 --":binaryInteraction"-->  v4
  v4 --":evidence"-->  v5
  v4 --":entryAnnotationId"-->  v6
  v5 --":reference"-->  v7
  v5 --":interactionDetectionMethod"-->  a2
  a2 --"rdfs:label"-->  v8
  v7 --":year"-->  v9
  bind1[/"str(?y)"/]
  v9 --o bind1
  bind1 --as--o v10
  bind2[/"str(?psimi)"/]
  v8 --o bind2
  bind2 --as--o v10
  bind3[/"count(?itid)"/]
  v6 --o bind3
  bind3 --as--o v11