query-1e0bdaa6b666cb37bac2d988b6de059a

rq turtle/ttl

Items with a certain property and identical (en) descriptions and identifies all the ones which have exactly the same description text in English. This will help me find and fix a few hundred which were imported with incorrect descriptions (items are often paired, and the desciption for one got used for both). However, the query I tried timed out: (P1415)Oxford Dictionary of National Biography ID I'm trying to write a query which finds all items with

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item1 ?item1Label ?description1 ?item2 ?item2Label ?description2
{
    ?item1 wdt:P1415 ?odnb1 .
    ?item2 wdt:P1415 ?odnb2 .
    ?item1 schema:description ?description1 .
    ?item2 schema:description ?description2 .
    FILTER(LANG(?description1) = "en").
    FILTER(LANG(?description2) = "en").
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
    FILTER(?item1 != ?item2  && str(?description1) = str(?description2)) .
} LIMIT 50

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?description1"):::projected v4("?description2"):::projected v1("?item1"):::projected v2("?item2"):::projected v5("?odnb1") v6("?odnb2") c5(["bd:serviceParam"]):::iri c1(["en"]):::literal f0[["?item1 != ?item2str(?description1) = str(?description2)"]] f0 --> v1 f0 --> v2 f0 --> v3 f0 --> v4 f1[["?description2 = 'en'"]] f1 --> v4 f2[["?description1 = 'en'"]] f2 --> v3 v1 --"wdt:P1415"--> v5 v2 --"wdt:P1415"--> v6 v1 --"schema:description"--> v3 v2 --"schema:description"--> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c1 end