Old database is quite outdated and corrupt, we have moved away fro it into Wikidata (monument lists being generated in Listeria)
Basically, whatever has wdt:P2186 is fine to come in the dataset.
The ID we are using in WLM is the Qid, but we also have a unique WLM ID available, just in case (and it is also useful to help generating our monument lists)
This is an example of the query we are using to generate the lists in Listeria, for a given region/district (for thw whole country use P17=Q45):
SELECT DISTINCT ?item ?itemLabel ?idwlm ?localLabel ?municipioLabel ?fonte ?cat ?cats ?button (GROUP_CONCAT(DISTINCT ?tipoLabel ;separator=", ") AS ?tipos) (GROUP_CONCAT(DISTINCT ?classLabel ;separator=", ") AS ?classes) WITH { SELECT DISTINCT ?item ?local ?municipio WHERE { { ?item wdt:P131 ?local. ?local wdt:P131 ?municipio. ?municipio wdt:P131 wd:Q25263. } # itens ao nível de freguesia UNION { ?item wdt:P131 ?local. ?local wdt:P131 wd:Q26253. } # itens ao nível de concelho UNION { ?item wdt:P131 wd:Q26253. } # itens ao nível da região } } as %results WHERE { INCLUDE %results { ?item wdt:P2186 ?idwlm. } # IDWLM OPTIONAL { ?item wdt:P31 ?tipo. } # Tipo OPTIONAL { ?item wdt:P1435 ?class. } # Classificação OPTIONAL { ?item wdt:P1702 ?id1. } # ID DGPC OPTIONAL { ?item wdt:P1700 ?id2. } # ID SIPA {BIND (CONCAT("[www.patrimoniocultural.gov.pt/pt/patrimonio/patrimonio-imovel/pesquisa-do-patrimonio/classificado-ou-em-vias-de-classificacao/geral/view/",?id1," ","IGESPAR]") as ?url1)} {BIND (CONCAT("[http://www.monumentos.gov.pt/Site/APP_PagesUser/SIPA.aspx?id=",?id2," ","SIPA]") as ?url2)} {BIND (CONCAT(COALESCE( ?url1,''), COALESCE( CONCAT(IF (BOUND (?url1),'<br>',''), ?url2),'')) AS ?fonte)} OPTIONAL {?item wdt:P373 ?cat.} {BIND (CONCAT('Images from Wiki Loves Monuments 2019 in Portugal - Madeira',IF(BOUND(?cat),CONCAT('{{!}}',?cat),'')) AS ?cats)} BIND(SUBSTR(STR(?item), 32 ) AS ?id) OPTIONAL { ?item schema:description ?descr. FILTER((LANG(?descr)) = 'pt') } BIND(CONCAT('<span class=', '\"', 'plainlinks', '\"', '>[https://commons.wikimedia.org/w/index.php?title=Special:UploadWizard&campaign=wlm-pt&id=', STR(?id), '&descriptionlang=pt&description={{urlencode:', CONCAT(COALESCE(?itemLabel, ''),' - ',COALESCE(?descr, '')), '}}', '&categories={{urlencode:', ?cats, '}}&captionlang=pt&caption={{urlencode:', CONCAT(COALESCE(?itemLabel, ''),' - ',COALESCE(?descr, '')), '}} {{Clickable button|color=blue|Enviar Foto}}]</span>') AS ?button) SERVICE wikibase:label { bd:serviceParam wikibase:language 'pt,pt-br,en'. ?class rdfs:label ?classLabel. ?tipo rdfs:label ?tipoLabel. ?item rdfs:label ?itemLabel. ?local rdfs:label ?localLabel. ?municipio rdfs:label ?municipioLabel. } } GROUP BY ?item ?itemLabel ?idwlm ?localLabel ?municipioLabel ?id1 ?fonte ?cat ?cats ?button ORDER BY ?municipioLabel ?localLabel ?itemLabel
If you want a specific query, please tell me
Preliminary mapping
{ "country": "pt", "lang": "pt", "description": "Cultural heritage sites in Portugal in Portuguese", "type": "sparql", "project": "", "table": "monuments_pt-wd_(pt)", "commonsTemplate": "MonumentIDPortugal", "commonsTrackerCategory": "Cultural heritage monuments in Portugal with known IDs", "commonsCategoryBase": "Cultural heritage monuments in Portugal", "unusedImagesPage": "", "imagesWithoutIdPage": "", "missingCommonscatPage": "", "sparql": "", "sql_lang": "Portuguese # Wikidata", "sql_country": "Portugal", "sql_data": { "dataset": { "value": "pt-wd", "type": "Text" }, "lang": { "value": "pt", "type": "Text" }, "adm0": { "value": "pt", "type": "Text" } } }