Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Parameterize results limit #1479

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading