query-92ff0866e3964031b6384efe60ef4920
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item ?author ?authorQID ?dob ?dod ?field ?description where
{
{
{
SELECT ?item ?author ?description
WHERE
{
?article wdt:P1433 wd:Q35387261. # article was published in costume
?article wdt:P50 ?item . # here's an author
optional {?item rdfs:label ?author . filter(lang(?author)="en")}
optional {?item schema:description ?description . filter(lang(?description)="en")}
}
}}
UNION
{
{
select (sample(?it) as ?item) ?author ?description WHERE
{
?it wdt:P1433 wd:Q35387261. # article was published in costume
?it wdt:P2093 ?author . # here's an author (without a Wikidata object)
} group by ?author ?description
}}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?article")
v2("?author"):::projected
v1("?description"):::projected
v5("?it")
v6("?item"):::projected
c3(["wd:Q35387261"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v5 --"wdt:P1433"--> c3
v5 --"wdt:P2093"--> v2
bind1[/"sample(?it)"/]
v5 --o bind1
bind1 --as--o v6
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P1433"--> c3
v3 --"wdt:P50"--> v6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v6 -."rdfs:label".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v6 -."schema:description".-> v1
end
end
union0r <== or ==> union0l
end