From 1b2f34eadcca85383c2218aa4c2c0c0d5660a57a Mon Sep 17 00:00:00 2001 From: rjy7 Date: Fri, 21 Jan 2011 21:54:15 +0000 Subject: [PATCH] NIHVIVO-1863 Fix collated view of core:personInPosition and core:hasResearchArea --- doc/list_view_configuration_guidelines.txt | 6 ++++- .../webapp/dao/jena/DataPropertyDaoJena.java | 9 ++++--- .../dao/jena/ObjectPropertyDaoJena.java | 5 ++-- .../individual/individual-properties.ftl | 9 ++----- .../partials/individual/lib-properties.ftl | 25 ++++++++++++------- 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/doc/list_view_configuration_guidelines.txt b/doc/list_view_configuration_guidelines.txt index 13af619b8..2ab75600b 100644 --- a/doc/list_view_configuration_guidelines.txt +++ b/doc/list_view_configuration_guidelines.txt @@ -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 diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyDaoJena.java index d832f6128..201261a5b 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyDaoJena.java @@ -63,11 +63,12 @@ public class DataPropertyDaoJena extends PropertyDaoJena implements * value does not contain all of these namespaces. */ protected static final List 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#" ); /* diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyDaoJena.java index ecb159b2f..8cbe34995 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyDaoJena.java @@ -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 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#" ); /* diff --git a/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl b/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl index 28ec2732a..8b5abb24d 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl @@ -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 /> diff --git a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl index bd7aa8de5..c33a0bd5e 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl @@ -10,23 +10,30 @@ -<#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 /> + + + +<#macro collatedObjectPropertyList property editable template="${property.template}"> <#assign subclasses = property.subclasses> <#list subclasses?keys as subclass>
  • ${subclass?lower_case}

      - <@objectPropertyList property subclasses[subclass] property.template editable /> + <@objectPropertyList property editable subclasses[subclass] template/>
  • -<#macro simpleObjectPropertyList property editable> - <@objectPropertyList property property.statements "propStatement-simple.ftl" editable /> - - -<#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}"> @@ -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 --> <@addLinkWithLabel additionalLinks editable "Additional Web Pages" /> <#if additionalLinks.statements?has_content> <#-- if there are any statements -->