Skip to content

Instantly share code, notes, and snippets.

@samuell
Last active May 2, 2017 12:00
Show Gist options
  • Save samuell/45559ad961d367b5d6a26269260dc29a to your computer and use it in GitHub Desktop.
Save samuell/45559ad961d367b5d6a26269260dc29a to your computer and use it in GitHub Desktop.
SPARQL query to obtain the data for Demonstrator II in the RDFIO paper. The link directly to the data is available in a comment below.
CONSTRUCT {
?wikidata <http://pharmb.io/onto/haspKa> ?pKa ;
<http://pharmb.io/onto/hasDOI> ?doi ;
rdfs:label ?compound . ?wikidata rdf:type <http://pharmb.io/onto/Compound> .
<http://pharmb.io/onto/Compound> rdfs:label "Compound" .
} WHERE {
?wikidata p:P1117 ?foo ;
rdfs:label ?compound ;
p:P31 ?type .
?foo a wikibase:BestRank ;
ps:P1117 ?pKa .
OPTIONAL {
?foo prov:wasDerivedFrom/<http://www.wikidata.org/prop/reference/P248> ?source .
?source rdfs:label ?title .
OPTIONAL { ?source wdt:P356 ?doi . }
FILTER(lang(?title) = "en")
}
FILTER(lang(?compound) = "en")
}
@samuell
Copy link
Author

samuell commented May 2, 2017

The query can be accessed in the Wikidata SPARQL inferface at this link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment