updated mailingAddress list view because of changes to the ontology

This commit is contained in:
tworrall 2011-11-01 19:47:07 +00:00
parent e2e7574e1b
commit 90bdb9acfa
2 changed files with 45 additions and 23 deletions

View file

@ -6,15 +6,17 @@
<list-view-config> <list-view-config>
<query-select> <query-select>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt; PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
PREFIX vivo: &lt;http://vivoweb.org/ontology/core#&gt;
SELECT DISTINCT ?subclass SELECT DISTINCT ?subclass
?address ?address
?localName ?localName
?label ?label
?dept ?street1
?street ?street2
?street3
?city ?city
?state ?state
?postalCode ?postalCode
@ -24,32 +26,33 @@
?subject ?property ?address ?subject ?property ?address
LET ( ?localName := afn:localname(?address) ) LET ( ?localName := afn:localname(?address) )
OPTIONAL { ?address rdfs:label ?label } OPTIONAL { ?address rdfs:label ?label }
OPTIONAL { ?address core:addressDepartment ?dept } OPTIONAL { ?address vivo:address1 ?street1 }
OPTIONAL { ?address core:addressStreet ?street } OPTIONAL { ?address vivo:address2 ?street2 }
OPTIONAL { ?address core:addressCity ?city } OPTIONAL { ?address vivo:address3 ?street3 }
OPTIONAL { ?address core:addressState ?state } OPTIONAL { ?address vivo:addressCity ?city }
OPTIONAL { ?address core:addressPostalCode ?postalCode } OPTIONAL { ?address vivo:addressState ?state }
OPTIONAL { ?address core:addressCountry ?country } OPTIONAL { ?address vivo:addressPostalCode ?postalCode }
OPTIONAL { ?address vivo:addressCountry ?country }
OPTIONAL { ?address a ?subclass . OPTIONAL { ?address vitro:mostSpecificType ?subclass .
?subclass rdfs:subClassOf core:Address ?subclass rdfs:subClassOf vivo:Address
} }
} ORDER BY <collated>?subclass</collated> ?label } ORDER BY ?country ?label
</query-select> </query-select>
<query-construct> <query-construct>
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX vivo: &lt;http://vivoweb.org/ontology/core#&gt;
CONSTRUCT { CONSTRUCT {
?subclass rdfs:subClassOf core:Address ?subclass rdfs:subClassOf vivo:Address
} WHERE { } WHERE {
?subclass rdfs:subClassOf core:Address ?subclass rdfs:subClassOf vivo:Address
} }
</query-construct> </query-construct>
<query-construct> <query-construct>
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX vivo: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
CONSTRUCT { CONSTRUCT {
?subject ?property ?address . ?subject ?property ?address .
@ -64,5 +67,20 @@
} }
</query-construct> </query-construct>
<query-construct>
PREFIX vivo: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
CONSTRUCT {
?subject ?property ?address .
?address vitro:mostSpecificType ?subclass .
?subclass rdfs:subClassOf vivo:Address
} WHERE {
?subject ?property ?address .
?address vitro:mostSpecificType ?subclass .
?subclass rdfs:subClassOf vivo:Address
}
</query-construct>
<template>propStatement-mailingAddress.ftl</template> <template>propStatement-mailingAddress.ftl</template>
</list-view-config> </list-view-config>

View file

@ -12,19 +12,23 @@
next statement --> next statement -->
<#macro showAddress statement> <#macro showAddress statement>
<#if ( statement.dept?has_content || statement.street?has_content || statement.city?has_content || <#if ( statement.street1?has_content || statement.street2?has_content || statement.street3?has_content || statement.city?has_content ||
statement.state?has_content ||statement.postalCode?has_content || statement.country?has_content )> statement.state?has_content ||statement.postalCode?has_content || statement.country?has_content )>
<div class="adr"> <div class="adr">
<#if statement.dept?has_content> <#if statement.street1?has_content>
<div class="address-dept">${statement.dept}</div> <div class="address-street1">${statement.street1}</div>
</#if> </#if>
<#if statement.street?has_content> <#if statement.street2?has_content>
<div class="street-address">${statement.street}</div> <div class="address-street2">${statement.street2}</div>
</#if> </#if>
<#-- If the subclass is core:US Postal Address, or if the country is <#if statement.street3?has_content>
<div class="address-street3">${statement.street3}</div>
</#if>
<#-- If the subclass is vivo:US Postal Address, or if the country is
the US, display the city, state, and postal code on a single line. --> the US, display the city, state, and postal code on a single line. -->
<#if ( statement.subclass?? && statement.subclass?contains("USPostalAddress") ) || <#if ( statement.subclass?? && statement.subclass?contains("USPostalAddress") ) ||
( statement.country?? && ( statement.country?contains("United States") || ( statement.country?? && ( statement.country?contains("United States") ||