sparql-examples

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

View the Project on GitHub BiGCAT-UM/sparql-examples

029

rq turtle/ttl

Counts publication references found in Reactome-approved pathways but not in the WikiPathways Analysis Collection.

Use at

PREFIX cur: <http://vocabularies.wikipathways.org/wp#Curation:>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>

SELECT (COUNT(DISTINCT ?pubmed) AS ?count)
WHERE {
  ?pubmed a       wp:PublicationReference .
  MINUS { ?pubmed dcterms:isPartOf/wp:ontologyTag cur:AnalysisCollection }
  { ?pubmed dcterms:isPartOf/wp:ontologyTag cur:Reactome_Approved }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?count")
  v1("?pubmed"):::projected 
  a1((" "))
  a2((" "))
  c6(["wp:Curation:Reactome_Approved"]):::iri 
  c2(["wp:PublicationReference"]):::iri 
  c5(["wp:Curation:AnalysisCollection"]):::iri 
  v1 --"a"-->  c2
  subgraph minus0["MINUS"]
    style minus0 stroke-width:6px,fill:pink,stroke:red;
    v1 --"dcterms:isPartOf"-->  a1
    a1 --"wp:ontologyTag"-->  c5
  end
  v1 --"dcterms:isPartOf"-->  a2
  a2 --"wp:ontologyTag"-->  c6
  bind2[/"count(?pubmed)"/]
  v1 --o bind2
  bind2 --as--o v2