sparql-examples

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

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

053

rq turtle/ttl

Finds pathways that contain no data nodes, indicating empty or incomplete pathway entries that may need curation.

Use at

PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
prefix wp:      <http://vocabularies.wikipathways.org/wp#>
prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
prefix dcterms: <http://purl.org/dc/terms/>
prefix xsd:     <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?pathway
WHERE{
?pathway a wp:Pathway, skos:Collection .
FILTER NOT EXISTS {?node dcterms:isPartOf ?pathway.
?node a wp:DataNode}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?node")
  v2("?pathway"):::projected 
  c3(["wp:DataNode"]):::iri 
  c5(["skos:Collection"]):::iri 
  c4(["wp:Pathway"]):::iri 
  f0[["not  "]]
  subgraph f0e0["Exists Clause"]
    e0v1 --"dcterms:isPartOf"-->  e0v2
    e0v1 --"a"-->  e0c3
    e0v1("?node"):::projected 
    e0v2("?pathway"):::projected 
    e0c3(["wp:DataNode"]):::iri 
  end
  f0--EXISTS--> f0e0
  f0 --> v1
  f0 --> c1
  f0 --> v2
  f0 --> c2
  f0 --> c3
  v1 --"dcterms:isPartOf"-->  v2
  v1 --"a"-->  c3
  v2 --"a"-->  c4
  v2 --"a"-->  c5