query-4d786fd8a2fa8a9c15cae26b144f925d

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item1 ?item1Label ?item2 ?item2Label ?GND (URI(REPLACE(?formatter, '\\$1', ?GND)) AS ?url) 

WHERE
{

{
  SELECT * {
    ?item1 wdt:P227/^wdt:P227 ?item2 .
    FILTER( STR( ?item1 ) < STR( ?item2 ) ) .
  }
}.

{
  SELECT * { wd:P227 wdt:P1630 ?formatter } LIMIT 1
}.
  ?item1 wdt:P227 ?GND .
  ?item2 wdt:P227 ?GND .
  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; v4("?GND"):::projected v3("?formatter"):::projected v1("?item1"):::projected v2("?item2"):::projected v5("?url") a1((" ")) c5(["bd:serviceParam"]):::iri c2(["wd:P227"]):::iri c7(["en"]):::literal f0[["str(?item1) < str(?item2)"]] f0 --> v1 f0 --> v2 v1 --"wdt:P227"--> a1 v2 --"wdt:P227"--> a1 c2 --"wdt:P1630"--> v3 v1 --"wdt:P227"--> v4 v2 --"wdt:P227"--> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end bind1[/"replace(?formatter,'\$1',?GND)"/] v3 --o bind1 v4 --o bind1 bind1 --as--o v5