Improvements to mailing address list view. Removed unnecessary construct query from terminologyAnnotation list view.
This commit is contained in:
parent
1c4d73da07
commit
cd75ae68bb
3 changed files with 49 additions and 51 deletions
|
@ -11,13 +11,17 @@
|
|||
|
||||
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 }
|
||||
|
@ -25,7 +29,6 @@
|
|||
OPTIONAL { ?address core:addressPostalCode ?postalCode }
|
||||
OPTIONAL { ?address core:addressCountry ?country }
|
||||
|
||||
|
||||
OPTIONAL { ?address a ?subclass .
|
||||
?subclass rdfs:subClassOf core:Address
|
||||
}
|
||||
|
|
|
@ -16,30 +16,7 @@
|
|||
?terminologyContextNode core:termLabel ?termLabel .
|
||||
?terminologyContextNode core:termType ?termType .
|
||||
} ORDER BY ?termLabel
|
||||
|
||||
|
||||
</query-select>
|
||||
|
||||
<query-construct>
|
||||
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 .
|
||||
}
|
||||
</query-construct>
|
||||
|
||||
|
||||
|
||||
<template>propStatement-terminologyAnnotation.ftl</template>
|
||||
</list-view-config>
|
||||
|
|
|
@ -12,27 +12,45 @@
|
|||
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??>
|
||||
<#if ( statement.street?has_content || statement.city?has_content || statement.state?has_content ||
|
||||
statement.postalCode?has_content || statement.country?has_content )>
|
||||
|
||||
<div class="adr">
|
||||
<#if statement.street?has_content>
|
||||
<div class="street-address">${statement.street}</div>
|
||||
<#-- 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!], " " /></#local>
|
||||
<#if ( statement.subclass?? && statement.subclass?contains("USPostalAddress") ) || ( statement.country?? && statement.country?contains("United States") ) >
|
||||
</#if>
|
||||
|
||||
<#-- 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>
|
||||
<#local cityStateZip><@s.join [ cityState!, statement.postalCode!], " " /></#local>
|
||||
<#if cityStateZip?has_content>
|
||||
<div class="extended-address">${cityStateZip}</div>
|
||||
</#if>
|
||||
<#else>
|
||||
<div class="locality">${statement.city!}</div>
|
||||
<#if statement.state??><div class="region">${statement.state}</div></#if>
|
||||
<#if statement.postalCode??><div class="postal-code">${statement.postalCode}</div></#if>
|
||||
<#if statement.state?has_content><div class="region">${statement.state}</div></#if>
|
||||
<#if statement.postalCode?has_content><div class="postal-code">${statement.postalCode}</div></#if>
|
||||
</#if>
|
||||
|
||||
<#if statement.country?has_content>
|
||||
<div class="country-name">${statement.country}</div>
|
||||
</#if>
|
||||
<#if statement.country??><div class="country-name">${statement.country}</div></#if>
|
||||
</div>
|
||||
|
||||
<#-- 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. -->
|
||||
<a href="${profileUrl(statement.address)}">${statement.label!statement.localName}</a>
|
||||
<#else>
|
||||
<a href="${profileUrl(statement.address)}">${statement.label!}</a>
|
||||
${statement.label!}
|
||||
</#if>
|
||||
|
||||
</#macro>
|
Loading…
Add table
Add a link
Reference in a new issue