@netwerk-digitaal-erfgoed/network-of-terms-catalog 5.4.2 → 5.5.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.
@@ -20,6 +20,10 @@ WHERE {
20
20
 
21
21
  ?uri a skos:Concept .
22
22
 
23
+ # Exclude terms from the 'Technische Lijsten', a concept scheme with terms that should only be used by NOB
24
+ FILTER NOT EXISTS {
25
+ ?uri skos:inScheme <https://data.niod.nl/WO2_Thesaurus/11183>
26
+ }
23
27
  OPTIONAL {
24
28
  ?uri skos:prefLabel ?prefLabel .
25
29
  FILTER(LANG(?prefLabel) = "nl")
@@ -14,8 +14,18 @@ WHERE {
14
14
  ?uri ?predicate ?label .
15
15
  VALUES ?predicate { skos:prefLabel skos:altLabel }
16
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")))
17
+ {
18
+ FILTER(?virtuosoQuery)
19
+ ?uri ?predicate ?label .
20
+ ?label <bif:contains> ?virtuosoQuery .
21
+ } UNION {
22
+ # BC support.
23
+ BIND(?virtuosoQuery as ?b)
24
+ FILTER(!BOUND(?b))
25
+ ?uri ?predicate ?label .
26
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
27
+ FILTER (<bif:contains> (?label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")) )
28
+ }
19
29
 
20
30
  OPTIONAL { ?uri skos:prefLabel ?prefLabel }
21
31
  OPTIONAL { ?uri skos:altLabel ?altLabel }
@@ -22,8 +22,18 @@ WHERE {
22
22
  VALUES ?predicate { skos:prefLabel skos:altLabel }
23
23
  FILTER(LANG(?label) = "nl")
24
24
 
25
- # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
26
- FILTER (<bif:contains> (?label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")))
25
+ {
26
+ FILTER(?virtuosoQuery)
27
+ ?uri ?predicate ?label .
28
+ ?label <bif:contains> ?virtuosoQuery .
29
+ } UNION {
30
+ # BC support.
31
+ BIND(?virtuosoQuery as ?b)
32
+ FILTER(!BOUND(?b))
33
+ ?uri ?predicate ?label .
34
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
35
+ FILTER (<bif:contains> (?label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")))
36
+ }
27
37
 
28
38
  OPTIONAL {
29
39
  ?uri skos:prefLabel ?prefLabel .
@@ -18,8 +18,19 @@ WHERE {
18
18
  VALUES ?predicate { skos:prefLabel skos:altLabel }
19
19
  FILTER(LANG(?label) = "nl")
20
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")))
21
+ {
22
+ FILTER(?virtuosoQuery)
23
+ ?uri ?predicate ?label .
24
+ ?label <bif:contains> ?virtuosoQuery .
25
+ } UNION {
26
+ # BC support.
27
+ BIND(?virtuosoQuery as ?b)
28
+ FILTER(!BOUND(?b))
29
+ ?uri ?predicate ?label .
30
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
31
+ FILTER (<bif:contains> (?label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")) )
32
+ }
33
+
23
34
  OPTIONAL {
24
35
  ?uri skos:prefLabel ?prefLabel .
25
36
  FILTER(LANG(?prefLabel) = "nl" )
@@ -13,10 +13,19 @@ CONSTRUCT {
13
13
  }
14
14
  WHERE {
15
15
  ?uri a muziekweb:Genre .
16
- ?uri rdfs:label ?rdfs_label .
17
16
 
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")))
17
+ {
18
+ FILTER(?virtuosoQuery)
19
+ ?uri rdfs:label ?rdfs_label .
20
+ ?rdfs_label <bif:contains> ?virtuosoQuery .
21
+ } UNION {
22
+ # BC support.
23
+ BIND(?virtuosoQuery as ?b)
24
+ FILTER(!BOUND(?b))
25
+ ?uri rdfs:label ?rdfs_label .
26
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
27
+ FILTER (<bif:contains> (?rdfs_label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")) )
28
+ }
20
29
 
21
30
  OPTIONAL {
22
31
  ?uri skos:broader ?broader_uri .
@@ -14,8 +14,18 @@ WHERE {
14
14
  ?uri ?predicate ?label .
15
15
  VALUES ?predicate { skos:prefLabel skos:altLabel }
16
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")))
17
+ {
18
+ FILTER(?virtuosoQuery)
19
+ ?uri ?predicate ?label .
20
+ ?label <bif:contains> ?virtuosoQuery .
21
+ } UNION {
22
+ # BC support.
23
+ BIND(?virtuosoQuery as ?b)
24
+ FILTER(!BOUND(?b))
25
+ ?uri ?predicate ?label .
26
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
27
+ FILTER (<bif:contains> (?label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")) )
28
+ }
19
29
 
20
30
  OPTIONAL { ?uri skos:prefLabel ?prefLabel }
21
31
  OPTIONAL { ?uri skos:altLabel ?altLabel }
@@ -15,8 +15,18 @@ WHERE {
15
15
  ?uri ?predicate ?label .
16
16
  VALUES ?predicate { skos:prefLabel skos:altLabel }
17
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")))
18
+ {
19
+ FILTER(?virtuosoQuery)
20
+ ?uri ?predicate ?label .
21
+ ?label <bif:contains> ?virtuosoQuery .
22
+ } UNION {
23
+ # BC support.
24
+ BIND(?virtuosoQuery as ?b)
25
+ FILTER(!BOUND(?b))
26
+ ?uri ?predicate ?label .
27
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
28
+ FILTER (<bif:contains> (?label, REPLACE(?query, "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)", " AND ", "i")) )
29
+ }
20
30
 
21
31
  OPTIONAL {
22
32
  ?uri skos:prefLabel ?prefLabel .
@@ -12,15 +12,25 @@ WHERE {
12
12
  ?uri ?predicate ?label .
13
13
  VALUES ?predicate { rdfs:label schema:name schema:alternateName }
14
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,
17
- REPLACE(
18
- REPLACE(?query, "[.,]", " "),
19
- "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)(?!$)(?![[:space:]])",
20
- " AND ",
21
- "i"
22
- )
23
- ))
15
+ {
16
+ FILTER(?virtuosoQuery)
17
+ ?uri ?predicate ?label .
18
+ ?label <bif:contains> ?virtuosoQuery .
19
+ } UNION {
20
+ # BC support.
21
+ BIND(?virtuosoQuery as ?b)
22
+ FILTER(!BOUND(?b))
23
+ ?uri ?predicate ?label .
24
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
25
+ FILTER (<bif:contains> (?label,
26
+ REPLACE(
27
+ REPLACE(?query, "[.,]", " "),
28
+ "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)(?!$)(?![[:space:]])",
29
+ " AND ",
30
+ "i"
31
+ )
32
+ ))
33
+ }
24
34
 
25
35
  OPTIONAL { ?uri rdfs:label ?rdfs_label }
26
36
  OPTIONAL { ?uri schema:name ?schema_name }
@@ -16,15 +16,27 @@ WHERE {
16
16
  ?uri ?name ?label .
17
17
  VALUES ?name { schema:name schema:alternateName }
18
18
 
19
- # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
20
- FILTER (<bif:contains> (?label,
21
- REPLACE(
22
- REPLACE(?query, "[.,]", " "),
23
- "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)(?!$)(?![[:space:]])",
24
- " AND ",
25
- "i"
26
- )
27
- ))
19
+ {
20
+ FILTER(?virtuosoQuery)
21
+ ?uri ?predicate ?label .
22
+ ?label <bif:contains> ?virtuosoQuery .
23
+ } UNION {
24
+ # BC support.
25
+ # The RKD Virtuoso endpoint needs isLiteral() rather than !BOUND() because the latter still matches, throwing an
26
+ # error for queries with diacritics.
27
+ FILTER(!isLiteral(?virtuosoQuery))
28
+
29
+ ?uri ?predicate ?label .
30
+ # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
31
+ FILTER (<bif:contains> (?label,
32
+ REPLACE(
33
+ REPLACE(?query, "[.,]", " "),
34
+ "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)(?!$)(?![[:space:]])",
35
+ " AND ",
36
+ "i"
37
+ )
38
+ ))
39
+ }
28
40
 
29
41
  OPTIONAL { ?uri schema:name ?schema_name . }
30
42
  OPTIONAL { ?uri schema:alternateName ?schema_alternateName . }
@@ -13,6 +13,10 @@ CONSTRUCT {
13
13
  }
14
14
  WHERE {
15
15
  ?uri ?predicate ?label .
16
+ # Exclude terms from the 'Technische Lijsten', a concept scheme with terms that should only be used by NOB
17
+ FILTER NOT EXISTS {
18
+ ?uri skos:inScheme <https://data.niod.nl/WO2_Thesaurus/11183>
19
+ }
16
20
  VALUES ?predicate { skos:prefLabel skos:altLabel }
17
21
  FILTER(LANG(?label) = "nl")
18
22
  FILTER(CONTAINS(LCASE(?label), LCASE(?query)))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netwerk-digitaal-erfgoed/network-of-terms-catalog",
3
- "version": "5.4.2",
3
+ "version": "5.5.3",
4
4
  "description": "Catalog of Network of Terms datasets",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,14 +30,14 @@
30
30
  "devDependencies": {
31
31
  "@types/jest": "^27.0.1",
32
32
  "@types/n3": "^1.4.3",
33
- "@types/node": "^16.0.0",
33
+ "@types/node": "^17.0.0",
34
34
  "@types/rdf-ext": "^1.3.7",
35
35
  "gts": "^3.0.2",
36
36
  "jest": "^27.0.3",
37
37
  "jsonld-streaming-parser": "^2.1.0",
38
38
  "rdf-data-factory": "^1.0.1",
39
39
  "rdf-ext": "^1.3.0",
40
- "rdf-validate-shacl": "^0.3.1",
40
+ "rdf-validate-shacl": "^0.4.0",
41
41
  "ts-jest": "^27.0.2",
42
42
  "typescript": "^4.0.5"
43
43
  },