Skip to content

Instantly share code, notes, and snippets.

@egonw
Created June 3, 2018 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egonw/df5c8033eb1e2510bcaa0373d684d213 to your computer and use it in GitHub Desktop.
Save egonw/df5c8033eb1e2510bcaa0373d684d213 to your computer and use it in GitHub Desktop.
Get all statements backed by a particular Figshare data set.
SELECT DISTINCT ?compound ?compoundLabel ?propEntity ?propEntityLabel ?value ?source ?sourceLabel ?doi
WITH {
SELECT DISTINCT ?compound ?propEntity ?value ?source ?doi WHERE {
?compound ?propp ?statement ;
wdt:P3117 ?value .
OPTIONAL {
?statement prov:wasDerivedFrom/pr:P248 ?source .
OPTIONAL { ?source wdt:P356 ?doi . }
}
?property wikibase:claim ?propp ;
wikibase:statementValue ?proppsv ;
wdt:P1629 ?propEntity .
VALUES ?propEntity { wd:Q54774134 }
}
} AS %result
WHERE {
INCLUDE %result
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ASC(?propEntityLabel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment