Skip to content

Commit

Permalink
Added VHP4Safety examples
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Nov 16, 2024
1 parent 7d9e3aa commit a21e475
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 0 deletions.
23 changes: 23 additions & 0 deletions examples/VHP4Safety/001.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@prefix ex: <https://bigcat-um.github.io/sparql-examples/VHP4Safety/> .
@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#> .

ex:001 a sh:SPARQLExecutable,
sh:SPARQLSelectExecutable ;
rdfs:comment "List all compounds with a PubChem identifier and optionally list the ToxBank Wiki link and roles."@en ;
sh:prefixes _:sparql_examples_prefixes ;
sh:select """PREFIX wd: <https://compoundcloud.wikibase.cloud/entity/>
PREFIX wdt: <https://compoundcloud.wikibase.cloud/prop/direct/>
SELECT ?cmp ?cmpLabel ?pubchem ?toxbank
(GROUP_CONCAT(DISTINCT ?roleLabel; separator=", ") AS ?roles)
WHERE {
?cmp wdt:P13 ?pubchem .
OPTIONAL { ?cmp wdt:P4 ?toxbank }
OPTIONAL { ?cmp wdt:P17 ?role . ?role rdfs:label ?roleLabel}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?cmp ?cmpLabel ?pubchem ?toxbank""" ;
schema:target <https://compoundcloud.wikibase.cloud/query/> ;
schema:keywords "PubChem", "ToxBank", "role", "compound" .
22 changes: 22 additions & 0 deletions examples/VHP4Safety/002.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@prefix ex: <https://bigcat-um.github.io/sparql-examples/VHP4Safety/> .
@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#> .

ex:001 a sh:SPARQLExecutable,
sh:SPARQLSelectExecutable ;
rdfs:comment "List all collections and the number of compounds in that collection."@en ;
sh:prefixes _:sparql_examples_prefixes ;
sh:select """PREFIX wd: <https://compoundcloud.wikibase.cloud/entity/>
PREFIX wdt: <https://compoundcloud.wikibase.cloud/prop/direct/>
SELECT ?collectionLabel (COUNT(DISTINCT ?compound) AS ?count) WHERE {
VALUES ?collectionType { wd:Q52 wd:Q54 wd:Q55 }
?collection wdt:P1 ?collectionType .
?compound wdt:P21 ?collection .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?collectionLabel
ORDER BY DESC(?count)""" ;
schema:target <https://compoundcloud.wikibase.cloud/query/> ;
schema:keywords "collection", "compound" .
20 changes: 20 additions & 0 deletions examples/VHP4Safety/003.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@prefix ex: <https://bigcat-um.github.io/sparql-examples/VHP4Safety/> .
@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#> .

ex:001 a sh:SPARQLExecutable,
sh:SPARQLSelectExecutable ;
rdfs:comment "List all compounds of which the xenometabolism is known."@en ;
sh:prefixes _:sparql_examples_prefixes ;
sh:select """PREFIX wd: <https://compoundcloud.wikibase.cloud/entity/>
PREFIX wdt: <https://compoundcloud.wikibase.cloud/prop/direct/>
SELECT ?cmp ?cmpLabel ?xenometabolism
WHERE {
?cmp wdt:P19 ?xenometabolism .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}""" ;
schema:target <https://compoundcloud.wikibase.cloud/query/> ;
schema:keywords "xenometabolism", "compound" .
25 changes: 25 additions & 0 deletions examples/VHP4Safety/004.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@prefix ex: <https://bigcat-um.github.io/sparql-examples/VHP4Safety/> .
@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#> .

ex:001 a sh:SPARQLExecutable,
sh:SPARQLSelectExecutable ;
rdfs:comment "List all compounds in the HBM4EU priority substances collection with identifier wd:Q56, optionally with their InChIKey and PubChem CID identifiers."@en ;
sh:prefixes _:sparql_examples_prefixes ;
sh:select """PREFIX wd: <https://compoundcloud.wikibase.cloud/entity/>
PREFIX wdt: <https://compoundcloud.wikibase.cloud/prop/direct/>
SELECT DISTINCT ?compound ?compoundLabel
(CONCAT("#compound/", SUBSTR(STR(?compound), 45)) AS ?compoundUrl)
?inchikey ?pubchem
WHERE {
VALUES ?collection { wd:Q56 }
?compound wdt:P21 ?collection .
OPTIONAL { ?compound wdt:P10 ?inchikey }
OPTIONAL { ?compound wdt:P13 ?pubchem }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}""" ;
schema:target <https://compoundcloud.wikibase.cloud/query/> ;
schema:keywords "HBM4EU", "compound", "collection", "InChIKey", "PubChem" .

0 comments on commit a21e475

Please sign in to comment.