Wikidata:WikiProject Armenia/Maintenance Queries
Jump to navigation
Jump to search
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
|
Armenian Cultural Heritage ID
[edit]# All items that have p3170 set and some other optional information. Also works as a map
SELECT ?item ?itemLabel ?heritageId ?adminLabel ?coord ?image
WHERE
{
?item wdt:P3170 ?heritageId .
OPTIONAL { ?item wdt:P131 ?admin }
OPTIONAL { ?item wdt:P131 ?admin }
OPTIONAL { ?item wdt:P625 ?coord }
OPTIONAL { ?item wdt:P625 ?image }
SERVICE wikibase:label { bd:serviceParam wikibase:language "hy" }
}
Others
[edit]# Find all items described in Encyclopedia of Armenian Nature and missing an English label
SELECT ?item ?itemLabel WHERE {
?item wdt:P1343 wd:Q16387823 .
filter not exists { ?item rdfs:label ?enlabel filter (lang(?enlabel) = "en") } .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "hy" .
}
}
# Items that have country = Armenia, have an Armenian label and are missing an English label
SELECT ?item ?itemLabel ?armenianLabel WHERE {
?item wdt:P17 wd:Q399 .
?item rdfs:label ?armenianLabel filter (lang(?armenianLabel) = "hy") .
filter not exists { ?item rdfs:label ?missinglabel filter (lang(?missinglabel) = "en") } .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
# People born in Armenia that lack a statement about which languages they speak
SELECT ?item ?itemLabel WHERE {
?item wdt:P19 ?place .
?place wdt:P17 wd:Q399 .
FILTER NOT EXISTS { ?item wdt:P1412 ?language }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
# Armenien citiziens that have an article in EN or RU wiki but not in HY
SELECT ?item ?itemLabel (COUNT(distinct ?article) as ?count)
{
{
SELECT ?item
{
{
hint:Query hint:optimizer "None" .
?item wdt:P31 wd:Q5 .
?item wdt:P27 wd:Q399 .
MINUS {?sitelinkhy schema:about ?item . ?sitelinkhy schema:isPartOf <https://hy.wikipedia.org/>}
}
?article schema:about ?item .
{
?article schema:isPartOf <https://ru.wikipedia.org/>
}
UNION
{
?article schema:isPartOf <https://en.wikipedia.org/>
}
}
}
?article schema:about ?item .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,ru" }
}
GROUP BY ?item ?itemLabel
ORDER BY DESC(?count)
# List of Armenian hospitals. Currently most likely incomplete
SELECT ?item ?itemLabel
WHERE {
?item wdt:P31/wdt:P279* wd:Q16917 .
?item wdt:P17 wd:Q399 .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en".
}
}
#Films only on Armenian Wikipedia
SELECT (SAMPLE(?year) AS ?year)
?statements
(GROUP_CONCAT(DISTINCT ?origlang) as ?origlangs)
?item ?locallabel ?itemLabel ?itemDescription
(SAMPLE(?originaltitle) AS ?originaltitle)
(xsd:integer(STRAFTER(str(?item), "Q")) AS ?qid)
{
?item wdt:P31/wdt:P279* wd:Q11424 .
?item wikibase:sitelinks 1 .
[] schema:about ?item; schema:isPartOf <https://hy.wikipedia.org/>; schema:inLanguage ?lll .
?item rdfs:label ?locallabel . FILTER(lang(?locallabel) = ?lll ) .
?item wikibase:statements ?statements .
OPTIONAL { ?item wdt:P364/wdt:P424 ?origlang }
OPTIONAL { ?item wdt:P1476 ?originaltitle }
OPTIONAL { ?item wdt:P577 ?date . BIND(YEAR(?date) as ?year) }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
GROUP BY ?item ?statements ?locallabel ?itemLabel ?itemDescription
ORDER BY DESC(?year) LIMIT 1000
#Items without Armenian label but linked from items with hywiki sitelink
SELECT DISTINCT (?leben AS ?label_in_english) ?item WHERE {
?itemk ?p ?item {
?article schema:about ?itemk ;
schema:isPartOf <https://hy.wikipedia.org/> . }
?item rdfs:label ?leben filter (lang(?leben) = "en").
MINUS {?item rdfs:label ?lebhy filter(lang(?lebhy) = "hy")}
}
limit 500
#Most common Armenian labels (of items with Armenian Wikipedia sitelink and ")" in its title) without Armenian description. Can be used with Special:ItemDisambiguation
select ?label (count(?label) as ?count) {
?article schema:about ?item ;
schema:isPartOf <https://hy.wikipedia.org/> .
filter ( contains((STR(?article)), "%29") )
?item rdfs:label ?label filter (lang(?label) = "hy").
minus { ?item schema:description ?any filter (lang(?any) = "hy")}
}
group by ?label ?count
having (?count > 1)
order by desc(?count)
limit 100
#All items starting with lowercase English label but uppercase Armenian label.
select ?item ?enlabel ?hylabel where {
?item rdfs:label ?enlabel filter (lang(?enlabel) = "en").
?item rdfs:label ?hylabel filter (lang(?hylabel) = "hy").
filter regex(?enlabel, "^[a-z]").
filter regex(?hylabel, "^[Ա-Ֆ]").
} limit 100
#Select all stadiums which have capacity of more than 45000 seats but don't have an article in Armenian Wikipedia.
select ?stadium ?capacity where {
?stadium wdt:P1083 ?capacity.
filter(?capacity > 45000)
?stadium wdt:P31 wd:Q483110
minus {?article schema:about ?stadium ;
schema:isPartOf <https://hy.wikipedia.org/> .}
}