wikicite / kukulu

Draft of a data language for Wikibase
http://wikicite.org/kukulu/
Other
2 stars 0 forks source link

Get deprecated statements with references #3

Open nichtich opened 5 years ago

nichtich commented 5 years ago

Raised here:

SELECT ?item ?itemLabel ?reference ?refProp ?refPropLabel ?refValue ?refValueLabel
{
  ?item p:P170 [
    ps:P170 wd:Q825;
    wikibase:rank wikibase:DeprecatedRank ;
    prov:wasDerivedFrom ?reference
  ] .
  ?reference ?refP ?refValue .
  BIND (IRI(REPLACE(STR(?refP),"prop/reference", "entity")) AS ?refProp)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Something like this?

?item ~P463 Q825:
  reference: ?reference
?reference ?refProp ?refValue

# getting labels to be discussed. One way to optionally get English labels:
?itemLabel := ?item.labels.en
?refPropLabel := ?refProp.labels.en
?refValueLabel := ?refValue.labels.en