Module:Zabytek/lib/testcases

WLM ID, to właściwość P2186 to "Identyfikator w Wiki Loves Monuments". W zasadzie jest to stara, nieaktualizowana baza danych, ale używana w szablonach czasem.

Module:Wikidata

Q33414127:P2186 z Module:Wikidata:

PL-623487

p.readWlmId

{{#invoke:Zabytek/lib|readWlmId|Q33414127}}
wartośćwyniknotatki
Q33414127623487zabytek z WLM ID
1234-nieprawidłowe Q-id
kopytko-nieprawidłowe Q-id
Q42bez WLM id (nie zabytek)
Q112803290zabytek bez WLM id (jakiś nowy)

p.whatId

{{#invoke:Zabytek/lib|whatId|Q33414127}}
wartośćwyniknotatki
Q33414127Qzabytek z WLM ID
Q112803290Qzabytek bez WLM ID
1234+WLM ID bez prefiksu
PL-1234PLWLM ID z prefiksem
PL 1234PLWLM ID z prefiksem
kopytkoNNnieprawidłowe

p.chopPrefix

{{#invoke:Zabytek/lib|chopPrefix|PL-1234}}
wartośćwynik
PL-12341234
PL 12341234

Zabytek nieruchomy Q

{{Zabytek nieruchomy|Q33414127}}
This is a photo of a monument in Poland identified by the ID: Q33414127.
wartośćwyniknotatki
Q33414127
This is a photo of a monument in Poland identified by the ID: Q33414127.
zabytek z WLM ID
Q112803290
This is a photo of a monument in Poland identified by the ID: Q112803290.
zabytek bez WLM ID
1234
This is a photo of a monument in Poland identified by the ID: PL-1234.
WLM ID bez prefiksu
PL-1234
This is a photo of a monument in Poland identified by the ID: PL-1234.
WLM ID z prefiksem
PL 1234
This is a photo of a monument in Poland identified by the ID: PL 1234.
WLM ID z prefiksem
kopytko
This is a photo of a monument in Poland identified by the ID: kopytko.
nieprawidłowe

Ostatnie zabytki w WD z WLM ID

https://query.wikidata.org/

SELECT ?item ?itemLabel ?value (SUBSTR(STR(?item), STRLEN("http://www.wikidata.org/entity/Q") + 1) AS ?numeric_id) WHERE {
  ?item wdt:P2186 ?value .
  ?item wdt:P17 wd:Q36 .  # Ensures the item is located in Poland
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(xsd:integer(SUBSTR(STR(?item), STRLEN("http://www.wikidata.org/entity/Q") + 1)))
LIMIT 10

Zobacz też