query-ae14bd3fa7ce3f742e8421715b7046ba
Works by Hiroshige known to Wikidata UNION those known to Japan Search
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#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX jps: <https://jpsearch.go.jp/term/property#>
SELECT ?name ?work ?date ?url ?image WHERE {
{
SERVICE <https://jpsearch.go.jp/rdf/sparql/> {
?jps_creator owl:sameAs wd:Q200798 .
?work schema:creator ?jps_creator .
OPTIONAL {?work schema:dateCreated ?date}
OPTIONAL {?work schema:image ?image}
OPTIONAL {?work schema:name ?name}
FILTER (lang(?name)="ja"). # Show only the Japanese name
}
BIND(URI( REPLACE(STR(?work), "/data/", "/item/") ) AS ?url)
}
UNION {
?work wdt:P170 wd:Q200798.
OPTIONAL {?work wdt:P973 ?url}
OPTIONAL {?work wdt:P18 ?image}
OPTIONAL {?work wdt:P571 ?date}
?work rdfs:label ?name FILTER (lang(?name)="ja")
}
}
Query found at
- https://www.wikidata.org/wiki/User:Battleofalma/Federated_queries
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Federated_queries
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?date"):::projected
v5("?image"):::projected
v2("?jps_creator")
v1("?name"):::projected
v6("?url"):::projected
v3("?work"):::projected
c4(["wd:Q200798"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
f0[["?name = 'ja'"]]
f0 --> v1
v3 --"wdt:P170"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P973".-> v6
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P18".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P571".-> v4
end
v3 --"rdfs:label"--> v1
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
subgraph s1["https://jpsearch.go.jp/rdf/sparql/"]
style s1 stroke-width:4px;
f1[["?name = 'ja'"]]
f1 --> v1
v2 --"owl:sameAs"--> c4
v3 --"schema:creator"--> v2
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v3 -."schema:dateCreated".-> v4
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v3 -."schema:image".-> v5
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v3 -."schema:name".-> v1
end
end
bind2[/"replace(str(?work),'/data/','/item/')"/]
v3 --o bind2
bind2 --as--o v6
end
union0r <== or ==> union0l
end