query-56cf57d2f8cdc6befb0d63de4bbb5de9

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 ?auth ?authLabel ?sample_poem ?sample_poemLabel ?langs WHERE {
  {
     SELECT DISTINCT ?auth (SAMPLE(?item) AS ?sample_poem) (GROUP_CONCAT(DISTINCT(?iso_lang); separator=', ') AS ?langs) WHERE {
        ?item wdt:P31/wdt:P279* wd:Q5185279 .
        ?item wdt:P170|wdt:P50 ?auth .
        OPTIONAL {?item wdt:P407 ?lang . ?lang wdt:P218 ?iso_lang}
     } GROUP BY ?auth
  }

   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr,de,es,it,nl,sv,ru,cn,ar". }
} ORDER BY str(?authLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?auth"):::projected v1("?authLabel"):::projected v5("?iso_lang") v2("?item") v4("?lang") v7("?langs"):::projected v6("?sample_poem"):::projected a1((" ")) c9(["bd:serviceParam"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en,fr,de,es,it,nl,sv,ru,cn,ar"]):::literal c3(["wd:Q5185279"]):::iri v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P50"--> v3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P170"--> v3 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P407".-> v4 v4 --"wdt:P218"--> v5 end bind2[/"sample(?item)"/] v2 --o bind2 bind2 --as--o v6 bind3[/"?iso_lang"/] v5 --o bind3 bind3 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end