query-0fcf3e7cee067e73895caf48db2080a9
Paintings in need of disambiguation exist. I already started with a query, but it times out if I add the last filter painting by Sandro Botticelli in the Metropolitan Museum of Art: (Q3202069)The Annunciation and painting by Sandro Botticelli in the Kelvingrove Art Gallery and Museum: (Q1114806)The Annunciation should be disambiguated because painting by Sandro Botticelli: (Q3202079)The Annunciation I'm looking for paintings that are in need of disambiguation. For example
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item ?item2 ?label ?description ?description2 ?description2start WHERE {
?item wdt:P31 wd:Q3305213;
wdt:P170 ?creator;
rdfs:label ?label;
schema:description ?description.
FILTER(LANG(?label)="en" && LANG(?description)="en" && REGEX(STR(?description), "^painting by [^\\(]+$")) .
?item2 wdt:P170 ?creator;
rdfs:label ?label;
wdt:P31 wd:Q3305213;
schema:description ?description2.
FILTER(?item!=?item2 && LANG(?description2)="en" && ?description!=?description2 && STRLEN(?description) < STRLEN(?description2)) # && SUBSTR(STR(?description2), STRLEN(?description))=STR(?description) )
BIND(SUBSTR(STR(?description2), 0, STRLEN(?description)+1) AS ?description2start)
#FILTER(STR(?description)=?description2start)
} LIMIT 10
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?creator")
v4("?description"):::projected
v3("?description2"):::projected
v7("?description2start"):::projected
v1("?item"):::projected
v2("?item2"):::projected
v5("?label"):::projected
c4(["wd:Q3305213"]):::iri
f0[["?item != ?item2?description2 = 'en'?description != ?description2string-length(?description) < string-length(?description2)"]]
f0 --> v1
f0 --> v2
f0 --> v3
f0 --> v4
f1[["?label = 'en'?description = 'en'regex(str(?description),'^painting by #91;^\(#93;+$')"]]
f1 --> v5
f1 --> v4
v1 --"wdt:P31"--> c4
v1 --"wdt:P170"--> v6
v1 --"rdfs:label"--> v5
v1 --"schema:description"--> v4
v2 --"wdt:P170"--> v6
v2 --"rdfs:label"--> v5
v2 --"wdt:P31"--> c4
v2 --"schema:description"--> v3
bind2[/"substring(str(?description2),'0^^xsd:integer',string-length(?description) + '+1^^xsd:integer')"/]
v3 --o bind2
v4 --o bind2
bind2 --as--o v7