Skip to content

Commit

Permalink
feat: Parameterize results limit
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeboer committed Dec 20, 2024
1 parent 644acf1 commit af127a8
Show file tree
Hide file tree
Showing 42 changed files with 638 additions and 441 deletions.
8 changes: 4 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export default {
],
coverageThreshold: {
global: {
lines: 91.41,
statements: 91.41,
branches: 92.62,
functions: 90.9,
lines: 91.5,
statements: 91.5,
branches: 92.65,
functions: 91,
},
},
transform: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,47 @@ CONSTRUCT {
?exactMatch_uri skos:prefLabel ?exactMatch_prefLabel .
}
WHERE {
SELECT * WHERE {
?uri luc:term ?query ;
a ?type ;
void:inDataset <http://vocab.getty.edu/dataset/aat> ;
gvp:broaderPreferred+ <http://vocab.getty.edu/aat/300010357> . # limit results to the "materials hierarchy name" (300010357)

?type rdfs:subClassOf gvp:Subject .
FILTER (?type != gvp:Subject) .
?uri skosxl:prefLabel ?prefLabel_uri .
?prefLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?prefLabel_uri skosxl:literalForm ?prefLabel .
OPTIONAL {
?uri skosxl:altLabel ?altLabel_uri .
?altLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?altLabel_uri skosxl:literalForm ?altLabel .
}
OPTIONAL {
?uri skos:scopeNote ?scopeNote_uri .
?scopeNote_uri dcterms:language aat:300388256 . # Dutch (language)
?scopeNote_uri rdf:value ?scopeNote .
}
OPTIONAL {
?uri rdfs:seeAlso ?rdfs_seeAlso
}
OPTIONAL {
?uri gvp:broaderPreferred ?broader_uri .
?broader_uri skosxl:prefLabel ?broader_uri_skosxl .
?broader_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?broader_uri_skosxl skosxl:literalForm ?broader_prefLabel .
}
OPTIONAL {
?uri skos:narrower ?narrower_uri .
?narrower_uri skosxl:prefLabel ?narrower_uri_skosxl .
?narrower_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?narrower_uri_skosxl skosxl:literalForm ?narrower_prefLabel .
}
OPTIONAL {
?uri skos:exactMatch ?exactMatch_uri . # Has no labels.
FILTER(?exactMatch_uri != ?uri) # Exclude self-reference.
{
SELECT * WHERE {
?uri luc:term ?query ;
a ?type ;
void:inDataset <http://vocab.getty.edu/dataset/aat> ;
gvp:broaderPreferred+ <http://vocab.getty.edu/aat/300010357> . # limit results to the "materials hierarchy name" (300010357)
?type rdfs:subClassOf gvp:Subject .
FILTER (?type != gvp:Subject) .
?uri skosxl:prefLabel ?prefLabel_uri .
?prefLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?prefLabel_uri skosxl:literalForm ?prefLabel .
}
#LIMIT#
}
OPTIONAL {
?uri skosxl:altLabel ?altLabel_uri .
?altLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?altLabel_uri skosxl:literalForm ?altLabel .
}
OPTIONAL {
?uri skos:scopeNote ?scopeNote_uri .
?scopeNote_uri dcterms:language aat:300388256 . # Dutch (language)
?scopeNote_uri rdf:value ?scopeNote .
}
OPTIONAL {
?uri rdfs:seeAlso ?rdfs_seeAlso
}
OPTIONAL {
?uri gvp:broaderPreferred ?broader_uri .
?broader_uri skosxl:prefLabel ?broader_uri_skosxl .
?broader_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?broader_uri_skosxl skosxl:literalForm ?broader_prefLabel .
}
OPTIONAL {
?uri skos:narrower ?narrower_uri .
?narrower_uri skosxl:prefLabel ?narrower_uri_skosxl .
?narrower_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?narrower_uri_skosxl skosxl:literalForm ?narrower_prefLabel .
}
OPTIONAL {
?uri skos:exactMatch ?exactMatch_uri . # Has no labels.
FILTER(?exactMatch_uri != ?uri) # Exclude self-reference.
}
LIMIT 1000
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,47 @@ CONSTRUCT {
?narrower_uri skos:prefLabel ?narrower_prefLabel .
}
WHERE {
SELECT * WHERE {
?uri luc:term ?query ;
a ?type ;
void:inDataset <http://vocab.getty.edu/dataset/aat> ;
gvp:broaderPreferred+ <http://vocab.getty.edu/aat/300053001> . # limit results to the "processes and techniques hierarchy name (300053001)"

?type rdfs:subClassOf gvp:Subject .
FILTER (?type != gvp:Subject) .
?uri skosxl:prefLabel ?prefLabel_uri .
?prefLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?prefLabel_uri skosxl:literalForm ?prefLabel .
OPTIONAL {
?uri skosxl:altLabel ?altLabel_uri .
?altLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?altLabel_uri skosxl:literalForm ?altLabel .
}
OPTIONAL {
?uri skos:scopeNote ?scopeNote_uri .
?scopeNote_uri dcterms:language aat:300388256 . # Dutch (language)
?scopeNote_uri rdf:value ?scopeNote .
}
OPTIONAL {
?uri rdfs:seeAlso ?rdfs_seeAlso
}
OPTIONAL {
?uri gvp:broaderPreferred ?broader_uri .
?broader_uri skosxl:prefLabel ?broader_uri_skosxl .
?broader_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?broader_uri_skosxl skosxl:literalForm ?broader_prefLabel .
}
OPTIONAL {
?uri skos:narrower ?narrower_uri .
?narrower_uri skosxl:prefLabel ?narrower_uri_skosxl .
?narrower_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?narrower_uri_skosxl skosxl:literalForm ?narrower_prefLabel .
}
OPTIONAL {
?uri skos:exactMatch ?exactMatch_uri . # Has no labels.
FILTER(?exactMatch_uri != ?uri) # Exclude self-reference.
{
SELECT * WHERE {
?uri luc:term ?query ;
a ?type ;
void:inDataset <http://vocab.getty.edu/dataset/aat> ;
gvp:broaderPreferred+ <http://vocab.getty.edu/aat/300053001> . # limit results to the "processes and techniques hierarchy name (300053001)"
?type rdfs:subClassOf gvp:Subject .
FILTER (?type != gvp:Subject) .
?uri skosxl:prefLabel ?prefLabel_uri .
?prefLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?prefLabel_uri skosxl:literalForm ?prefLabel .
}
#LIMIT#
}
OPTIONAL {
?uri skosxl:altLabel ?altLabel_uri .
?altLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?altLabel_uri skosxl:literalForm ?altLabel .
}
OPTIONAL {
?uri skos:scopeNote ?scopeNote_uri .
?scopeNote_uri dcterms:language aat:300388256 . # Dutch (language)
?scopeNote_uri rdf:value ?scopeNote .
}
OPTIONAL {
?uri rdfs:seeAlso ?rdfs_seeAlso
}
OPTIONAL {
?uri gvp:broaderPreferred ?broader_uri .
?broader_uri skosxl:prefLabel ?broader_uri_skosxl .
?broader_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?broader_uri_skosxl skosxl:literalForm ?broader_prefLabel .
}
OPTIONAL {
?uri skos:narrower ?narrower_uri .
?narrower_uri skosxl:prefLabel ?narrower_uri_skosxl .
?narrower_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?narrower_uri_skosxl skosxl:literalForm ?narrower_prefLabel .
}
OPTIONAL {
?uri skos:exactMatch ?exactMatch_uri . # Has no labels.
FILTER(?exactMatch_uri != ?uri) # Exclude self-reference.
}
LIMIT 1000
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,48 +21,47 @@ CONSTRUCT {
?narrower_uri skos:prefLabel ?narrower_prefLabel .
}
WHERE {
SELECT * WHERE {
?uri luc:term ?query ;
a ?type ;
void:inDataset <http://vocab.getty.edu/dataset/aat> .

# limit results to the "styles and periodes hierarchy name (300015646)"
?uri gvp:broaderPreferred+ <http://vocab.getty.edu/aat/300015646> .

?type rdfs:subClassOf gvp:Subject .
FILTER (?type != gvp:Subject) .
?uri skosxl:prefLabel ?prefLabel_uri .
?prefLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?prefLabel_uri skosxl:literalForm ?prefLabel .
OPTIONAL {
?uri skosxl:altLabel ?altLabel_uri .
?altLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?altLabel_uri skosxl:literalForm ?altLabel .
}
OPTIONAL {
?uri skos:scopeNote ?scopeNote_uri .
?scopeNote_uri dcterms:language aat:300388256 . # Dutch (language)
?scopeNote_uri rdf:value ?scopeNote .
}
OPTIONAL {
?uri rdfs:seeAlso ?rdfs_seeAlso
}
OPTIONAL {
?uri gvp:broaderPreferred ?broader_uri .
?broader_uri skosxl:prefLabel ?broader_uri_skosxl .
?broader_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?broader_uri_skosxl skosxl:literalForm ?broader_prefLabel .
}
OPTIONAL {
?uri skos:narrower ?narrower_uri .
?narrower_uri skosxl:prefLabel ?narrower_uri_skosxl .
?narrower_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?narrower_uri_skosxl skosxl:literalForm ?narrower_prefLabel .
}
OPTIONAL {
?uri skos:exactMatch ?exactMatch_uri . # Has no labels.
FILTER(?exactMatch_uri != ?uri) # Exclude self-reference.
{
SELECT * WHERE {
?uri luc:term ?query ;
a ?type ;
void:inDataset <http://vocab.getty.edu/dataset/aat> ;
gvp:broaderPreferred+ <http://vocab.getty.edu/aat/300015646> . # limit results to the "styles and periodes hierarchy name (300015646)"
?type rdfs:subClassOf gvp:Subject .
FILTER (?type != gvp:Subject) .
?uri skosxl:prefLabel ?prefLabel_uri .
?prefLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?prefLabel_uri skosxl:literalForm ?prefLabel .
}
#LIMIT#
}
OPTIONAL {
?uri skosxl:altLabel ?altLabel_uri .
?altLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?altLabel_uri skosxl:literalForm ?altLabel .
}
OPTIONAL {
?uri skos:scopeNote ?scopeNote_uri .
?scopeNote_uri dcterms:language aat:300388256 . # Dutch (language)
?scopeNote_uri rdf:value ?scopeNote .
}
OPTIONAL {
?uri rdfs:seeAlso ?rdfs_seeAlso
}
OPTIONAL {
?uri gvp:broaderPreferred ?broader_uri .
?broader_uri skosxl:prefLabel ?broader_uri_skosxl .
?broader_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?broader_uri_skosxl skosxl:literalForm ?broader_prefLabel .
}
OPTIONAL {
?uri skos:narrower ?narrower_uri .
?narrower_uri skosxl:prefLabel ?narrower_uri_skosxl .
?narrower_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?narrower_uri_skosxl skosxl:literalForm ?narrower_prefLabel .
}
OPTIONAL {
?uri skos:exactMatch ?exactMatch_uri . # Has no labels.
FILTER(?exactMatch_uri != ?uri) # Exclude self-reference.
}
LIMIT 1000
}
82 changes: 42 additions & 40 deletions packages/network-of-terms-catalog/catalog/queries/search/aat.rq
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,48 @@ CONSTRUCT {
?exactMatch_uri skos:prefLabel ?exactMatch_prefLabel .
}
WHERE {
SELECT * WHERE {
?uri luc:term ?query ;
a ?type ;
void:inDataset <http://vocab.getty.edu/dataset/aat> .
?type rdfs:subClassOf gvp:Subject .
FILTER (?type != gvp:Subject) .
?uri skosxl:prefLabel ?prefLabel_uri .
?prefLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?prefLabel_uri skosxl:literalForm ?prefLabel .
OPTIONAL {
?uri skosxl:altLabel ?altLabel_uri .
?altLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?altLabel_uri skosxl:literalForm ?altLabel .
}
OPTIONAL {
?uri skos:scopeNote ?scopeNote_uri .
?scopeNote_uri dcterms:language aat:300388256 . # Dutch (language)
?scopeNote_uri rdf:value ?scopeNote .
}
OPTIONAL {
?uri rdfs:seeAlso ?rdfs_seeAlso
}
OPTIONAL {
?uri gvp:broaderPreferred ?broader_uri .
?broader_uri skosxl:prefLabel ?broader_uri_skosxl .
?broader_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?broader_uri_skosxl skosxl:literalForm ?broader_prefLabel .
}
OPTIONAL {
?uri skos:narrower ?narrower_uri .
?narrower_uri skosxl:prefLabel ?narrower_uri_skosxl .
?narrower_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?narrower_uri_skosxl skosxl:literalForm ?narrower_prefLabel .
}
OPTIONAL {
?uri skos:exactMatch ?exactMatch_uri .
?exactMatch_uri skosxl:prefLabel ?exactMatch_uri_skosxl .
?exactMatch_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?exactMatch_uri_skosxl skosxl:literalForm ?exactMatch_prefLabel .
{
SELECT * WHERE {
?uri luc:term ?query ;
a ?type ;
void:inDataset <http://vocab.getty.edu/dataset/aat> .
?type rdfs:subClassOf gvp:Subject .
FILTER (?type != gvp:Subject) .
?uri skosxl:prefLabel ?prefLabel_uri .
?prefLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?prefLabel_uri skosxl:literalForm ?prefLabel .
}
#LIMIT#
}
OPTIONAL {
?uri skosxl:altLabel ?altLabel_uri .
?altLabel_uri dcterms:language aat:300388256 . # Dutch (language)
?altLabel_uri skosxl:literalForm ?altLabel .
}
OPTIONAL {
?uri skos:scopeNote ?scopeNote_uri .
?scopeNote_uri dcterms:language aat:300388256 . # Dutch (language)
?scopeNote_uri rdf:value ?scopeNote .
}
OPTIONAL {
?uri rdfs:seeAlso ?rdfs_seeAlso
}
OPTIONAL {
?uri gvp:broaderPreferred ?broader_uri .
?broader_uri skosxl:prefLabel ?broader_uri_skosxl .
?broader_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?broader_uri_skosxl skosxl:literalForm ?broader_prefLabel .
}
OPTIONAL {
?uri skos:narrower ?narrower_uri .
?narrower_uri skosxl:prefLabel ?narrower_uri_skosxl .
?narrower_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?narrower_uri_skosxl skosxl:literalForm ?narrower_prefLabel .
}
OPTIONAL {
?uri skos:exactMatch ?exactMatch_uri .
?exactMatch_uri skosxl:prefLabel ?exactMatch_uri_skosxl .
?exactMatch_uri_skosxl dcterms:language aat:300388256 . # Dutch (language)
?exactMatch_uri_skosxl skosxl:literalForm ?exactMatch_prefLabel .
}
LIMIT 1000
}
Loading

0 comments on commit af127a8

Please sign in to comment.