@netwerk-digitaal-erfgoed/network-of-terms-catalog 5.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/LICENSE.md +188 -0
  2. package/README.md +62 -0
  3. package/build/catalog.d.ts +45 -0
  4. package/build/catalog.js +140 -0
  5. package/build/catalog.js.map +1 -0
  6. package/build/index.d.ts +1 -0
  7. package/build/index.js +14 -0
  8. package/build/index.js.map +1 -0
  9. package/catalog/datasets/aat.jsonld +43 -0
  10. package/catalog/datasets/abr.jsonld +43 -0
  11. package/catalog/datasets/brinkman.jsonld +43 -0
  12. package/catalog/datasets/cht.jsonld +43 -0
  13. package/catalog/datasets/gtaa-genres.jsonld +37 -0
  14. package/catalog/datasets/gtaa-geografische-namen.jsonld +37 -0
  15. package/catalog/datasets/gtaa-onderwerpen.jsonld +37 -0
  16. package/catalog/datasets/muziekschatten-onderwerpen.jsonld +37 -0
  17. package/catalog/datasets/muziekschatten-personen.jsonld +37 -0
  18. package/catalog/datasets/mw-genresstijlen.jsonld +37 -0
  19. package/catalog/datasets/mw-personengroepen.jsonld +37 -0
  20. package/catalog/datasets/nmvw.jsonld +37 -0
  21. package/catalog/datasets/nta.jsonld +43 -0
  22. package/catalog/datasets/rkdartists.jsonld +37 -0
  23. package/catalog/datasets/wikidata-entities-all.jsonld +37 -0
  24. package/catalog/datasets/wikidata-entities-persons.jsonld +37 -0
  25. package/catalog/datasets/wikidata-entities-places.jsonld +37 -0
  26. package/catalog/datasets/wikidata-entities-streets.jsonld +37 -0
  27. package/catalog/datasets/wo2thesaurus.jsonld +43 -0
  28. package/catalog/publishers.jsonld +65 -0
  29. package/catalog/queries/lookup/aat.rq +49 -0
  30. package/catalog/queries/lookup/abr-cht.rq +46 -0
  31. package/catalog/queries/lookup/brinkman-nta.rq +66 -0
  32. package/catalog/queries/lookup/gtaa.rq +55 -0
  33. package/catalog/queries/lookup/muziekschatten.rq +79 -0
  34. package/catalog/queries/lookup/muziekweb.rq +40 -0
  35. package/catalog/queries/lookup/nmvw.rq +41 -0
  36. package/catalog/queries/lookup/rkdartists.rq +20 -0
  37. package/catalog/queries/lookup/wikidata.rq +51 -0
  38. package/catalog/queries/lookup/wo2thesaurus.rq +48 -0
  39. package/catalog/queries/search/aat.rq +50 -0
  40. package/catalog/queries/search/abr.rq +51 -0
  41. package/catalog/queries/search/brinkman.rq +61 -0
  42. package/catalog/queries/search/cht.rq +46 -0
  43. package/catalog/queries/search/gtaa.rq +55 -0
  44. package/catalog/queries/search/muziekschatten-onderwerpen.rq +45 -0
  45. package/catalog/queries/search/muziekschatten-personen.rq +66 -0
  46. package/catalog/queries/search/mw-genresstijlen.rq +31 -0
  47. package/catalog/queries/search/mw-personengroepen.rq +25 -0
  48. package/catalog/queries/search/nmvw.rq +42 -0
  49. package/catalog/queries/search/nta.rq +23 -0
  50. package/catalog/queries/search/rkdartists.rq +23 -0
  51. package/catalog/queries/search/wikidata-entities-all.rq +34 -0
  52. package/catalog/queries/search/wikidata-entities-persons.rq +44 -0
  53. package/catalog/queries/search/wikidata-entities-places.rq +67 -0
  54. package/catalog/queries/search/wikidata-entities-streets.rq +68 -0
  55. package/catalog/queries/search/wo2thesaurus.rq +46 -0
  56. package/package.json +56 -0
@@ -0,0 +1,46 @@
1
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
2
+
3
+ CONSTRUCT {
4
+ ?uri a skos:Concept ;
5
+ skos:prefLabel ?prefLabel ;
6
+ skos:altLabel ?altLabel ;
7
+ skos:hiddenLabel ?hiddenLabel ;
8
+ skos:scopeNote ?scopeNote .
9
+ ?uri skos:broader ?broader_uri .
10
+ ?broader_uri skos:prefLabel ?broader_prefLabel .
11
+ ?uri skos:narrower ?narrower_uri .
12
+ ?narrower_uri skos:prefLabel ?narrower_prefLabel .
13
+ }
14
+ WHERE {
15
+ ?uri ?predicate ?label .
16
+ VALUES ?predicate { skos:prefLabel skos:altLabel }
17
+ FILTER(LANG(?label) = "nl")
18
+ FILTER(CONTAINS(LCASE(?label), LCASE(?query)))
19
+ OPTIONAL {
20
+ ?uri skos:prefLabel ?prefLabel .
21
+ FILTER(LANG(?prefLabel) = "nl")
22
+ }
23
+ OPTIONAL {
24
+ ?uri skos:altLabel ?altLabel .
25
+ FILTER(LANG(?altLabel) = "nl")
26
+ }
27
+ OPTIONAL {
28
+ ?uri skos:hiddenLabel ?hiddenLabel .
29
+ FILTER(LANG(?hiddenLabel) = "nl")
30
+ }
31
+ OPTIONAL {
32
+ ?uri skos:scopeNote ?scopeNote .
33
+ FILTER(LANG(?scopeNote) = "nl")
34
+ }
35
+ OPTIONAL {
36
+ ?uri skos:broader ?broader_uri .
37
+ ?broader_uri skos:prefLabel ?broader_prefLabel .
38
+ FILTER(LANG(?broader_prefLabel) = "nl")
39
+ }
40
+ OPTIONAL {
41
+ ?uri skos:narrower ?narrower_uri .
42
+ ?narrower_uri skos:prefLabel ?narrower_prefLabel .
43
+ FILTER(LANG(?narrower_prefLabel) = "nl")
44
+ }
45
+ }
46
+ LIMIT 1000
@@ -0,0 +1,55 @@
1
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
2
+
3
+ CONSTRUCT {
4
+ ?uri a skos:Concept ;
5
+ skos:prefLabel ?prefLabel ;
6
+ skos:altLabel ?altLabel ;
7
+ skos:hiddenLabel ?hiddenLabel ;
8
+ skos:scopeNote ?scopeNote ;
9
+ skos:broader ?broader_uri ;
10
+ skos:narrower ?narrower_uri ;
11
+ skos:related ?related_uri .
12
+ ?broader_uri skos:prefLabel ?broader_prefLabel .
13
+ ?narrower_uri skos:prefLabel ?narrower_prefLabel .
14
+ ?related_uri skos:prefLabel ?related_prefLabel .
15
+ }
16
+ WHERE {
17
+ ?uri ?predicate ?label .
18
+ VALUES ?predicate { skos:prefLabel skos:altLabel }
19
+ FILTER(LANG(?label) = "nl")
20
+
21
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
22
+ FILTER (<bif:contains> (?label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")))
23
+ OPTIONAL {
24
+ ?uri skos:prefLabel ?prefLabel .
25
+ FILTER(LANG(?prefLabel) = "nl" )
26
+ }
27
+ OPTIONAL {
28
+ ?uri skos:altLabel ?altLabel .
29
+ FILTER(LANG(?altLabel) = "nl")
30
+ }
31
+ OPTIONAL {
32
+ ?uri skos:hiddenLabel ?hiddenLabel .
33
+ FILTER(LANG(?hiddenLabel) = "nl")
34
+ }
35
+ OPTIONAL {
36
+ ?uri skos:scopeNote ?scopeNote .
37
+ FILTER(LANG(?scopeNote) = "nl")
38
+ }
39
+ OPTIONAL {
40
+ ?uri skos:broader ?broader_uri .
41
+ ?broader_uri skos:prefLabel ?broader_prefLabel .
42
+ FILTER(LANG(?broader_prefLabel) = "nl")
43
+ }
44
+ OPTIONAL {
45
+ ?uri skos:narrower ?narrower_uri .
46
+ ?narrower_uri skos:prefLabel ?narrower_prefLabel .
47
+ FILTER(LANG(?narrower_prefLabel) = "nl")
48
+ }
49
+ OPTIONAL {
50
+ ?uri skos:related ?related_uri .
51
+ ?related_uri skos:prefLabel ?related_prefLabel .
52
+ FILTER(LANG(?related_prefLabel) = "nl")
53
+ }
54
+ }
55
+ LIMIT 1000
@@ -0,0 +1,45 @@
1
+ PREFIX schema: <http://schema.org/>
2
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
3
+ PREFIX som: <http://data.muziekschatten.nl/som/>
4
+
5
+ CONSTRUCT {
6
+ ?uri a skos:Concept;
7
+ skos:prefLabel ?schema_name;
8
+ skos:scopeNote ?scopeNote;
9
+ skos:broader ?broader_uri .
10
+ ?broader_uri skos:prefLabel ?broader_schema_name .
11
+ }
12
+ WHERE {
13
+ ?uri a skos:Concept .
14
+ ?uri ?predicate ?label .
15
+ VALUES ?predicate { schema:name schema:keywords }
16
+
17
+ # A 'FILTER (<bif:contains>, ...)' currently does not work due to https://github.com/comunica/comunica/issues/844
18
+ ?label <bif:contains> ?query .
19
+
20
+ OPTIONAL {
21
+ ?uri schema:name ?schema_name .
22
+ FILTER(LANG(?schema_name) = "nl")
23
+ }
24
+ OPTIONAL {
25
+ ?uri skos:broader ?broader_uri .
26
+ ?broader_uri schema:name ?broader_schema_name .
27
+ FILTER(LANG(?broader_schema_name) = "nl")
28
+ }
29
+ OPTIONAL {
30
+ ?uri schema:keywords ?schema_keywords
31
+ }
32
+ OPTIONAL {
33
+ ?uri som:DC ?dc
34
+ }
35
+ BIND(
36
+ COALESCE(
37
+ IF(BOUND(?schema_keywords) && BOUND(?dc), CONCAT("Trefwoorden: ", ?schema_keywords, " | ", "Dewey: ", ?dc), ?noScopeNote),
38
+ IF(BOUND(?schema_keywords), CONCAT("Trefwoorden: ", ?schema_keywords), ?noScopeNote),
39
+ IF(BOUND(?dc), CONCAT("Dewey: ", ?dc), ?noScopeNote)
40
+ ) AS ?scopeNote
41
+ )
42
+
43
+ ?uri som:BASIS "1" .
44
+ }
45
+ LIMIT 1000
@@ -0,0 +1,66 @@
1
+ PREFIX schema: <http://schema.org/>
2
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
3
+ PREFIX som: <http://data.muziekschatten.nl/som/>
4
+
5
+ # Persons for testing the query
6
+ # No birth year:
7
+ # <https://data.muziekschatten.nl/som/da6866c6ba20fb11f6e2617d4a971b91>
8
+ # No death year:
9
+ # <https://data.muziekschatten.nl/som/ae7b2de42c4158219176d464008dfd49>
10
+ # No birth year, no death year:
11
+ # <https://data.muziekschatten.nl/som/ed25d29466903394c982dd3dc185bd80>
12
+ # Both a birth year and a death year:
13
+ # <https://data.muziekschatten.nl/som/ff20e6a4c17dbb9cddbffedc97c292e0>
14
+ # No family name:
15
+ # <https://data.muziekschatten.nl/som/4275e51d7d94b224928da9b7707a170a>
16
+ # No given name:
17
+ # <https://data.muziekschatten.nl/som/b101ea3b20de7f9b40070ea9191d98bd>
18
+ # No family name, no given name:
19
+ # <https://data.muziekschatten.nl/som/c5f95197941d9bb4f68a1e25c379f081>
20
+ # Both a family name and a given name:
21
+ # <https://data.muziekschatten.nl/som/b7bc6d966287e0f0e0f491752ff65ba5>
22
+
23
+ CONSTRUCT {
24
+ ?uri a skos:Concept;
25
+ skos:prefLabel ?prefLabel ;
26
+ skos:altLabel ?schema_alternateName ;
27
+ skos:scopeNote ?schema_hasOccupation .
28
+ }
29
+ WHERE {
30
+ ?uri a schema:Person .
31
+ # Require the presence of this property for quality purposes
32
+ ?uri som:NDEREC ?nderec .
33
+
34
+ ?uri ?predicate ?label .
35
+ VALUES ?predicate { schema:name schema:alternateName }
36
+
37
+ # A 'FILTER (<bif:contains>, ...)' currently does not work due to https://github.com/comunica/comunica/issues/844
38
+ ?label <bif:contains> ?query .
39
+
40
+ OPTIONAL { ?uri schema:name ?schema_name }
41
+ OPTIONAL { ?uri schema:alternateName ?schema_alternateName }
42
+ OPTIONAL { ?uri schema:hasOccupation ?schema_hasOccupation }
43
+
44
+ OPTIONAL { ?uri schema:familyName ?schema_familyName }
45
+ OPTIONAL { ?uri schema:givenName ?schema_givenName }
46
+ BIND(
47
+ COALESCE(
48
+ IF(BOUND(?schema_familyName) && BOUND(?schema_givenName), CONCAT(?schema_familyName, ", ", ?schema_givenName), ?noName),
49
+ ?schema_familyName,
50
+ ?schema_givenName,
51
+ ?schema_name # Fallback
52
+ ) AS ?name
53
+ )
54
+ OPTIONAL { ?uri som:GDAT ?som_birthYear }
55
+ OPTIONAL { ?uri som:SDAT ?som_deathYear }
56
+ BIND(
57
+ COALESCE(
58
+ IF(BOUND(?som_birthYear) && BOUND(?som_deathYear), CONCAT(?som_birthYear, "-", ?som_deathYear), ?noDate),
59
+ IF(BOUND(?som_birthYear), CONCAT(?som_birthYear, "-"), ?noDate),
60
+ IF(BOUND(?som_deathYear), CONCAT("-", ?som_deathYear), ?noDate),
61
+ ""
62
+ ) AS ?dates
63
+ )
64
+ BIND(CONCAT(?name, IF(?dates != "", CONCAT(" (", ?dates, ")"), "")) AS ?prefLabel)
65
+ }
66
+ LIMIT 1000
@@ -0,0 +1,31 @@
1
+ PREFIX muziekweb: <https://data.muziekweb.nl/vocab/>
2
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
3
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
4
+
5
+ CONSTRUCT {
6
+ ?uri a skos:Concept ;
7
+ skos:prefLabel ?rdfs_label ;
8
+ skos:scopeNote ?rdfs_comment .
9
+ ?uri skos:broader ?broader_uri .
10
+ ?broader_uri skos:prefLabel ?broader_prefLabel .
11
+ ?uri skos:narrower ?narrower_uri .
12
+ ?narrower_uri skos:prefLabel ?narrower_prefLabel .
13
+ }
14
+ WHERE {
15
+ ?uri a muziekweb:Genre .
16
+ ?uri rdfs:label ?rdfs_label .
17
+
18
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
19
+ FILTER (<bif:contains> (?rdfs_label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")))
20
+
21
+ OPTIONAL {
22
+ ?uri skos:broader ?broader_uri .
23
+ ?broader_uri rdfs:label ?broader_prefLabel
24
+ }
25
+ OPTIONAL {
26
+ ?uri skos:narrower ?narrower_uri .
27
+ ?narrower_uri rdfs:label ?narrower_prefLabel
28
+ }
29
+ OPTIONAL { ?uri rdfs:comment ?rdfs_comment }
30
+ }
31
+ LIMIT 1000
@@ -0,0 +1,25 @@
1
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
2
+ PREFIX schema: <http://schema.org/>
3
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
4
+
5
+ CONSTRUCT {
6
+ ?uri a skos:Concept ;
7
+ skos:prefLabel ?prefLabel ;
8
+ skos:altLabel ?altLabel ;
9
+ skos:hiddenLabel ?hiddenLabel ;
10
+ skos:scopeNote ?schema_description .
11
+ }
12
+ WHERE {
13
+ ?uri a schema:MusicGroup .
14
+ ?uri ?predicate ?label .
15
+ VALUES ?predicate { skos:prefLabel skos:altLabel }
16
+
17
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
18
+ FILTER (<bif:contains> (?label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")))
19
+
20
+ OPTIONAL { ?uri skos:prefLabel ?prefLabel }
21
+ OPTIONAL { ?uri skos:altLabel ?altLabel }
22
+ OPTIONAL { ?uri skos:hiddenLabel ?hiddenLabel }
23
+ OPTIONAL { ?uri schema:description ?schema_description }
24
+ }
25
+ LIMIT 1000
@@ -0,0 +1,42 @@
1
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
2
+
3
+ CONSTRUCT {
4
+ ?uri a skos:Concept ;
5
+ skos:prefLabel ?prefLabel ;
6
+ skos:altLabel ?altLabel ;
7
+ skos:hiddenLabel ?hiddenLabel ;
8
+ skos:scopeNote ?scopeNote .
9
+ ?uri skos:broader ?broader_uri .
10
+ ?broader_uri skos:prefLabel ?broader_prefLabel .
11
+ ?uri skos:narrower ?narrower_uri .
12
+ ?narrower_uri skos:prefLabel ?narrower_prefLabel .
13
+ }
14
+ WHERE {
15
+ ?uri ?predicate ?label .
16
+ VALUES ?predicate { skos:prefLabel skos:altLabel }
17
+
18
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
19
+ FILTER (<bif:contains> (?label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")))
20
+
21
+ OPTIONAL {
22
+ ?uri skos:prefLabel ?prefLabel .
23
+ }
24
+ OPTIONAL {
25
+ ?uri skos:scopeNote ?scopeNote .
26
+ }
27
+ OPTIONAL {
28
+ ?uri skos:altLabel ?altLabel .
29
+ }
30
+ OPTIONAL {
31
+ ?uri skos:hiddenLabel ?hiddenLabel .
32
+ }
33
+ OPTIONAL {
34
+ ?uri skos:broader ?broader_uri .
35
+ ?broader_uri skos:prefLabel ?broader_prefLabel .
36
+ }
37
+ OPTIONAL {
38
+ ?uri skos:narrower ?narrower_uri .
39
+ ?narrower_uri skos:prefLabel ?narrower_prefLabel .
40
+ }
41
+ }
42
+ LIMIT 1000
@@ -0,0 +1,23 @@
1
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
2
+
3
+ CONSTRUCT {
4
+ ?uri a skos:Concept ;
5
+ skos:prefLabel ?rdfs_label ;
6
+ skos:altLabel ?schema_name ;
7
+ skos:altLabel ?schema_alternateName ;
8
+ skos:scopeNote ?schema_description .
9
+ }
10
+ WHERE {
11
+ ?uri schema:mainEntityOfPage/schema:isPartOf <http://data.bibliotheken.nl/id/dataset/persons> .
12
+ ?uri ?predicate ?label .
13
+ VALUES ?predicate { rdfs:label schema:name schema:alternateName }
14
+
15
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
16
+ FILTER (<bif:contains> (?label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")))
17
+
18
+ OPTIONAL { ?uri rdfs:label ?rdfs_label }
19
+ OPTIONAL { ?uri schema:name ?schema_name }
20
+ OPTIONAL { ?uri schema:alternateName ?schema_alternateName }
21
+ OPTIONAL { ?uri schema:description ?schema_description }
22
+ }
23
+ LIMIT 1000
@@ -0,0 +1,23 @@
1
+ PREFIX schema: <http://schema.org/>
2
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
3
+
4
+ CONSTRUCT {
5
+ ?uri a skos:Concept ;
6
+ skos:prefLabel ?schema_name ;
7
+ skos:altLabel ?schema_alternateName ;
8
+ skos:scopeNote ?schema_description .
9
+ }
10
+ WHERE {
11
+ ?uri a ?type .
12
+ VALUES ?type { schema:Person schema:Organization }
13
+ ?uri ?name ?label .
14
+ VALUES ?name { schema:name schema:alternateName }
15
+
16
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
17
+ FILTER (<bif:contains> (?label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")))
18
+
19
+ OPTIONAL { ?uri schema:name ?schema_name . }
20
+ OPTIONAL { ?uri schema:alternateName ?schema_alternateName . }
21
+ OPTIONAL { ?uri schema:description ?schema_description . }
22
+ }
23
+ LIMIT 1000
@@ -0,0 +1,34 @@
1
+ PREFIX bd: <http://www.bigdata.com/rdf#>
2
+ PREFIX mwapi: <https://www.mediawiki.org/ontology#API/>
3
+ PREFIX schema: <http://schema.org/>
4
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
5
+ PREFIX wikibase: <http://wikiba.se/ontology#>
6
+
7
+ CONSTRUCT {
8
+ # Wikidata seems to have a problem with the short syntax for construct queries
9
+ # so always use full syntax: "?s ?p ?o ." else you end up with an empty result list!
10
+ ?item a skos:Concept .
11
+ ?item skos:prefLabel ?rdfs_label .
12
+ ?item skos:altLabel ?altLabel .
13
+ ?item skos:scopeNote ?schema_description .
14
+ }
15
+ WHERE {
16
+ SERVICE wikibase:mwapi {
17
+ bd:serviceParam wikibase:endpoint "www.wikidata.org" .
18
+ bd:serviceParam wikibase:api "EntitySearch" .
19
+ bd:serviceParam mwapi:language "nl" .
20
+ bd:serviceParam mwapi:search ?query .
21
+ ?item wikibase:apiOutputItem mwapi:item .
22
+ }
23
+ ?item rdfs:label ?rdfs_label .
24
+ FILTER(LANG(?rdfs_label) = "nl")
25
+ OPTIONAL {
26
+ ?item skos:altLabel ?altLabel .
27
+ FILTER(LANG(?altLabel) = "nl")
28
+ }
29
+ OPTIONAL {
30
+ ?item schema:description ?schema_description
31
+ FILTER(LANG(?schema_description) = "nl")
32
+ }
33
+ }
34
+ LIMIT 1000
@@ -0,0 +1,44 @@
1
+ PREFIX bd: <http://www.bigdata.com/rdf#>
2
+ PREFIX mwapi: <https://www.mediawiki.org/ontology#API/>
3
+ PREFIX schema: <http://schema.org/>
4
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
5
+ PREFIX wikibase: <http://wikiba.se/ontology#>
6
+ PREFIX wdt: <http://www.wikidata.org/prop/direct/>
7
+ PREFIX wd: <http://www.wikidata.org/entity/>
8
+
9
+ CONSTRUCT {
10
+ # Wikidata seems to have a problem with the short syntax for construct queries
11
+ # so always use full syntax: "?s ?p ?o ." else you end up with an empty result list!
12
+ ?item a skos:Concept .
13
+ ?item skos:prefLabel ?prefLabel .
14
+ ?item skos:altLabel ?altLabel .
15
+ ?item skos:scopeNote ?description .
16
+ }
17
+ WHERE {
18
+ SERVICE wikibase:mwapi {
19
+ bd:serviceParam wikibase:endpoint "www.wikidata.org" .
20
+ # Instead of using the "EntitySearch" API we use a more generic text search option
21
+ # To avoid noise we will filter the resultset on the occurence of the search string
22
+ # in either prefLabel or altLabel
23
+ bd:serviceParam wikibase:api "Search" .
24
+ bd:serviceParam mwapi:language "nl" .
25
+ bd:serviceParam mwapi:srsearch ?query .
26
+ ?item wikibase:apiOutputItem mwapi:title .
27
+ }
28
+ # Only select instances of type "human"
29
+ ?item wdt:P31 wd:Q5 .
30
+
31
+ ?item rdfs:label ?prefLabel .
32
+ FILTER(LANG(?prefLabel) = "nl")
33
+ OPTIONAL {
34
+ ?item skos:altLabel ?altLabel .
35
+ FILTER(LANG(?altLabel) = "nl"||LANG(?altLabel) = "en")
36
+ }
37
+ OPTIONAL {
38
+ ?item schema:description ?description
39
+ FILTER(LANG(?description) = "nl")
40
+ }
41
+ # limit the result set to matches in the prefLabels or altLabels
42
+ FILTER(CONTAINS(LCASE(?prefLabel),LCASE(?query))||CONTAINS(LCASE(?altLabel),LCASE(?query)))
43
+ }
44
+ LIMIT 1000
@@ -0,0 +1,67 @@
1
+ PREFIX bd: <http://www.bigdata.com/rdf#>
2
+ PREFIX mwapi: <https://www.mediawiki.org/ontology#API/>
3
+ PREFIX schema: <http://schema.org/>
4
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
5
+ PREFIX wikibase: <http://wikiba.se/ontology#>
6
+ PREFIX wdt: <http://www.wikidata.org/prop/direct/>
7
+ PREFIX wd: <http://www.wikidata.org/entity/>
8
+
9
+ CONSTRUCT {
10
+ # Wikidata seems to have a problem with the short syntax for construct queries
11
+ # so always use full syntax: "?s ?p ?o ." else you end up with an empty result list!
12
+ ?item a skos:Concept .
13
+ ?item skos:prefLabel ?prefLabel .
14
+ ?item skos:altLabel ?altLabel .
15
+ ?item skos:scopeNote ?schema_description .
16
+ }
17
+ WHERE {
18
+ SERVICE wikibase:mwapi {
19
+ bd:serviceParam wikibase:endpoint "www.wikidata.org" .
20
+ # The search seems to be done with a "starts with" function,
21
+ # where by default the English pref and alt labels are searched.
22
+ # Setting the required language to something else than "en"
23
+ # results in an additional search in the pref and alt labels for this language.
24
+ bd:serviceParam wikibase:api "EntitySearch" .
25
+ bd:serviceParam mwapi:language "nl" .
26
+ bd:serviceParam mwapi:search ?query .
27
+ ?item wikibase:apiOutputItem mwapi:item .
28
+ }
29
+ # We are looking for places; because there are many types possible (cities, villages, etc) we filter
30
+ # on instances (P31) or subclasses (P279) of "human settlement" (Q486972)
31
+ ?item wdt:P31/wdt:P279* wd:Q486972 .
32
+
33
+ {
34
+ # Select places in the Netherlands (Q55)
35
+ ?item wdt:P17 wd:Q55 .
36
+
37
+ # Filter out Dutch municipalities
38
+ FILTER NOT EXISTS { ?item wdt:P31 wd:Q2039348 }
39
+ }
40
+ UNION {
41
+ # Select places in Belgium
42
+ ?item wdt:P17 wd:Q31 .
43
+
44
+ # Filter out Belgian municipalities
45
+ FILTER NOT EXISTS { ?item wdt:P31 wd:Q493522}
46
+ }
47
+
48
+ # Filter out agglomerations
49
+ FILTER NOT EXISTS { ?item wdt:P31 wd:Q159313 }
50
+
51
+ # Filter out neighborhoods
52
+ FILTER NOT EXISTS { ?item wdt:P31 wd:Q123705 }
53
+
54
+ ?item rdfs:label ?prefLabel .
55
+
56
+ # select only the Dutch pref/altLabels and description
57
+ FILTER(LANG(?prefLabel) = "nl")
58
+ OPTIONAL {
59
+ ?item skos:altLabel ?altLabel .
60
+ FILTER(LANG(?altLabel) = "nl")
61
+ }
62
+ OPTIONAL {
63
+ ?item schema:description ?schema_description
64
+ FILTER(LANG(?schema_description) = "nl")
65
+ }
66
+ }
67
+ LIMIT 1000
@@ -0,0 +1,68 @@
1
+ PREFIX bd: <http://www.bigdata.com/rdf#>
2
+ PREFIX mwapi: <https://www.mediawiki.org/ontology#API/>
3
+ PREFIX schema: <http://schema.org/>
4
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
5
+ PREFIX wikibase: <http://wikiba.se/ontology#>
6
+ PREFIX wdt: <http://www.wikidata.org/prop/direct/>
7
+ PREFIX wd: <http://www.wikidata.org/entity/>
8
+
9
+ CONSTRUCT {
10
+ # Wikidata seems to have a problem with the short syntax for construct queries
11
+ # so always use full syntax: "?s ?p ?o ." else you end up with an empty result list!
12
+ ?item a skos:Concept .
13
+ ?item skos:prefLabel ?streetName .
14
+ ?item skos:altLabel ?fullName .
15
+ ?item skos:altLabel ?altLabel .
16
+ ?item skos:scopeNote ?description .
17
+ }
18
+ WHERE {
19
+ SERVICE wikibase:mwapi {
20
+ bd:serviceParam wikibase:endpoint "www.wikidata.org" .
21
+ # The search seems to be done with a "starts with" function,
22
+ # where by default the English pref and alt labels are searched.
23
+ # Setting the required language to something else than "en"
24
+ # results in an additional search in the pref and alt labels for this language.
25
+ bd:serviceParam wikibase:api "EntitySearch" .
26
+ bd:serviceParam mwapi:language "nl" .
27
+ bd:serviceParam mwapi:search ?query .
28
+ ?item wikibase:apiOutputItem mwapi:item .
29
+ }
30
+ {
31
+ # select Streets
32
+ ?item wdt:P31 wd:Q79007
33
+ }
34
+ UNION
35
+ {
36
+ # select Squares
37
+ ?item wdt:P31 wd:Q174782
38
+ }
39
+ ?item wdt:P17 wd:Q55 .
40
+ ?item wdt:P131 ?administration .
41
+ OPTIONAL {
42
+ ?item wdt:P276 ?location .
43
+ ?location rdfs:label ?locationName .
44
+ FILTER LANGMATCHES(LANG(?locationName),"nl")
45
+ }
46
+ OPTIONAL {
47
+ ?item schema:description ?description
48
+ FILTER(LANG(?description) = "nl")
49
+ }
50
+ OPTIONAL {
51
+ ?item skos:altLabel ?altLabel
52
+ FILTER(LANG(?altLabel) = "nl")
53
+ }
54
+ ?item rdfs:label ?streetName .
55
+ ?administration rdfs:label ?administrationName .
56
+ FILTER LANGMATCHES(LANG(?streetName),"nl")
57
+ FILTER LANGMATCHES(LANG(?administrationName),"nl")
58
+ FILTER (STRSTARTS(LCASE(?streetName),LCASE(?query))||STRSTARTS(LCASE(?altLabel),LCASE(?query)))
59
+ BIND(
60
+ IF(
61
+ BOUND(?locationName),
62
+ CONCAT(?streetName," (",?locationName,")"),
63
+ CONCAT(?streetName," (",?administrationName,")")
64
+ )
65
+ as ?fullName
66
+ )
67
+ }
68
+ LIMIT 1000
@@ -0,0 +1,46 @@
1
+ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
2
+
3
+ CONSTRUCT {
4
+ ?uri a skos:Concept ;
5
+ skos:prefLabel ?prefLabel ;
6
+ skos:altLabel ?altLabel ;
7
+ skos:hiddenLabel ?hiddenLabel ;
8
+ skos:scopeNote ?scopeNote ;
9
+ skos:broader ?broader_uri ;
10
+ skos:narrower ?narrower_uri .
11
+ ?broader_uri skos:prefLabel ?broader_prefLabel .
12
+ ?narrower_uri skos:prefLabel ?narrower_prefLabel .
13
+ }
14
+ WHERE {
15
+ ?uri ?predicate ?label .
16
+ VALUES ?predicate { skos:prefLabel skos:altLabel }
17
+ FILTER(LANG(?label) = "nl")
18
+ FILTER(CONTAINS(LCASE(?label), LCASE(?query)))
19
+ OPTIONAL {
20
+ ?uri skos:prefLabel ?prefLabel .
21
+ FILTER(LANG(?prefLabel) = "nl" )
22
+ }
23
+ OPTIONAL {
24
+ ?uri skos:scopeNote ?scopeNote .
25
+ FILTER(LANG(?scopeNote) = "nl")
26
+ }
27
+ OPTIONAL {
28
+ ?uri skos:altLabel ?altLabel .
29
+ FILTER(LANG(?altLabel) = "nl")
30
+ }
31
+ OPTIONAL {
32
+ ?uri skos:hiddenLabel ?hiddenLabel .
33
+ FILTER(LANG(?hiddenLabel) = "nl")
34
+ }
35
+ OPTIONAL {
36
+ ?uri skos:broader ?broader_uri .
37
+ ?broader_uri skos:prefLabel ?broader_prefLabel .
38
+ FILTER(LANG(?broader_prefLabel) = "nl")
39
+ }
40
+ OPTIONAL {
41
+ ?uri skos:narrower ?narrower_uri .
42
+ ?narrower_uri skos:prefLabel ?narrower_prefLabel .
43
+ FILTER(LANG(?narrower_prefLabel) = "nl")
44
+ }
45
+ }
46
+ LIMIT 1000