Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/commit-index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ on:
push:
branches: [master]
tags: ['*']
# Commits pushed by "Process SPARQL TTL files" do not trigger push workflows.
workflow_run:
workflows: ["Process SPARQL TTL files"]
types: [completed]
workflow_dispatch:

permissions:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Examples

# Checks the example .ttl files on every pull request and push. On master it also
# publishes the examples-index branch that the SPARQL editor reads: index.json,
# history.json, a snapshot per version, the combined Turtle file and .rq exports.
# The tools come from wikipathways/Snorql-UI (tools/examples).

on:
pull_request:
push:
branches: [master]
tags: ['*']
workflow_dispatch:

jobs:
examples:
uses: wikipathways/Snorql-UI/.github/workflows/examples-index.yml@v1.4.0
with:
tools-ref: v1.4.0
publish: ${{ github.event_name != 'pull_request' }}
sib-project: WikiPathways
permissions:
contents: write
37 changes: 0 additions & 37 deletions .github/workflows/extractRQs.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/live-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Live test

# Runs every example against the WikiPathways SPARQL endpoint once a week and
# checks the expected number of results (snorql:expect). A failing run means a
# query broke, an endpoint it federates with is down, or the data changed.

on:
schedule:
- cron: '17 5 * * 1'
workflow_dispatch:

jobs:
live:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: wikipathways/Snorql-UI
ref: v1.4.0
path: .snorql-tools
sparse-checkout: tools/examples
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install -r .snorql-tools/tools/examples/requirements.txt
- name: Run the examples
run: python .snorql-tools/tools/examples/snorql_examples.py live --timeout 150
38 changes: 38 additions & 0 deletions A. Metadata/HomologyConvertedPathways.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix param: <https://w3id.org/snorql/param#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@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 snorql: <https://w3id.org/snorql/ns#> .
@prefix spex: <https://purl.expasy.org/sparql-examples/ontology#> .
@prefix wpcat: <https://sparql.wikipathways.org/.well-known/sparql-examples/category/> .
@prefix wpq: <https://sparql.wikipathways.org/.well-known/sparql-examples/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

wpq:WPQ010 a sh:SPARQLExecutable, sh:SPARQLSelectExecutable ;
dcterms:identifier "WPQ010" ;
rdfs:label "Homology-Converted Pathways"@en ;
rdfs:comment "List all homology converted pathways."@en ;
schema:version "1.0.0" ;
dcterms:created "2024-10-20"^^xsd:date ;
dcterms:creator <https://orcid.org/0000-0001-7542-0286> ;
dcterms:license <https://www.gnu.org/licenses/gpl-3.0.html> ;
dcterms:subject wpcat:Metadata ;
schema:keywords "homology", "organism" ;
schema:target <https://sparql.wikipathways.org/sparql> ;
prov:wasDerivedFrom <https://github.com/BiGCAT-UM/sparql-examples/blob/4830ae7e0942bb1958a7000d44c82b47391e61d0/examples/WikiPathways/010.ttl> ;
snorql:expect [ snorql:minResults 1 ] ;
sh:select """PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX cur: <http://vocabularies.wikipathways.org/wp#Curation:>

SELECT DISTINCT ?pathway (str(?title) as ?PathwayTitle) ?organism
WHERE {
?pathway wp:ontologyTag cur:Homology_Converted ;
a wp:Pathway ;
dc:title ?title ;
wp:organismName ?organism .
} ORDER BY ASC(?organism) ASC(?PathwayTitle)""" .
40 changes: 40 additions & 0 deletions A. Metadata/authors.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix param: <https://w3id.org/snorql/param#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@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 snorql: <https://w3id.org/snorql/ns#> .
@prefix spex: <https://purl.expasy.org/sparql-examples/ontology#> .
@prefix wpcat: <https://sparql.wikipathways.org/.well-known/sparql-examples/category/> .
@prefix wpq: <https://sparql.wikipathways.org/.well-known/sparql-examples/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

wpq:WPQ011 a sh:SPARQLExecutable, sh:SPARQLSelectExecutable ;
dcterms:identifier "WPQ011" ;
rdfs:label "Authors of All Pathways"@en ;
rdfs:comment "Lists all pathway authors with their name, homepage, and ORCID, along with the number of pathways each author created."@en ;
schema:version "1.0.0" ;
dcterms:created "2026-01-13"^^xsd:date ;
dcterms:creator <https://orcid.org/0000-0001-7542-0286> ;
dcterms:contributor <https://orcid.org/0000-0003-2230-0840> ;
dcterms:license <https://www.gnu.org/licenses/gpl-3.0.html> ;
dcterms:subject wpcat:Metadata ;
schema:keywords "metadata" ;
schema:target <https://sparql.wikipathways.org/sparql> ;
snorql:alias "A. Metadata/authors.rq" ;
prov:wasDerivedFrom <https://github.com/wikipathways/SPARQLQueries/blob/56af22ea28b931bcc0f93575c2e65a5c585b8a12/A.%20Metadata/authors.rq> ;
snorql:expect [ snorql:minResults 1 ] ;
sh:select """PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT (COUNT(DISTINCT ?pathway) AS ?count) ?page ?name ?orcid WHERE {
?author_ ^dc:creator ?pathway ;
a foaf:Person .
OPTIONAL { ?author_ foaf:homepage ?page }
OPTIONAL { ?author_ foaf:name ?name }
OPTIONAL { ?author_ dc:identifier ?orcid }
} GROUP BY ?page ?name ?orcid
ORDER BY DESC(?count)""" .
37 changes: 37 additions & 0 deletions A. Metadata/datacounts/PathwayCountPerOntologyTerm.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix param: <https://w3id.org/snorql/param#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@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 snorql: <https://w3id.org/snorql/ns#> .
@prefix spex: <https://purl.expasy.org/sparql-examples/ontology#> .
@prefix wpcat: <https://sparql.wikipathways.org/.well-known/sparql-examples/category/> .
@prefix wpq: <https://sparql.wikipathways.org/.well-known/sparql-examples/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

wpq:WPQ067 a sh:SPARQLExecutable, sh:SPARQLSelectExecutable ;
dcterms:identifier "WPQ067" ;
rdfs:label "Pathway Count per Ontology Term"@en ;
rdfs:comment "Counts the pathways tagged with each ontology term. Pathways can be tagged with terms from the Pathway, Cell Line and Disease ontologies; wp:ontologyTag covers all of them, as well as the curation and community tags."@en ;
schema:version "1.0.0" ;
dcterms:created "2024-10-20"^^xsd:date ;
dcterms:creator <https://www.wikipathways.org/> ;
dcterms:contributor <https://orcid.org/0000-0001-7542-0286> ;
dcterms:license <https://www.gnu.org/licenses/gpl-3.0.html> ;
dcterms:subject wpcat:DataCounts ;
schema:keywords "counts", "ontology" ;
schema:target <https://sparql.wikipathways.org/sparql> ;
prov:wasDerivedFrom <https://github.com/BiGCAT-UM/sparql-examples/blob/4830ae7e0942bb1958a7000d44c82b47391e61d0/examples/WikiPathways/067.ttl> ;
prov:wasDerivedFrom <https://www.wikipathways.org/sparql.html> ;
snorql:expect [ snorql:minResults 1 ] ;
sh:select """PREFIX wp: <http://vocabularies.wikipathways.org/wp#>

SELECT DISTINCT ?pwOntologyTerm (count(?pwOntologyTerm) as ?pathwayCount)
WHERE {
?pathwayRDF wp:ontologyTag ?pwOntologyTerm .
}
GROUP BY ?pwOntologyTerm
ORDER BY DESC(?pathwayCount)""" .
57 changes: 57 additions & 0 deletions A. Metadata/datacounts/averagePerPathway.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix param: <https://w3id.org/snorql/param#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@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 snorql: <https://w3id.org/snorql/ns#> .
@prefix spex: <https://purl.expasy.org/sparql-examples/ontology#> .
@prefix wpcat: <https://sparql.wikipathways.org/.well-known/sparql-examples/category/> .
@prefix wpq: <https://sparql.wikipathways.org/.well-known/sparql-examples/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

wpq:WPQ012 a sh:SPARQLExecutable, sh:SPARQLSelectExecutable ;
dcterms:identifier "WPQ012" ;
rdfs:label "Average Entity Type per Pathway"@en ;
rdfs:comment "Calculates the average, minimum, and maximum number of a selected entity type per pathway in WikiPathways."@en ;
schema:version "1.0.0" ;
dcterms:created "2026-03-30"^^xsd:date ;
dcterms:creator <https://orcid.org/0000-0003-2230-0840> ;
dcterms:license <https://www.gnu.org/licenses/gpl-3.0.html> ;
dcterms:subject wpcat:DataCounts ;
schema:keywords "metadata", "counts" ;
schema:target <https://sparql.wikipathways.org/sparql> ;
snorql:alias "A. Metadata/datacounts/averagePerPathway.rq" ;
prov:wasDerivedFrom <https://github.com/wikipathways/SPARQLQueries/blob/f9de718ebdcca57dadb773d47fa4e342cf386857/A.%20Metadata/datacounts/averagePerPathway.rq> ;
snorql:expect [ snorql:minResults 1 ] ;
sh:parameter [
a sh:Parameter ;
sh:path param:entityType ;
sh:name "Entity Type" ;
sh:defaultValue "DataNode" ;
sh:nodeKind sh:IRI ;
snorql:valueTemplate "http://vocabularies.wikipathways.org/wp#{value}" ;
snorql:option [ rdf:value "DataNode" ; rdfs:label "Data Nodes" ; sh:order 1 ] ;
snorql:option [ rdf:value "GeneProduct" ; rdfs:label "Gene Products" ; sh:order 2 ] ;
snorql:option [ rdf:value "Interaction" ; rdfs:label "Interactions" ; sh:order 3 ] ;
snorql:option [ rdf:value "Metabolite" ; rdfs:label "Metabolites" ; sh:order 4 ] ;
snorql:option [ rdf:value "Protein" ; rdfs:label "Proteins" ; sh:order 5 ] ;
sh:order 1
] ;
sh:select """PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>

SELECT (AVG(?no) AS ?avg)
(MIN(?no) AS ?min)
(MAX(?no) AS ?max)
WHERE {
SELECT ?Pathway (COUNT(?entity) AS ?no)
WHERE {
VALUES ?entityType { <http://vocabularies.wikipathways.org/wp#DataNode> }
?entity a ?entityType ;
dcterms:isPartOf ?Pathway .
?Pathway a wp:Pathway .}
GROUP BY ?Pathway
}""" .
47 changes: 47 additions & 0 deletions A. Metadata/datacounts/countOfEntityType.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix param: <https://w3id.org/snorql/param#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@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 snorql: <https://w3id.org/snorql/ns#> .
@prefix spex: <https://purl.expasy.org/sparql-examples/ontology#> .
@prefix wpcat: <https://sparql.wikipathways.org/.well-known/sparql-examples/category/> .
@prefix wpq: <https://sparql.wikipathways.org/.well-known/sparql-examples/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

wpq:WPQ013 a sh:SPARQLExecutable, sh:SPARQLSelectExecutable ;
dcterms:identifier "WPQ013" ;
rdfs:label "Count of Entity Type"@en ;
rdfs:comment "Counts the total number of a selected entity type in WikiPathways."@en ;
schema:version "1.0.0" ;
dcterms:created "2026-03-30"^^xsd:date ;
dcterms:creator <https://orcid.org/0000-0003-2230-0840> ;
dcterms:license <https://www.gnu.org/licenses/gpl-3.0.html> ;
dcterms:subject wpcat:DataCounts ;
schema:keywords "metadata", "counts" ;
schema:target <https://sparql.wikipathways.org/sparql> ;
snorql:alias "A. Metadata/datacounts/countOfEntityType.rq" ;
prov:wasDerivedFrom <https://github.com/wikipathways/SPARQLQueries/blob/3fd553e6b24c4c9d88604eda578ecd8ad192a5c6/A.%20Metadata/datacounts/countOfEntityType.rq> ;
snorql:expect [ snorql:minResults 1 ] ;
sh:parameter [
a sh:Parameter ;
sh:path param:entityType ;
sh:name "Entity Type" ;
sh:defaultValue "DataNode" ;
sh:nodeKind sh:IRI ;
snorql:valueTemplate "http://vocabularies.wikipathways.org/wp#{value}" ;
snorql:option [ rdf:value "DataNode" ; rdfs:label "Data Nodes" ; sh:order 1 ] ;
snorql:option [ rdf:value "GeneProduct" ; rdfs:label "Gene Products" ; sh:order 2 ] ;
snorql:option [ rdf:value "Interaction" ; rdfs:label "Interactions" ; sh:order 3 ] ;
snorql:option [ rdf:value "Metabolite" ; rdfs:label "Metabolites" ; sh:order 4 ] ;
snorql:option [ rdf:value "Protein" ; rdfs:label "Proteins" ; sh:order 5 ] ;
sh:order 1
] ;
sh:select """SELECT DISTINCT (COUNT(?entity) AS ?count)
WHERE {
VALUES ?entityType { <http://vocabularies.wikipathways.org/wp#DataNode> }
?entity a ?entityType .
}""" .
36 changes: 36 additions & 0 deletions A. Metadata/datacounts/countPathways.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix param: <https://w3id.org/snorql/param#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@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 snorql: <https://w3id.org/snorql/ns#> .
@prefix spex: <https://purl.expasy.org/sparql-examples/ontology#> .
@prefix wpcat: <https://sparql.wikipathways.org/.well-known/sparql-examples/category/> .
@prefix wpq: <https://sparql.wikipathways.org/.well-known/sparql-examples/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

wpq:WPQ014 a sh:SPARQLExecutable, sh:SPARQLSelectExecutable ;
dcterms:identifier "WPQ014" ;
rdfs:label "Count of Pathways"@en ;
rdfs:comment "Counts the total number of pathways in WikiPathways."@en ;
schema:version "1.0.0" ;
dcterms:created "2020-08-12"^^xsd:date ;
dcterms:creator <https://orcid.org/0000-0003-2230-0840> ;
dcterms:contributor <https://orcid.org/0000-0001-7542-0286> ;
dcterms:license <https://www.gnu.org/licenses/gpl-3.0.html> ;
dcterms:subject wpcat:DataCounts ;
schema:keywords "metadata", "counts" ;
schema:target <https://sparql.wikipathways.org/sparql> ;
snorql:alias "A. Metadata/datacounts/countPathways.rq" ;
prov:wasDerivedFrom <https://github.com/wikipathways/SPARQLQueries/blob/f9de718ebdcca57dadb773d47fa4e342cf386857/A.%20Metadata/datacounts/countPathways.rq> ;
snorql:expect [ snorql:minResults 1 ] ;
sh:select """PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>

SELECT DISTINCT (count(?Pathway) as ?PathwayCount)
WHERE {
?Pathway a wp:Pathway, skos:Collection .
}""" .
Loading
Loading