@netwerk-digitaal-erfgoed/network-of-terms-catalog 5.10.1 → 5.10.2

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.
@@ -5,43 +5,37 @@ PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
5
5
  PREFIX wikibase: <http://wikiba.se/ontology#>
6
6
  PREFIX wdt: <http://www.wikidata.org/prop/direct/>
7
7
  PREFIX wd: <http://www.wikidata.org/entity/>
8
+ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
8
9
 
9
10
  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 .
11
+ ?item a skos:Concept ;
12
+ skos:prefLabel ?streetName ;
13
+ skos:altLabel ?altLabel ;
14
+ skos:scopeNote ?description .
17
15
  }
18
16
  WHERE {
19
17
  SERVICE wikibase:mwapi {
20
18
  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" .
19
+ bd:serviceParam wikibase:api "Search" .
26
20
  bd:serviceParam mwapi:language "nl" .
27
- bd:serviceParam mwapi:search ?query .
28
- ?item wikibase:apiOutputItem mwapi:item .
21
+ bd:serviceParam mwapi:srsearch ?query .
22
+ ?item wikibase:apiOutputItem mwapi:title .
29
23
  }
30
24
  {
31
- # select Streets
32
- ?item wdt:P31 wd:Q79007
25
+ # select Streets
26
+ ?item wdt:P31 wd:Q79007
33
27
  }
34
- UNION
28
+ UNION
35
29
  {
36
- # select Squares
37
- ?item wdt:P31 wd:Q174782
30
+ # select Squares
31
+ ?item wdt:P31 wd:Q174782
38
32
  }
39
33
  ?item wdt:P17 wd:Q55 .
40
34
  ?item wdt:P131 ?administration .
41
35
  OPTIONAL {
42
- ?item wdt:P276 ?location .
43
- ?location rdfs:label ?locationName .
44
- FILTER LANGMATCHES(LANG(?locationName),"nl")
36
+ ?item wdt:P276 ?location .
37
+ ?location rdfs:label ?locationName .
38
+ FILTER LANGMATCHES(LANG(?locationName),"nl")
45
39
  }
46
40
  OPTIONAL {
47
41
  ?item schema:description ?description
@@ -55,14 +49,17 @@ WHERE {
55
49
  ?administration rdfs:label ?administrationName .
56
50
  FILTER LANGMATCHES(LANG(?streetName),"nl")
57
51
  FILTER LANGMATCHES(LANG(?administrationName),"nl")
58
- FILTER (STRSTARTS(LCASE(?streetName),LCASE(?query))||STRSTARTS(LCASE(?altLabel),LCASE(?query)))
52
+
53
+ # Some streets come with altLabel ‘Street name (Place name)’. For those that don’t, construct the altLabel manually.
59
54
  BIND(
60
- IF(
61
- BOUND(?locationName),
62
- CONCAT(?streetName," (",?locationName,")"),
63
- CONCAT(?streetName," (",?administrationName,")")
64
- )
65
- as ?fullName
55
+ COALESCE(
56
+ ?altLabel,
57
+ IF(
58
+ BOUND(?locationName),
59
+ CONCAT(?streetName," (",?locationName,")"),
60
+ CONCAT(?streetName," (",?administrationName,")")
61
+ )
62
+ ) as ?altLabel
66
63
  )
67
64
  }
68
- LIMIT 1000
65
+ LIMIT 1000
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netwerk-digitaal-erfgoed/network-of-terms-catalog",
3
- "version": "5.10.1",
3
+ "version": "5.10.2",
4
4
  "type": "module",
5
5
  "description": "Catalog of Network of Terms datasets",
6
6
  "repository": {