Skip to content

Commit

Permalink
feat: Exclude RCE referentienetwerk matches from CHT (#1243)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeboer authored Feb 22, 2024
1 parent 575c2d3 commit b8dbc09
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/network-of-terms-catalog/catalog/datasets/cht.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"potentialAction": [
{
"@type": "SearchAction",
"query": "file://catalog/queries/search/poolparty.rq"
"query": "file://catalog/queries/search/cht.rq"
},
{
"@type": "FindAction",
"query": "file://catalog/queries/lookup/poolparty.rq"
"query": "file://catalog/queries/lookup/cht.rq"
},
{
"@type": "Action",
Expand Down
66 changes: 66 additions & 0 deletions packages/network-of-terms-catalog/catalog/queries/lookup/cht.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

CONSTRUCT {
?uri a skos:Concept ;
skos:prefLabel ?prefLabel ;
skos:altLabel ?altLabel ;
skos:hiddenLabel ?hiddenLabel ;
skos:scopeNote ?scopeNote ;
skos:broader ?broader_uri ;
skos:narrower ?narrower_uri ;
skos:related ?related_uri ;
skos:exactMatch ?exactMatch_uri .
?broader_uri skos:prefLabel ?broader_prefLabel .
?narrower_uri skos:prefLabel ?narrower_prefLabel .
?related_uri skos:prefLabel ?related_prefLabel .
?exactMatch_uri skos:prefLabel ?exactMatch_prefLabel .
}
WHERE {
# For example:
# Aardewerk: <https://data.cultureelerfgoed.nl/term/id/abr/71e411bf-8645-4420-98a4-b8746574b002>
# Aardewerk: <https://data.cultureelerfgoed.nl/term/id/cht/dfbf8107-09f9-49c9-8118-8e79b7613723>
VALUES ?uri { ?uris }

?uri a skos:Concept .

OPTIONAL {
?uri skos:prefLabel ?prefLabel .
FILTER(LANG(?prefLabel) = "nl")
}
OPTIONAL {
?uri skos:altLabel ?altLabel .
FILTER(LANG(?altLabel) = "nl")
}
OPTIONAL {
?uri skos:hiddenLabel ?hiddenLabel .
FILTER(LANG(?hiddenLabel) = "nl")
}
OPTIONAL {
?uri skos:scopeNote ?scopeNote .
FILTER(LANG(?scopeNote) = "nl")
}
OPTIONAL {
?uri skos:broader ?broader_uri .
?broader_uri skos:prefLabel ?broader_prefLabel .
FILTER(LANG(?broader_prefLabel) = "nl")
}
OPTIONAL {
?uri skos:narrower ?narrower_uri .
?narrower_uri skos:prefLabel ?narrower_prefLabel .
FILTER(LANG(?narrower_prefLabel) = "nl")
}
OPTIONAL {
?uri skos:related ?related_uri .
?related_uri skos:prefLabel ?related_prefLabel .
FILTER(LANG(?related_prefLabel) = "nl")
}
OPTIONAL {
?uri skos:exactMatch ?exactMatch_uri .
FILTER(!STRSTARTS(STR(?exactMatch_uri), "https://data.cultureelerfgoed.nl/term/id/rn"))
OPTIONAL {
?exactMatch_uri skos:prefLabel ?exactMatch_prefLabel .
FILTER(LANG(?exactMatch_prefLabel) = "nl")
}
}
}
LIMIT 1000
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ WHERE {
}
OPTIONAL {
?uri skos:exactMatch ?exactMatch_uri .
FILTER(!STRSTARTS(STR(?exactMatch_uri), "https://data.cultureelerfgoed.nl/term/id/rn"))
OPTIONAL {
?exactMatch_uri skos:prefLabel ?exactMatch_prefLabel .
FILTER(LANG(?exactMatch_prefLabel) = "nl")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ WHERE {
}
OPTIONAL {
?uri skos:exactMatch ?exactMatch_uri .
FILTER(!STRSTARTS(STR(?exactMatch_uri), "https://data.cultureelerfgoed.nl/term/id/rn"))
OPTIONAL {
?exactMatch_uri skos:prefLabel ?exactMatch_prefLabel .
FILTER(LANG(?exactMatch_prefLabel) = "nl")
Expand Down
63 changes: 63 additions & 0 deletions packages/network-of-terms-catalog/catalog/queries/search/cht.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

CONSTRUCT {
?uri a skos:Concept ;
skos:prefLabel ?prefLabel ;
skos:altLabel ?altLabel ;
skos:hiddenLabel ?hiddenLabel ;
skos:scopeNote ?scopeNote ;
skos:broader ?broader_uri ;
skos:narrower ?narrower_uri ;
skos:related ?related_uri ;
skos:exactMatch ?exactMatch_uri .
?broader_uri skos:prefLabel ?broader_prefLabel .
?narrower_uri skos:prefLabel ?narrower_prefLabel .
?related_uri skos:prefLabel ?related_prefLabel .
?exactMatch_uri skos:prefLabel ?exactMatch_prefLabel .
}
WHERE {
?uri ?predicate ?label .
VALUES ?predicate { skos:prefLabel skos:altLabel }
FILTER(LANG(?label) = "nl")
FILTER(CONTAINS(LCASE(?label), LCASE(?query)))
OPTIONAL {
?uri skos:prefLabel ?prefLabel .
FILTER(LANG(?prefLabel) = "nl")
}
OPTIONAL {
?uri skos:altLabel ?altLabel .
FILTER(LANG(?altLabel) = "nl")
}
OPTIONAL {
?uri skos:hiddenLabel ?hiddenLabel .
FILTER(LANG(?hiddenLabel) = "nl")
}
OPTIONAL {
?uri skos:scopeNote ?scopeNote .
FILTER(LANG(?scopeNote) = "nl")
}
OPTIONAL {
?uri skos:broader ?broader_uri .
?broader_uri skos:prefLabel ?broader_prefLabel .
FILTER(LANG(?broader_prefLabel) = "nl")
}
OPTIONAL {
?uri skos:narrower ?narrower_uri .
?narrower_uri skos:prefLabel ?narrower_prefLabel .
FILTER(LANG(?narrower_prefLabel) = "nl")
}
OPTIONAL {
?uri skos:related ?related_uri .
?related_uri skos:prefLabel ?related_prefLabel .
FILTER(LANG(?related_prefLabel) = "nl")
}
OPTIONAL {
?uri skos:exactMatch ?exactMatch_uri .
FILTER(!STRSTARTS(STR(?exactMatch_uri), "https://data.cultureelerfgoed.nl/term/id/rn"))
OPTIONAL {
?exactMatch_uri skos:prefLabel ?exactMatch_prefLabel .
FILTER(LANG(?exactMatch_prefLabel) = "nl")
}
}
}
LIMIT 1000

0 comments on commit b8dbc09

Please sign in to comment.