query-e97f1efdabab3a31912125201eeeaba2
TODO
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))
BIND(SUBSTR(STR(?description2), 1, STRLEN(?description)) AS ?description2start)
FILTER(STR(?description)=?description2start)
#filter( SUBSTR(STR(?description2), 1, STRLEN(?description))=STR(?description) )
} LIMIT 10
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?creator")
v1("?description"):::projected
v5("?description2"):::projected
v8("?description2start"):::projected
v3("?item"):::projected
v4("?item2"):::projected
v6("?label"):::projected
c4(["wd:Q3305213"]):::iri
f0[["str(?description) = ?description2start"]]
f0 --> v1
f0 --> v8
f1[["?item != ?item2?description2 = 'en'?description != ?description2string-length(?description) < string-length(?description2)"]]
f1 --> v3
f1 --> v4
f1 --> v5
f1 --> v1
f2[["?label = 'en'?description = 'en'regex(str(?description),'^painting by #91;^\(#93;+$')"]]
f2 --> v6
f2 --> v1
v3 --"wdt:P31"--> c4
v3 --"wdt:P170"--> v7
v3 --"rdfs:label"--> v6
v3 --"schema:description"--> v1
v4 --"wdt:P170"--> v7
v4 --"rdfs:label"--> v6
v4 --"wdt:P31"--> c4
v4 --"schema:description"--> v5
bind3[/"substring(str(?description2),'1^^xsd:integer',string-length(?description))"/]
v5 --o bind3
v1 --o bind3
bind3 --as--o v8