Skip to content

Commit

Permalink
Added a query to list all diseases linked to a pathway
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw authored Nov 23, 2024
1 parent 21be09e commit cd6fa44
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/WikiPathways/005.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@prefix ex: <https://bigcat-um.github.io/sparql-examples/WikiPathways/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix obo: <http://purl.obolibrary.org/obo/> .

ex:005 a sh:SPARQLExecutable,
sh:SPARQLSelectExecutable ;
rdfs:comment "List all diseases and the number of pathways they are linked to, in decreasing order."@en ;
sh:prefixes _:sparql_examples_prefixes ;
sh:select """PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?diseaseLabel ?disease (COUNT(DISTINCT ?pathway) AS ?count)
WHERE {
?pathway wp:diseaseOntologyTag ?disease ;
a wp:Pathway .
?disease rdfs:label ?diseaseLabel .
} ORDER BY DESC(?count)""" ;
schema:target <https://sparql.wikipathways.org/sparql> ;
schema:keywords "disease" .

0 comments on commit cd6fa44

Please sign in to comment.