Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prototype religious buildings amsterdam #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions religious-buildings-amsterdam/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules


# API Key
secret.js
bundle.js
10,003 changes: 10,003 additions & 0 deletions religious-buildings-amsterdam/data.json

Large diffs are not rendered by default.

129 changes: 129 additions & 0 deletions religious-buildings-amsterdam/example/hva-queries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# HvA intro - de queries

```
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT DISTINCT ?type (COUNT(?cho) AS ?count) WHERE {
?cho dc:type ?type
}
GROUP BY ?type
ORDER BY DESC(?count)
```

```
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT DISTINCT ?type (COUNT(?cho) AS ?count) WHERE {
?cho dc:type ?type .
FILTER EXISTS {?cho dc:type "foto"^^xsd:string .}
}
GROUP BY ?type
ORDER BY DESC(?count)
```

```
#alle bierpullen

PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?cho ?title ?img WHERE {
?cho dc:type "bierpul"^^xsd:string .
?cho dc:title ?title .
?cho foaf:depiction ?img .
}
```

```
# alle baarden

PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?cho ?title ?img WHERE {
?cho dc:type ?type .
?cho dc:title ?title .
?cho foaf:depiction ?img .
FILTER REGEX(?title, ' baard ')
}
```

```
# alle afbeeldingen van de Sint Antoniesbreestraat

PREFIX dct: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>

SELECT * WHERE {
?bbitem dct:spatial <https://adamlink.nl/geo/street/sint-antoniesbreestraat/4096> .
?bbitem foaf:depiction ?imgurl .
?bbitem dc:type ?type .
}
```

```
# portretten van mensen die bij Ajax gespeeld hebben

PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>

SELECT DISTINCT ?wdid ?person ?item
WHERE {
SERVICE <https://query.wikidata.org/sparql>{
?wdid wdt:P54 wd:Q81888 .
}
?person owl:sameAs ?wdid .
?item dc:subject ?person .
}
```

```
# 150 meest afgebeelde gebouwen

PREFIX hg: <http://rdf.histograph.io/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>

SELECT ?building ?buildingLabel ?wkt (COUNT(DISTINCT ?cho) AS ?count) WHERE {
?building a hg:Building .
?building rdfs:label ?buildingLabel .
?cho dct:spatial ?building .
?building geo:hasGeometry/geo:asWKT ?wkt .
}
GROUP BY ?building ?buildingLabel ?wkt
ORDER BY DESC (?count)
LIMIT 150
```

```
# naar mannen en vrouwen vernoemde straten, op de kaart
# deze query op wikidata draaien!

#defaultView:Map
SELECT ?street ?streetLabel ?layer ?coords
WHERE
{
?street wdt:P31 wd:Q79007.
?street wdt:P131 wd:Q9899 .
?street wdt:P138 ?namedafter .
?street wdt:P625 ?coords .
?namedafter wdt:P21 ?gender .
BIND(IF(?gender = wd:Q6581072, "vrouwelijk","mannelijk") AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
```

```
# alle onderwerpen van posters

PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT DISTINCT ?postersub (COUNT(?cho) AS ?count) WHERE {
?cho dc:type "Poster."^^xsd:string .
?cho dc:subject ?postersub .
?cho dc:title ?title .
?cho foaf:depiction ?img .
}
GROUP BY ?postersub
ORDER BY DESC(?count)
```
97 changes: 97 additions & 0 deletions religious-buildings-amsterdam/example/sparql.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<!DOCTYPE html>
<html>

<head>

<title>Adamlink SPARQLen met javascript</title>

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Nunito:700" rel="stylesheet">

<style type="text/css">
body {
padding: 40px;
text-align: center;
}

h1 {
font-family: "Nunito";
}

img {
height: 200px;
margin-right: 20px;
margin-bottom: 20px;
border: 5px solid #000;
}
</style>



</head>

<body>

<h1>Fetch and show results from Adamlink SPARQL endpoint with js</h1>
<div id="images"></div>




<script>
var sparqlquery = `
PREFIX hg: <http://rdf.histograph.io/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX void: <http://rdfs.org/ns/void#>
PREFIX sem: <http://semanticweb.cs.vu.nl/2009/11/sem/>
SELECT ?cho ?building ?img ?date ?col WHERE {

?cho dct:spatial ?b .
?b a hg:Building .
?b rdfs:label ?building .
?cho foaf:depiction ?img .
?cho sem:hasBeginTimeStamp ?date .
?cho void:inDataset ?col .
}
ORDER BY ?date
LIMIT 50
`;
// more fun dc:types: 'affiche', 'japonstof', 'tegel', 'herenkostuum'
// more fun dc:subjects with Poster.: 'Privacy.', 'Pop music.', 'Music.', 'Squatters movement.'

var encodedquery = encodeURIComponent(sparqlquery);

var queryurl = 'https://api.data.adamlink.nl/datasets/AdamNet/all/services/endpoint/sparql?default-graph-uri=&query=' + encodedquery + '&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on';

fetch(queryurl)
.then((resp) => resp.json()) // transform the data into json
.then(function (data) {

rows = data.results.bindings; // get the results
imgdiv = document.getElementById('images');
console.log(rows);

for (i = 0; i < rows.length; ++i) {

var img = document.createElement('img');
img.src = rows[i]['img']['value'];
img.title = rows[i]['title']['value'];
imgdiv.appendChild(img);

}
})
.catch(function (error) {
// if there is any error you will catch them here
console.log(error);
});

</script>



</body>

</html>
43 changes: 43 additions & 0 deletions religious-buildings-amsterdam/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>

<head>

<title>Adamlink SPARQLen met javascript</title>

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.css' rel='stylesheet' />
<link href='https://api.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.css' rel='stylesheet' />

<link rel="stylesheet" href="style/index.css">

</head>

<body>


<section id="map">
<aside>
<button>Close</button>
<header></header>
<div></div>
</aside>
</section>

<section id="filter-container">
<header>
<h1>Religious Buildings in Amsterdam</h1>
</header>
<div id="slider"></div>
<div id="filter"></div>
</section>
</body>

<script type="module" src="./scripts/index.js"></script>
<!-- <script type="module" src="./scripts/bundle.js"></script> -->

</html>
Loading