Skip to content

Commit

Permalink
Fix finding taxons in which this class is found
Browse files Browse the repository at this point in the history
- updates the query to the new hierarchy
- removes an unused OPTIONAL part
  • Loading branch information
egonw authored and fnielsen committed Oct 25, 2023
1 parent 96c2fd1 commit 8dce24f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions scholia/app/templates/chemical-class_found-in-taxon.sparql
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
PREFIX target: <http://www.wikidata.org/entity/{{ q }}>

SELECT DISTINCT ?taxon ?taxonLabel (CONCAT("/taxon/", SUBSTR(STR(?taxon), 32)) AS ?taxonUrl) (COUNT(DISTINCT(?chemical)) AS ?count) WHERE {
?chemical wdt:P31/wdt:P279* target: ;
?chemical wdt:P279+ target: ;
p:P703 ?taxonStatement .
?taxonStatement ps:P703 ?taxon .
OPTIONAL {
?taxonStatement prov:wasDerivedFrom/pr:P248 ?source .
OPTIONAL { ?source wdt:P356 ?DOI . }
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?taxon ?taxonLabel
Expand Down

0 comments on commit 8dce24f

Please sign in to comment.