Thanks to both of you, Yusuke and Egon. You solved my immediate problem, taught me new things on the way, and inspired me to play around a bit more. That was a nice experience. d.
On Sun, Jan 10, 2016 at 1:09 PM, Egon Willighagen egon.willighagen@gmail.com wrote:
Daniel,
On Sun, Jan 10, 2016 at 3:53 AM, Daniel Mietchen daniel.mietchen@googlemail.com wrote:
What I want now is a list of (ideally) statements (or - less ideally - items with such statements) that have references of one of the types given in (1) and (2).
It would look something like:
PREFIX wd: http://www.wikidata.org/entity/ PREFIX wdt: http://www.wikidata.org/prop/direct/ PREFIX prov: http://www.w3.org/ns/prov# PREFIX pr: http://www.wikidata.org/prop/reference/
SELECT ?statement ?PMID ?PMCID WHERE { ?statement prov:wasDerivedFrom/pr:P248 ?paper . ?paper wdt:P31 wd:Q13442814 . OPTIONAL { ?paper wdt:P698 ?PMID . } OPTIONAL { ?paper wdt:P932 ?PMCID . } }
https://query.wikidata.org/#PREFIX%20wd%3A%20%3Chttp%3A%2F%2Fwww.wikidata.or...
Then you can filter for your two options with:
FILTER (BOUND(?PMID)) FILTER (!BOUND(?PMID))
Grtz,
Egon
-- E.L. Willighagen Department of Bioinformatics - BiGCaT Maastricht University (http://www.bigcat.unimaas.nl/) Homepage: http://egonw.github.com/ LinkedIn: http://se.linkedin.com/in/egonw Blog: http://chem-bla-ics.blogspot.com/ PubList: http://www.citeulike.org/user/egonw/tag/papers ORCID: 0000-0001-7542-0286 ImpactStory: https://impactstory.org/EgonWillighagen
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata