A set of SPARQL examples that are used in different TGX resources
License: https://www.gnu.org/licenses/gpl-3.0
Uses method in: https://github.com/WDscholia/scholia/tree/master/scholia/app/templates/pathway_participants.sparql
Pathway aspect: participants
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX target: <http://www.wikidata.org/entity/Q28031254>
SELECT ?part ?partLabel ?partDescription ?type
WITH {
SELECT ?part (GROUP_CONCAT(DISTINCT ?type_label; separator=", ") AS ?type)
WHERE {
VALUES ?process { wd:Q4915012 wd:Q2996394 }
target: wdt:P31 ?process ;
wdt:P527 ?part .
OPTIONAL {
?part wdt:P31 ?type_ .
?type_ rdfs:label ?type_label .
FILTER (LANG(?type_label) = 'en')
}
} GROUP BY ?part
} AS %result
WHERE {
INCLUDE %result
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" . }
} ORDER BY ASC(?partLabel)
graph TD