From 78e6506975ece7eae664ae57698607835fe443c5 Mon Sep 17 00:00:00 2001 From: Stefan Peters Date: Thu, 26 Oct 2023 11:39:02 +0200 Subject: [PATCH] Mapping Search: Translate notations into URIs if possible (#721) --- src/components/MappingBrowser.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/MappingBrowser.vue b/src/components/MappingBrowser.vue index 518f3835..4e14affd 100644 --- a/src/components/MappingBrowser.vue +++ b/src/components/MappingBrowser.vue @@ -1347,11 +1347,25 @@ export default { this.$set(this.searchPages, registry.uri, page) this.$set(this.searchLoading, registry.uri, true) - const getMappings = () => this.getMappings({ + const schemeAndConceptFilters = { from: this.searchFilter.fromNotation, to: this.searchFilter.toNotation, fromScheme: this.getSchemeForFilter(this.searchFilter.fromScheme), toScheme: this.getSchemeForFilter(this.searchFilter.toScheme), + } + for (const side of ["from", "to"]) { + let scheme = schemeAndConceptFilters[`${side}Scheme`] + if (!scheme || !schemeAndConceptFilters[side]) { + continue + } + scheme = new this.$jskos.ConceptScheme(schemeAndConceptFilters[`${side}Scheme`]) + if (scheme?.uriPattern) { + schemeAndConceptFilters[side] = schemeAndConceptFilters[side].split("|").map(notation => scheme.uriFromNotation(notation) || notation).join("|") + } + } + + const getMappings = () => this.getMappings({ + ...schemeAndConceptFilters, creator: this.searchFilter.creator, type: this.searchFilter.type, direction: this.searchFilter.direction,