diff --git a/productMods/config/listViewConfig-mailingAddress.xml b/productMods/config/listViewConfig-mailingAddress.xml index bcd2c583..207b96a5 100644 --- a/productMods/config/listViewConfig-mailingAddress.xml +++ b/productMods/config/listViewConfig-mailingAddress.xml @@ -11,20 +11,23 @@ SELECT DISTINCT ?subclass ?address + ?localName ?label ?street ?city ?state ?postalCode - ?country WHERE { + ?country + + WHERE { ?subject ?property ?address + LET ( ?localName := afn:localname(?address) ) OPTIONAL { ?address rdfs:label ?label } OPTIONAL { ?address core:addressStreet ?street } OPTIONAL { ?address core:addressCity ?city } OPTIONAL { ?address core:addressState ?state } OPTIONAL { ?address core:addressPostalCode ?postalCode } - OPTIONAL { ?address core:addressCountry ?country } - + OPTIONAL { ?address core:addressCountry ?country } OPTIONAL { ?address a ?subclass . ?subclass rdfs:subClassOf core:Address diff --git a/productMods/config/listViewConfig-terminologyAnnotation.xml b/productMods/config/listViewConfig-terminologyAnnotation.xml index 67a32514..36e5964f 100644 --- a/productMods/config/listViewConfig-terminologyAnnotation.xml +++ b/productMods/config/listViewConfig-terminologyAnnotation.xml @@ -15,31 +15,8 @@ ?terminologyContextNode core:entryTerm ?entryTerm . ?terminologyContextNode core:termLabel ?termLabel . ?terminologyContextNode core:termType ?termType . - } ORDER BY ?termLabel - - + } ORDER BY ?termLabel - - PREFIX core: <http://vivoweb.org/ontology/core#> - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> - CONSTRUCT { - ?subject ?property ?terminologyContextNode . - ?terminologyContextNode core:referencedTerm ?referencedTerm . - ?terminologyContextNode core:entryTerm ?entryTerm . - ?terminologyContextNode core:termLabel ?termLabel . - ?terminologyContextNode core:termType ?termType . - } WHERE { - - ?subject ?property ?terminologyContextNode . - ?terminologyContextNode core:referencedTerm ?referencedTerm . - ?terminologyContextNode core:entryTerm ?entryTerm . - ?terminologyContextNode core:termLabel ?termLabel . - ?terminologyContextNode core:termType ?termType . - } - - - - diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-mailingAddress.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-mailingAddress.ftl index 8fa6831c..4dc1472b 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-mailingAddress.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-mailingAddress.ftl @@ -10,29 +10,47 @@ <#-- Use a macro to keep variable assignments local; otherwise the values carry over to the next statement --> - <#macro showAddress statement> - - <#-- Pre-1.4 addresses may only have an rdfs:label, so display that when --> - <#-- there's no street number. --> - <#if statement.street??> -
+<#macro showAddress statement> + + <#if ( statement.street?has_content || statement.city?has_content || statement.state?has_content || + statement.postalCode?has_content || statement.country?has_content )> + +
+ <#if statement.street?has_content>
${statement.street}
- <#-- If the subclass is core:US Postal Address, or if the country is --> - <#-- the US, display the city, state, and postal code on a single line. --> - <#local cityStateZip><@s.join [ statement.city!, statement.state!, statement.postalCode!], " " /> - <#if ( statement.subclass?? && statement.subclass?contains("USPostalAddress") ) || ( statement.country?? && statement.country?contains("United States") ) > - <#if cityStateZip?has_content> -
${cityStateZip}
- - <#else> -
${statement.city!}
- <#if statement.state??>
${statement.state}
- <#if statement.postalCode??>
${statement.postalCode}
- - <#if statement.country??>
${statement.country}
-
- <#else> - ${statement.label!} - + + + <#-- If the subclass is core:US Postal Address, or if the country is + the US, display the city, state, and postal code on a single line. --> + <#if ( statement.subclass?? && statement.subclass?contains("USPostalAddress") ) || + ( statement.country?? && ( statement.country?contains("United States") || + statement.country == "US" || + statement.country == "USA" ) )> + <#local cityState><@s.join [statement.city!, statement.state!], ", " /> + <#local cityStateZip><@s.join [ cityState!, statement.postalCode!], " " /> + <#if cityStateZip?has_content> +
${cityStateZip}
+ + <#else> +
${statement.city!}
+ <#if statement.state?has_content>
${statement.state}
+ <#if statement.postalCode?has_content>
${statement.postalCode}
+ + + <#if statement.country?has_content> +
${statement.country}
+ +
- \ No newline at end of file + <#-- Pre-1.4 addresses may only have an rdfs:label, since users using the default + object property form sometimes entered the entire address as the label. Display that when + there's no address data. --> + <#elseif statement.editable> + <#-- This can be removed when the custom form is available. Until then, provide a link to the + address profile so the data can be edited. --> + ${statement.label!statement.localName} + <#else> + ${statement.label!} + + + \ No newline at end of file