forked from sib-swiss/sparql-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" . |