query-6184ed33fb6737b61d50239aedde7ced
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?errata ?errataLabel ?itemLabel ?item
WHERE
{
?errata wdt:P31 wd:Q1348305 . # ?errata is an errata
filter not exists {?itemZ wdt:P2507 ?errata . } # there's no ?item pointing to the errata.
?errata rdfs:label ?errataLabel . filter(lang(?errataLabel)="en")
filter(strstarts(?errataLabel,"Corrigendum:"))
bind(replace(?errataLabel,"Corrigendum: ","") as ?itemLabel) .
?item rdfs:label ?itemLabel.
filter(strlen(?itemLabel)>20)
filter(?item != ?errata)
}
Query found at
- https://www.wikidata.org/wiki/User:Trilotat/SPARQL
- https://www.wikidata.org/wiki/User_talk:Trilotat/Archive/2019/1
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?errata"):::projected
v4("?errataLabel"):::projected
v1("?item"):::projected
v6("?itemLabel"):::projected
v5("?itemZ")
c6(["wd:Q1348305"]):::iri
f0[["?item != ?errata"]]
f0 --> v1
f0 --> v2
f1[["string-length(?itemLabel) > '20^^xsd:integer'"]]
f1 --> v6
f2[["starts-with(?errataLabel,'Corrigendum:')"]]
f2 --> v4
f3[["?errataLabel = 'en'"]]
f3 --> v4
f4[["not "]]
subgraph f4e0["Exists Clause"]
e0v1 --"wdt:P2507"--> e0v2
e0v2("?errata"):::projected
e0v1("?itemZ"):::projected
end
f4--EXISTS--> f4e0
f4 --> v5
f4 --> c4
f4 --> v2
v5 --"wdt:P2507"--> v2
v2 --"wdt:P31"--> c6
v2 --"rdfs:label"--> v4
bind5[/"replace(?errataLabel,'Corrigendum: ','')"/]
v4 --o bind5
bind5 --as--o v6
v1 --"rdfs:label"--> v6