@netwerk-digitaal-erfgoed/network-of-terms-catalog 5.4.1 → 5.5.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.
@@ -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 }
@@ -7,7 +7,8 @@ CONSTRUCT {
7
7
  skos:prefLabel ?schema_name ;
8
8
  skos:altLabel ?schema_alternateName ;
9
9
  skos:scopeNote ?schema_description ;
10
- rdfs:seeAlso ?rdfs_seeAlso .
10
+ # commented the following lines as a temporary fix
11
+ # rdfs:seeAlso ?rdfs_seeAlso .
11
12
  }
12
13
  WHERE {
13
14
  ?uri a ?type .
@@ -15,20 +16,34 @@ WHERE {
15
16
  ?uri ?name ?label .
16
17
  VALUES ?name { schema:name schema:alternateName }
17
18
 
18
- # Replace query "A B" with "A AND B", leaving queries "A AND B" or "A OR B" unchanged.
19
- FILTER (<bif:contains> (?label,
20
- REPLACE(
21
- REPLACE(?query, "[.,]", " "),
22
- "(?<!AND)(?<!OR)[[:space:]]+(?!AND)(?!OR)(?!$)(?![[:space:]])",
23
- " AND ",
24
- "i"
25
- )
26
- ))
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
+ }
27
40
 
28
41
  OPTIONAL { ?uri schema:name ?schema_name . }
29
42
  OPTIONAL { ?uri schema:alternateName ?schema_alternateName . }
30
43
  OPTIONAL { ?uri schema:description ?schema_description . }
31
- BIND(STRAFTER(STR(?uri), "https://data.rkd.nl/artists/") AS ?identifier)
32
- BIND(IRI(CONCAT("https://rkd.nl/explore/artists/", ?identifier)) AS ?rdfs_seeAlso)
44
+
45
+ # commented the following lines as a temporary fix
46
+ #BIND(STRAFTER(STR(?uri), "https://data.rkd.nl/artists/") AS ?identifier)
47
+ #BIND(IRI(CONCAT("https://rkd.nl/explore/artists/", ?identifier)) AS ?rdfs_seeAlso)
33
48
  }
34
49
  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.4.1",
3
+ "version": "5.5.2",
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
  },