query-80dd20a8eafb171f4494279f41307cab

rq turtle/ttl

Propertiesinstance of (P31)subclass of (P279)author (P50)full work available at URL (P953)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?poem ?poemLabel ?authorLabel ?link WHERE {
?poem wdt:P31/wdt:P279? wd:Q5185279;
OPTIONAL{?poem wdt:P50 ?author}
OPTIONAL{?poem wdt:P953 ?text}
OPTIONAL{?wikisource schema:about ?poem; schema:isPartOf <https://en.wikisource.org/>}
BIND((IF (BOUND(?text),?text,?wikisource) ) AS ?link)
FILTER BOUND(?link)
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en,de,fr,ru"}
} ORDER BY ?authorLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?author") v1("?authorLabel"):::projected v7("?link"):::projected v3("?poem"):::projected v5("?text") v6("?wikisource") a1((" ")) c10(["bd:serviceParam"]):::iri c12(["#91;AUTO_LANGUAGE#93;,mul,en,de,fr,ru"]):::literal c2(["wd:Q5185279"]):::iri c8([https://en.wikisource.org/]):::iri f0[["bound(?link)"]] f0 --> v7 v3 --"wdt:P31"--> a1 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; a1 --"wdt:P279"--> c2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P50".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P953".-> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v6 -."schema:about".-> v3 v6 --"schema:isPartOf"--> c8 end bind1[/"if(bound(?text),?text,?wikisource)"/] v5 --o bind1 v6 --o bind1 bind1 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end