NIHVIVO-1863 Fix collated view of core:personInPosition and core:hasResearchArea

This commit is contained in:
rjy7 2011-01-21 21:54:15 +00:00
parent 1f2edcc622
commit 1b2f34eadc
5 changed files with 31 additions and 23 deletions

View file

@ -6,9 +6,13 @@ REQUIRED ELEMENTS
-----------------
- list-view-config: root element
- query: the sparql query used to retrieve the data
- query-base: sparql query used to retrieve data for an uncollated property
- query-collated: sparql query used to retrieve data for a collated property
- template: the name of the template used to display a single property statement
Note: both query-base and query-collated must be included to support the collation checkbox
on the back end Object Property Edit form.
-----------------
OPTIONAL ELEMENTS

View file

@ -63,11 +63,12 @@ public class DataPropertyDaoJena extends PropertyDaoJena implements
* value does not contain all of these namespaces.
*/
protected static final List<String> EXCLUDED_NAMESPACES = Arrays.asList(
// Don't need to exclude these, because they are not owl:DatatypeProperty
//"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
//"http://www.w3.org/2000/01/rdf-schema#",
"http://www.w3.org/2002/07/owl#",
"http://vitro.mannlib.cornell.edu/ns/vitro/0.7#",
"http://vitro.mannlib.cornell.edu/ns/vitro/public#",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"http://www.w3.org/2000/01/rdf-schema#",
"http://www.w3.org/2002/07/owl#"
"http://vitro.mannlib.cornell.edu/ns/vitro/public#"
);
/*

View file

@ -55,8 +55,9 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
private static final Log log = LogFactory.getLog(ObjectPropertyDaoJena.class.getName());
protected static final List<String> EXCLUDED_NAMESPACES = Arrays.asList(
"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"http://www.w3.org/2000/01/rdf-schema#",
// Don't need to exclude these, because they are not owl:ObjectProperty
//"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
//"http://www.w3.org/2000/01/rdf-schema#",
"http://www.w3.org/2002/07/owl#"
);
/*

View file

@ -30,13 +30,8 @@
<#if property.type == "data">
<@p.dataPropertyList property editable />
<#-- object property -->
<#elseif property.collatedBySubclass> <#-- collated -->
<@p.collatedObjectPropertyList property editable />
<#else> <#-- uncollated -->
<#-- We pass property.statements and property.template even though we are also
passing property, because objecctPropertyList can get other values, and
doesn't necessarily use property.statements and property.template -->
<@p.objectPropertyList property property.statements property.template editable />
<#else>
<@p.objectProperty property editable />
</#if>
</ul>
</article> <!-- end property -->

View file

@ -10,23 +10,30 @@
</#list>
</#macro>
<#macro collatedObjectPropertyList property editable>
<#macro objectProperty property editable template="${property.template}">
<#if property.collatedBySubclass> <#-- collated -->
<@p.collatedObjectPropertyList property editable template />
<#else> <#-- uncollated -->
<#-- We pass property.statements and property.template even though we are also
passing property, because objecctPropertyList can get other values, and
doesn't necessarily use property.statements and property.template -->
<@p.objectPropertyList property editable property.statements template />
</#if>
</#macro>
<#macro collatedObjectPropertyList property editable template="${property.template}">
<#assign subclasses = property.subclasses>
<#list subclasses?keys as subclass>
<li class="subclass">
<h3>${subclass?lower_case}</h3>
<ul class="subclass-property-list">
<@objectPropertyList property subclasses[subclass] property.template editable />
<@objectPropertyList property editable subclasses[subclass] template/>
</ul>
</li>
</#list>
</#macro>
<#macro simpleObjectPropertyList property editable>
<@objectPropertyList property property.statements "propStatement-simple.ftl" editable />
</#macro>
<#macro objectPropertyList property statements template editable>
<#macro objectPropertyList property editable statements="${property.statements}" template="${property.template}">
<#list statements as statement>
<@propertyListItem property statement editable><#include "${template}"></@propertyListItem>
</#list>
@ -97,13 +104,13 @@ name will be used as the label. -->
<@addLinkWithLabel primaryLink editable "Primary Web Page" />
<#if primaryLink.statements?has_content> <#-- if there are any statements -->
<ul class="${linkListClass}" id="links-primary" role="list">
<@objectPropertyList primaryLink primaryLink.statements primaryLink.template editable />
<@objectPropertyList primaryLink editable />
</ul>
</#if>
<@addLinkWithLabel additionalLinks editable "Additional Web Pages" />
<#if additionalLinks.statements?has_content> <#-- if there are any statements -->
<ul class="${linkListClass}" id="links-additional" role="list">
<@objectPropertyList additionalLinks additionalLinks.statements additionalLinks.template editable />
<@objectPropertyList additionalLinks editable />
</ul>
</#if>
</nav>