query-0525d17d0289a3fa16f7bc18920a5455
10:41, 27 May 2017 (UTC)) talk (Andrew GrayIs there a way I can make this more efficient? If it helps to narrow down the space a bit, all the offending descriptions are likely to have a set of brackets () in them.
Use at
- https://query.wikidata.org/sparql
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 ?description1 ?item1 ?item1Label ?item2 ?item2Label
{
{ SELECT DISTINCT ?item1 ?description1 ?item2
{
?item1 wdt:P1415 ?whatever1 .
?item2 wdt:P1415 ?whatever2 .
?item1 schema:description ?description1 .
?item2 schema:description ?description1 .
FILTER(LANG(?description1) = "en" && ?item1 != ?item2 && str(?item1) < str(?item2) ) .
}
LIMIT 1000
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?description1"):::projected
v2("?item1"):::projected
v3("?item2"):::projected
v4("?whatever1")
v5("?whatever2")
c5(["bd:serviceParam"]):::iri
c1(["en"]):::literal
f0[["?description1 = 'en'?item1 != ?item2str(?item1) < str(?item2)"]]
f0 --> v1
f0 --> v2
f0 --> v3
v2 --"wdt:P1415"--> v4
v3 --"wdt:P1415"--> v5
v2 --"schema:description"--> v1
v3 --"schema:description"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c1
end