depicts/templates/query/find_more.sparql

37 lines
1 KiB
SPARQL
Raw Permalink Normal View History

2019-11-25 15:46:05 +00:00
select ?item
?itemLabel
?image
?artist
?artistLabel
?title
?titleLang
?time
?timeprecision
(group_concat(distinct ?depictsLabel; SEPARATOR="|") as ?depictsList)
where {
service wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
values ?isa { {% for isa in isa_list %} wd:{{ isa }} {% endfor %} }
?item wdt:P31 ?isa .
2019-10-09 14:38:10 +01:00
{% for pid, qid in params %}
?item wdt:{{pid}} wd:{{qid}} .
{% endfor %}
?item wdt:P18 ?image .
OPTIONAL {
?item p:P571/psv:P571 ?timenode .
?timenode wikibase:timeValue ?time.
?timenode wikibase:timePrecision ?timeprecision.
}
OPTIONAL {
?item wdt:P1476 ?title .
BIND(LANG(?title) as ?titleLang)
}
OPTIONAL { ?item wdt:P170 ?artist }
2019-11-25 15:46:05 +00:00
OPTIONAL {
?item wdt:P180 ?depicts .
?depicts rdfs:label ?depictsLabel .
FILTER(LANG(?depictsLabel) = "en").
}
} group by ?item ?itemLabel ?image ?artist ?artistLabel
?title ?titleLang ?time ?timeprecision