-
Notifications
You must be signed in to change notification settings - Fork 16
/
example-iframe-from-wikidata.html
44 lines (37 loc) · 1.55 KB
/
example-iframe-from-wikidata.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<head>
<!-- As obrigatórias meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Título da página -->
<title>Bibliotecas</title>
</head>
<body>
<div class="container-fluid px-lg-5 pt-5 pb-5">
<div class="row mx-lg-n5">
<div class="col-sm px-lg-5">
<h3>Lista e mapa das Bibliotecas em Portugal</h3>
<p>
<iframe id="wikidataframe" style="width: 100%; height: 62vh; border: none;" referrerpolicy="origin"
sandbox="allow-scripts allow-same-origin allow-popups"></iframe>
<script>
var wikidataQuery = `
# Map of libraries in Portugal
#defaultView:Map
SELECT ?item ?itemLabel ?geo WHERE {
?item wdt:P31/wdt:P279* wd:Q7075. # Item is an instance or subclass of Library (Q7075)
?item wdt:P625 ?geo. # Store item's geographic coordinates in the ?geo variable
?item wdt:P17 wd:Q45. # Item's country is Portugal
MINUS { ?item wdt:P3999 ?closure_date. } # Exclude items that have been closed
SERVICE wikibase:label { bd:serviceParam wikibase:language "pt,en". }
}
`
var urlPrefix = "https://query.wikidata.org/embed.html#"
var frame = document.getElementById("wikidataframe")
frame.src = urlPrefix + encodeURI(wikidataQuery)
</script>
</p>
</div>
</div>
</div>
</body>