Skip to content

Commit

Permalink
Add ied.rq queries (#1266)
Browse files Browse the repository at this point in the history
Replace poolparty.rq with ied.rq to exclude technical lists from search and lookup

Co-authored-by: RubenSchalk <[email protected]>
  • Loading branch information
rschalkrce and RubenSchalk authored Mar 15, 2024
1 parent 6a6904d commit 494881b
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/network-of-terms-catalog/catalog/datasets/ied.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/ied.rq"
},
{
"@type": "FindAction",
"query": "file://catalog/queries/lookup/poolparty.rq"
"query": "file://catalog/queries/lookup/ied.rq"
},
{
"@type": "Action",
Expand Down
58 changes: 58 additions & 0 deletions packages/network-of-terms-catalog/catalog/queries/lookup/ied.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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:exactMatch ?exactMatch_uri .
?broader_uri skos:prefLabel ?broader_prefLabel .
?narrower_uri skos:prefLabel ?narrower_prefLabel .
}
WHERE {
# For example:
# Concept: <https://data.indischherinneringscentrum.nl/ied/110950>
# Event: <https://data.indischherinneringscentrum.nl/ied/110991>
# Organization: <https://data.indischherinneringscentrum.nl/ied/103996>
VALUES ?uri { ?uris }

?uri a skos:Concept .

# Exclude terms from the 'Technische Lijsten', a concept scheme with terms that should only be used by NOB
FILTER NOT EXISTS {
?uri skos:inScheme <https://data.indischherinneringscentrum.nl/ied/100616>
}
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:exactMatch ?exactMatch_uri . # Has no labels.
}
}
LIMIT 1000
54 changes: 54 additions & 0 deletions packages/network-of-terms-catalog/catalog/queries/search/ied.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
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:exactMatch ?exactMatch_uri .
?broader_uri skos:prefLabel ?broader_prefLabel .
?narrower_uri skos:prefLabel ?narrower_prefLabel .
}
WHERE {
?uri ?predicate ?label .
# Exclude terms from the 'Technische Lijsten', a concept scheme with terms that should only be used by NOB
FILTER NOT EXISTS {
?uri skos:inScheme <https://data.indischherinneringscentrum.nl/ied/100616>
}
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:scopeNote ?scopeNote .
FILTER(LANG(?scopeNote) = "nl")
}
OPTIONAL {
?uri skos:altLabel ?altLabel .
FILTER(LANG(?altLabel) = "nl")
}
OPTIONAL {
?uri skos:hiddenLabel ?hiddenLabel .
FILTER(LANG(?hiddenLabel) = "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:exactMatch ?exactMatch_uri . # Has no labels.
}
}
LIMIT 1000

0 comments on commit 494881b

Please sign in to comment.