Skip to content

Instantly share code, notes, and snippets.

@kasei
Created August 8, 2019 22:57
Show Gist options
  • Save kasei/0bd44b9131a23fafbdf4a3722cd997c1 to your computer and use it in GitHub Desktop.
Save kasei/0bd44b9131a23fafbdf4a3722cd997c1 to your computer and use it in GitHub Desktop.
SPARQL* syntax used for Wikidata reification
$ docker pull kasei/swift-sparql-syntax:sparql-star-wikidata
$ docker run -t kasei/swift-sparql-syntax:sparql-star-wikidata sparql-parser wikidata -S 'SELECT ?speed ?qualifierLabel WHERE { << wd:Q183 wdt:P3086 ?speed >> pq:P3005 ?qualifier ; SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }'
SELECT ?speed ?qualifierLabel WHERE {
_:_blank.b1 <https://dgllnex8yh.proxynodejs.usequeue.com/prop/statement/P3086> ?speed .
<https://dgllnex8yh.proxynodejs.usequeue.com/entity/Q183> <https://dgllnex8yh.proxynodejs.usequeue.com/prop/P3086> _:_blank.b1 .
<https://dgllnex8yh.proxynodejs.usequeue.com/entity/Q183> <https://dgllnex8yh.proxynodejs.usequeue.com/prop/direct/P3086> ?speed .
_:_blank.b1 <https://dgllnex8yh.proxynodejs.usequeue.com/prop/qualifier/P3005> ?qualifier .
SERVICE <https://h067zyqfvo.proxynodejs.usequeue.com/ontology#label>
{
<https://k23hj41ivx.proxynodejs.usequeue.com/rdf#serviceParam> <https://h067zyqfvo.proxynodejs.usequeue.com/ontology#language> "en" .
}
}
@kasei
Copy link
Author

kasei commented Aug 8, 2019

Proof of concept code available in docker that can translate SPARQL* syntax into Wikidata reification.

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