Skip to content

Commit

Permalink
Fix #2529 normalized query for biological pathway
Browse files Browse the repository at this point in the history
Removed unnecessary OPTIONAL block as labeling service sets
the ?pathwayDescription variable.

Styling change to the code: use the target variable.
  • Loading branch information
fnielsen committed Oct 18, 2024
1 parent 7bf1aab commit b436ea7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions scholia/app/templates/chemical_biological-processes.sparql
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
PREFIX target: <http://www.wikidata.org/entity/{{ q }}>

SELECT DISTINCT ?pathway ?pathwayLabel (CONCAT("/pathway/", SUBSTR(STR(?pathway), 32)) AS ?pathwayUrl) ?pathwayDescription WHERE {
VALUES ?chemical { target: }
?chemical wdt:P361 ?pathway.
?pathway wdt:P527 ?chemical.
?pathway wdt:P31 wd:Q2996394.
OPTIONAL {
?pathway schema:description ?pathwayDescription .
FILTER (LANG(?pathwayDescription) = "[AUTO_LANGUAGE],en")
}
SELECT DISTINCT
?pathway ?pathwayLabel
(CONCAT("/pathway/", SUBSTR(STR(?pathway), 32)) AS ?pathwayUrl)
?pathwayDescription
WHERE {
?pathway wdt:P527 target: ;
wdt:P31 wd:Q2996394 .
target: wdt:P361 ?pathway .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ASC(?pathwayLabel)
LIMIT 250
}
ORDER BY ASC(?pathwayLabel)
LIMIT 250

0 comments on commit b436ea7

Please sign in to comment.