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 <http://www.wikidata.org/prop/statement/P3086> ?speed .
<http://www.wikidata.org/entity/Q183> <http://www.wikidata.org/prop/P3086> _:_blank.b1 .
<http://www.wikidata.org/entity/Q183> <http://www.wikidata.org/prop/direct/P3086> ?speed .
_:_blank.b1 <http://www.wikidata.org/prop/qualifier/P3005> ?qualifier .
SERVICE <http://wikiba.se/ontology#label>
{
<http://www.bigdata.com/rdf#serviceParam> <http://wikiba.se/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