query-b2b4f70697c88872805d526b6acaf66c
):https://query-main.wikidata.org/Here below should be your query rewritten (to run on
Use at
- https://query.wikidata.org/sparql
PREFIX wdsubgraph: <https://query.wikidata.org/subgraph/>
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 ?item ?itemLabel ?itemType ?itemTypeLabel WHERE {
VALUES (?author) {(wd:Q17508688)}
{
# get the publications from the scholarly subgraph
SERVICE wdsubgraph:scholarly_articles {
?item wdt:P50 ?author ;
wdt:P31 ?itemType
# Instruct the label service to gather the label of the publication
# The label for ?itemType will be fetched in the host query, the type is probably part of the main graph
BIND(?itemLabel AS ?itemLabel)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
} UNION {
# Union them with the publications in the main graph (blogs, articles...)
?item wdt:P50 ?author ;
wdt:P31 ?itemType
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?author")
v2("?item"):::projected
v4("?itemLabel"):::projected
v3("?itemType"):::projected
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/VALUES ?author/]
bind0-->v1
bind00(["wd:Q17508688"])
bind00 --> bind0
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P50"--> v1
v2 --"wdt:P31"--> v3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
subgraph s1["https://query.wikidata.org/subgraph/scholarly_articles"]
style s1 stroke-width:4px;
v2 --"wdt:P50"--> v1
v2 --"wdt:P31"--> v3
bind1[/"?itemLabel"/]
v4 --o bind1
bind1 --as--o v4
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
end
end
union0r <== or ==> union0l
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c5 --"wikibase:language"--> c7
end