Skip to content

Instantly share code, notes, and snippets.

@baskaufs
Created August 8, 2020 22:24
Show Gist options
  • Save baskaufs/a2a2ba83fb17fa28dc7ea7afc7a4603e to your computer and use it in GitHub Desktop.
Save baskaufs/a2a2ba83fb17fa28dc7ea7afc7a4603e to your computer and use it in GitHub Desktop.
Construct statements using direct properties from indirect p: and ps: properties
construct {?item ?directProp ?value.}
from <http://nursing1>
where {
?item ?p ?statement.
?statement ?ps ?value.
filter(substr(str(?ps),1,39)="http://www.wikidata.org/prop/statement/")
bind(substr(str(?ps),40) as ?id)
bind(substr(str(?p),30) as ?id)
bind(iri(concat("http://www.wikidata.org/prop/direct/", ?id)) as ?directProp)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment