From ef97ee7212ac32a0ceb10e394f146d691ddf9f20 Mon Sep 17 00:00:00 2001 From: f-osorio Date: Tue, 31 Dec 2024 08:46:40 -0500 Subject: [PATCH 1/5] Replace property with value for GEO and lang --- .../panels/sidebar_property/Properties.vue | 68 +++++++++++++------ 1 file changed, 46 insertions(+), 22 deletions(-) diff --git a/src/components/panels/sidebar_property/Properties.vue b/src/components/panels/sidebar_property/Properties.vue index 6942d8cd..dfd1bf6e 100644 --- a/src/components/panels/sidebar_property/Properties.vue +++ b/src/components/panels/sidebar_property/Properties.vue @@ -43,28 +43,52 @@ methods: { + replacePropertyWithValue(propertyURI){ + return [ + "http://id.loc.gov/ontologies/bibframe/subject", + "http://id.loc.gov/ontologies/bibframe/geographicCoverage", + "http://id.loc.gov/ontologies/bibframe/language", + ].includes(propertyURI) + }, + returnHeadingLabel(component){ + let propertyURI = null + let prefix = null + if (component){ + propertyURI = component.propertyURI + switch (propertyURI){ + case 'http://id.loc.gov/ontologies/bibframe/subject': + prefix = '[SH]' + break + case 'http://id.loc.gov/ontologies/bibframe/geographicCoverage': + prefix = '[GEO]' + break + case 'http://id.loc.gov/ontologies/bibframe/language': + prefix = '[Lang 008]' + break + default: + prefix = '' + } + } - returnSubjectHeadingLabel(component){ - - let returnString = 'No Heading' - if (component && component.userValue && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'] - && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'].length>0 - && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0] - && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['http://www.w3.org/2000/01/rdf-schema#label'] - && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['http://www.w3.org/2000/01/rdf-schema#label'].length>0 - && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['http://www.w3.org/2000/01/rdf-schema#label'][0] - && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['http://www.w3.org/2000/01/rdf-schema#label'][0]['http://www.w3.org/2000/01/rdf-schema#label']){ - returnString = component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['http://www.w3.org/2000/01/rdf-schema#label'][0]['http://www.w3.org/2000/01/rdf-schema#label'] + let returnString = prefix + ' No Heading' + if (component && component.userValue && component.userValue[propertyURI] + && component.userValue[propertyURI].length>0 + && component.userValue[propertyURI][0] + && component.userValue[propertyURI][0]['http://www.w3.org/2000/01/rdf-schema#label'] + && component.userValue[propertyURI][0]['http://www.w3.org/2000/01/rdf-schema#label'].length>0 + && component.userValue[propertyURI][0]['http://www.w3.org/2000/01/rdf-schema#label'][0] + && component.userValue[propertyURI][0]['http://www.w3.org/2000/01/rdf-schema#label'][0]['http://www.w3.org/2000/01/rdf-schema#label']){ + returnString = prefix + ": " + component.userValue[propertyURI][0]['http://www.w3.org/2000/01/rdf-schema#label'][0]['http://www.w3.org/2000/01/rdf-schema#label'] } - if (component && component.userValue && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'] - && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'].length>0 - && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0] - && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'] - && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'].length>0 - && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'][0] - && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel']){ - returnString = component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'] + if (component && component.userValue && component.userValue[propertyURI] + && component.userValue[propertyURI].length>0 + && component.userValue[propertyURI][0] + && component.userValue[propertyURI][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'] + && component.userValue[propertyURI][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'].length>0 + && component.userValue[propertyURI][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'][0] + && component.userValue[propertyURI][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel']){ + returnString = prefix + ": " + component.userValue[propertyURI][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'] } if (component && component.userValue && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'] @@ -73,7 +97,7 @@ && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['@id'] && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['@id'].indexOf('/fast/') > -1){ - returnString = '(FAST) ' + returnString + returnString = prefix + ': (FAST) ' + returnString } @@ -183,8 +207,8 @@
  • - - [SH]: {{ returnSubjectHeadingLabel(activeProfile.rt[profileName].pt[element]) }} + + {{ returnHeadingLabel(activeProfile.rt[profileName].pt[element]) }} {{activeProfile.rt[profileName].pt[element].propertyLabel}} From 65dd2e50b580c80a5222406909391870eaaba781 Mon Sep 17 00:00:00 2001 From: f-osorio Date: Tue, 31 Dec 2024 09:55:59 -0500 Subject: [PATCH 2/5] Adjust `prefix` --- src/components/panels/edit/fields/Literal.vue | 1 - .../panels/sidebar_property/Properties.vue | 14 +++++++------- src/stores/config.js | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/panels/edit/fields/Literal.vue b/src/components/panels/edit/fields/Literal.vue index 97769b63..3bc08123 100644 --- a/src/components/panels/edit/fields/Literal.vue +++ b/src/components/panels/edit/fields/Literal.vue @@ -347,7 +347,6 @@ export default { }, expandHeightToContent: function(){ - for (let key of Object.keys(this.$refs)){ if (key.startsWith('input_')){ if (this.$refs[key] && this.$refs[key][0]){ diff --git a/src/components/panels/sidebar_property/Properties.vue b/src/components/panels/sidebar_property/Properties.vue index dfd1bf6e..72937600 100644 --- a/src/components/panels/sidebar_property/Properties.vue +++ b/src/components/panels/sidebar_property/Properties.vue @@ -57,20 +57,20 @@ propertyURI = component.propertyURI switch (propertyURI){ case 'http://id.loc.gov/ontologies/bibframe/subject': - prefix = '[SH]' + prefix = '[SH]: ' break case 'http://id.loc.gov/ontologies/bibframe/geographicCoverage': - prefix = '[GEO]' + prefix = '[GEO]: ' break case 'http://id.loc.gov/ontologies/bibframe/language': - prefix = '[Lang 008]' + prefix = '[Lang 008]: ' break default: prefix = '' } } - let returnString = prefix + ' No Heading' + let returnString = prefix + 'No Heading' if (component && component.userValue && component.userValue[propertyURI] && component.userValue[propertyURI].length>0 && component.userValue[propertyURI][0] @@ -78,7 +78,7 @@ && component.userValue[propertyURI][0]['http://www.w3.org/2000/01/rdf-schema#label'].length>0 && component.userValue[propertyURI][0]['http://www.w3.org/2000/01/rdf-schema#label'][0] && component.userValue[propertyURI][0]['http://www.w3.org/2000/01/rdf-schema#label'][0]['http://www.w3.org/2000/01/rdf-schema#label']){ - returnString = prefix + ": " + component.userValue[propertyURI][0]['http://www.w3.org/2000/01/rdf-schema#label'][0]['http://www.w3.org/2000/01/rdf-schema#label'] + returnString = prefix + component.userValue[propertyURI][0]['http://www.w3.org/2000/01/rdf-schema#label'][0]['http://www.w3.org/2000/01/rdf-schema#label'] } if (component && component.userValue && component.userValue[propertyURI] @@ -88,7 +88,7 @@ && component.userValue[propertyURI][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'].length>0 && component.userValue[propertyURI][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'][0] && component.userValue[propertyURI][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel']){ - returnString = prefix + ": " + component.userValue[propertyURI][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'] + returnString = prefix + component.userValue[propertyURI][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'][0]['http://www.loc.gov/mads/rdf/v1#authoritativeLabel'] } if (component && component.userValue && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'] @@ -97,7 +97,7 @@ && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['@id'] && component.userValue['http://id.loc.gov/ontologies/bibframe/subject'][0]['@id'].indexOf('/fast/') > -1){ - returnString = prefix + ': (FAST) ' + returnString + returnString = prefix + '(FAST) ' + returnString } diff --git a/src/stores/config.js b/src/stores/config.js index dd6416de..9466ce80 100644 --- a/src/stores/config.js +++ b/src/stores/config.js @@ -7,7 +7,7 @@ export const useConfigStore = defineStore('config', { versionMajor: 0, versionMinor: 17, - versionPatch: 14, + versionPatch: 15, regionUrls: { From 5e1852233b626add7840cf5ccdfc98c0473b19ec Mon Sep 17 00:00:00 2001 From: f-osorio Date: Tue, 31 Dec 2024 10:06:55 -0500 Subject: [PATCH 3/5] Add GACs to geo coverage in property panel --- .../panels/sidebar_property/Properties.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/panels/sidebar_property/Properties.vue b/src/components/panels/sidebar_property/Properties.vue index 72937600..e4473605 100644 --- a/src/components/panels/sidebar_property/Properties.vue +++ b/src/components/panels/sidebar_property/Properties.vue @@ -100,7 +100,19 @@ returnString = prefix + '(FAST) ' + returnString } - + //For GEO, add the GACs code at the end + if (propertyURI == "http://id.loc.gov/ontologies/bibframe/geographicCoverage"){ + if (component && component.userValue && component.userValue[propertyURI] + && component.userValue[propertyURI].length>0 + && component.userValue[propertyURI][0] + && component.userValue[propertyURI][0]['http://id.loc.gov/ontologies/bibframe/code'] + && component.userValue[propertyURI][0]['http://id.loc.gov/ontologies/bibframe/code'].length>0 + && component.userValue[propertyURI][0]['http://id.loc.gov/ontologies/bibframe/code'][0] + && component.userValue[propertyURI][0]['http://id.loc.gov/ontologies/bibframe/code'][0]['http://id.loc.gov/ontologies/bibframe/code'] + ){ + returnString = returnString + " [" + component.userValue[propertyURI][0]['http://id.loc.gov/ontologies/bibframe/code'][0]['http://id.loc.gov/ontologies/bibframe/code'] + "]" + } + } return returnString From 05f6a3dfbc09aedc6bd941228c0e2812af83f347 Mon Sep 17 00:00:00 2001 From: f-osorio Date: Tue, 31 Dec 2024 10:18:24 -0500 Subject: [PATCH 4/5] Add identifier value to propertyPanel --- .../panels/sidebar_property/Properties.vue | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/components/panels/sidebar_property/Properties.vue b/src/components/panels/sidebar_property/Properties.vue index e4473605..21b688f3 100644 --- a/src/components/panels/sidebar_property/Properties.vue +++ b/src/components/panels/sidebar_property/Properties.vue @@ -48,6 +48,7 @@ "http://id.loc.gov/ontologies/bibframe/subject", "http://id.loc.gov/ontologies/bibframe/geographicCoverage", "http://id.loc.gov/ontologies/bibframe/language", + "http://id.loc.gov/ontologies/bibframe/identifiedBy", ].includes(propertyURI) }, returnHeadingLabel(component){ @@ -65,11 +66,19 @@ case 'http://id.loc.gov/ontologies/bibframe/language': prefix = '[Lang 008]: ' break + case 'http://id.loc.gov/ontologies/bibframe/identifiedBy': + if (component.userValue && component.userValue[propertyURI]){ + let type = component.userValue[propertyURI][0]["@type"] + prefix = type.split("/").at(-1).toUpperCase() + ': ' + break + } default: prefix = '' } } + console.info("component: ", component) + let returnString = prefix + 'No Heading' if (component && component.userValue && component.userValue[propertyURI] && component.userValue[propertyURI].length>0 @@ -100,6 +109,18 @@ returnString = prefix + '(FAST) ' + returnString } + //identifiers have slightly different pat + if (component && component.userValue && component.userValue[propertyURI] + && component.userValue[propertyURI].length>0 + && component.userValue[propertyURI][0] + && component.userValue[propertyURI][0]['http://www.w3.org/1999/02/22-rdf-syntax-ns#value'] + && component.userValue[propertyURI][0]['http://www.w3.org/1999/02/22-rdf-syntax-ns#value'].length>0 + && component.userValue[propertyURI][0]['http://www.w3.org/1999/02/22-rdf-syntax-ns#value'][0] + && component.userValue[propertyURI][0]['http://www.w3.org/1999/02/22-rdf-syntax-ns#value'][0]['http://www.w3.org/1999/02/22-rdf-syntax-ns#value'] + ){ + returnString = prefix + component.userValue[propertyURI][0]['http://www.w3.org/1999/02/22-rdf-syntax-ns#value'][0]['http://www.w3.org/1999/02/22-rdf-syntax-ns#value'] + } + //For GEO, add the GACs code at the end if (propertyURI == "http://id.loc.gov/ontologies/bibframe/geographicCoverage"){ if (component && component.userValue && component.userValue[propertyURI] From f2ee9637dc7a141712002e50cd8cadb1a2c8c89e Mon Sep 17 00:00:00 2001 From: f-osorio Date: Tue, 31 Dec 2024 10:32:40 -0500 Subject: [PATCH 5/5] Match identifier prefix to the others Wrapped in square brackets --- src/components/panels/sidebar_property/Properties.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/panels/sidebar_property/Properties.vue b/src/components/panels/sidebar_property/Properties.vue index 21b688f3..9e1b3c25 100644 --- a/src/components/panels/sidebar_property/Properties.vue +++ b/src/components/panels/sidebar_property/Properties.vue @@ -69,7 +69,7 @@ case 'http://id.loc.gov/ontologies/bibframe/identifiedBy': if (component.userValue && component.userValue[propertyURI]){ let type = component.userValue[propertyURI][0]["@type"] - prefix = type.split("/").at(-1).toUpperCase() + ': ' + prefix = '[' + type.split("/").at(-1).toUpperCase() + ']: ' break } default: @@ -77,8 +77,6 @@ } } - console.info("component: ", component) - let returnString = prefix + 'No Heading' if (component && component.userValue && component.userValue[propertyURI] && component.userValue[propertyURI].length>0