Move two queries into templates.
This commit is contained in:
parent
d928c46c1d
commit
a5dfbd040a
3 changed files with 38 additions and 42 deletions
11
templates/query/facet.sparql
Normal file
11
templates/query/facet.sparql
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
select ?property ?object ?objectLabel (count(*) as ?count) {
|
||||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
|
||||
?item wdt:P31 wd:Q3305213 .
|
||||
?item wdt:P18 ?image .
|
||||
{% for pid, qid in params %}
|
||||
?item wdt:{{pid}} wd:{{qid}} .
|
||||
{% endfor %}
|
||||
values ?property { {% for pid in properties %} wdt:{{pid}}{% endfor %} }
|
||||
?item ?property ?object .
|
||||
FILTER NOT EXISTS { ?item wdt:P180 ?depicts }
|
||||
} group by ?property ?propertyLabel ?object ?objectLabel
|
||||
19
templates/query/find_more.sparql
Normal file
19
templates/query/find_more.sparql
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
select ?item ?itemLabel ?image ?artist ?artistLabel ?title ?titleLang ?time ?timeprecision {
|
||||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
|
||||
?item wdt:P31 wd:Q3305213 .
|
||||
{% 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 }
|
||||
FILTER NOT EXISTS { ?item wdt:P180 ?depicts }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue