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,20 +11,23 @@
|
||||||
|
|
||||||
SELECT DISTINCT ?subclass
|
SELECT DISTINCT ?subclass
|
||||||
?address
|
?address
|
||||||
|
?localName
|
||||||
?label
|
?label
|
||||||
?street
|
?street
|
||||||
?city
|
?city
|
||||||
?state
|
?state
|
||||||
?postalCode
|
?postalCode
|
||||||
?country WHERE {
|
?country
|
||||||
|
|
||||||
|
WHERE {
|
||||||
?subject ?property ?address
|
?subject ?property ?address
|
||||||
|
LET ( ?localName := afn:localname(?address) )
|
||||||
OPTIONAL { ?address rdfs:label ?label }
|
OPTIONAL { ?address rdfs:label ?label }
|
||||||
OPTIONAL { ?address core:addressStreet ?street }
|
OPTIONAL { ?address core:addressStreet ?street }
|
||||||
OPTIONAL { ?address core:addressCity ?city }
|
OPTIONAL { ?address core:addressCity ?city }
|
||||||
OPTIONAL { ?address core:addressState ?state }
|
OPTIONAL { ?address core:addressState ?state }
|
||||||
OPTIONAL { ?address core:addressPostalCode ?postalCode }
|
OPTIONAL { ?address core:addressPostalCode ?postalCode }
|
||||||
OPTIONAL { ?address core:addressCountry ?country }
|
OPTIONAL { ?address core:addressCountry ?country }
|
||||||
|
|
||||||
|
|
||||||
OPTIONAL { ?address a ?subclass .
|
OPTIONAL { ?address a ?subclass .
|
||||||
?subclass rdfs:subClassOf core:Address
|
?subclass rdfs:subClassOf core:Address
|
||||||
|
|
|
@ -15,31 +15,8 @@
|
||||||
?terminologyContextNode core:entryTerm ?entryTerm .
|
?terminologyContextNode core:entryTerm ?entryTerm .
|
||||||
?terminologyContextNode core:termLabel ?termLabel .
|
?terminologyContextNode core:termLabel ?termLabel .
|
||||||
?terminologyContextNode core:termType ?termType .
|
?terminologyContextNode core:termType ?termType .
|
||||||
} ORDER BY ?termLabel
|
} ORDER BY ?termLabel
|
||||||
|
|
||||||
|
|
||||||
</query-select>
|
</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>
|
<template>propStatement-terminologyAnnotation.ftl</template>
|
||||||
</list-view-config>
|
</list-view-config>
|
||||||
|
|
|
@ -10,29 +10,47 @@
|
||||||
|
|
||||||
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
|
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
|
||||||
next statement -->
|
next statement -->
|
||||||
<#macro showAddress statement>
|
<#macro showAddress statement>
|
||||||
|
|
||||||
<#-- Pre-1.4 addresses may only have an rdfs:label, so display that when -->
|
<#if ( statement.street?has_content || statement.city?has_content || statement.state?has_content ||
|
||||||
<#-- there's no street number. -->
|
statement.postalCode?has_content || statement.country?has_content )>
|
||||||
<#if statement.street??>
|
|
||||||
<div class="adr">
|
<div class="adr">
|
||||||
|
<#if statement.street?has_content>
|
||||||
<div class="street-address">${statement.street}</div>
|
<div class="street-address">${statement.street}</div>
|
||||||
<#-- If the subclass is core:US Postal Address, or if the country is -->
|
</#if>
|
||||||
<#-- 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 the subclass is core:US Postal Address, or if the country is
|
||||||
<#if ( statement.subclass?? && statement.subclass?contains("USPostalAddress") ) || ( statement.country?? && statement.country?contains("United States") ) >
|
the US, display the city, state, and postal code on a single line. -->
|
||||||
<#if cityStateZip?has_content>
|
<#if ( statement.subclass?? && statement.subclass?contains("USPostalAddress") ) ||
|
||||||
<div class="extended-address">${cityStateZip}</div>
|
( statement.country?? && ( statement.country?contains("United States") ||
|
||||||
</#if>
|
statement.country == "US" ||
|
||||||
<#else>
|
statement.country == "USA" ) )>
|
||||||
<div class="locality">${statement.city!}</div>
|
<#local cityState><@s.join [statement.city!, statement.state!], ", " /></#local>
|
||||||
<#if statement.state??><div class="region">${statement.state}</div></#if>
|
<#local cityStateZip><@s.join [ cityState!, statement.postalCode!], " " /></#local>
|
||||||
<#if statement.postalCode??><div class="postal-code">${statement.postalCode}</div></#if>
|
<#if cityStateZip?has_content>
|
||||||
</#if>
|
<div class="extended-address">${cityStateZip}</div>
|
||||||
<#if statement.country??><div class="country-name">${statement.country}</div></#if>
|
</#if>
|
||||||
</div>
|
<#else>
|
||||||
<#else>
|
<div class="locality">${statement.city!}</div>
|
||||||
<a href="${profileUrl(statement.address)}">${statement.label!}</a>
|
<#if statement.state?has_content><div class="region">${statement.state}</div></#if>
|
||||||
</#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>
|
||||||
|
</div>
|
||||||
|
|
||||||
</#macro>
|
<#-- 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>
|
||||||
|
${statement.label!}
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
</#macro>
|
Loading…
Add table
Add a link
Reference in a new issue