From bb6db4ed5b455325e897f8abe40da9b2e5870837 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Wed, 2 Nov 2011 14:04:26 +0000 Subject: [PATCH] modification to getObjectPropertyStatements(String propertyURI) to avoid need for explicity typed object properties --- .../mannlib/vitro/webapp/dao/jena/IndividualSDB.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualSDB.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualSDB.java index ff0926b70..ae48dac7a 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualSDB.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualSDB.java @@ -468,7 +468,14 @@ public class IndividualSDB extends IndividualImpl implements Individual { Individual subj = new IndividualSDB(((OntResource) s.getSubject().as(OntResource.class)).getURI(), this.dwf, datasetMode, webappDaoFactory); Individual obj = new IndividualSDB(((OntResource) s.getObject().as(OntResource.class)).getURI(), this.dwf, datasetMode, webappDaoFactory); ObjectProperty op = webappDaoFactory.getObjectPropertyDao().getObjectPropertyByURI(s.getPredicate().getURI()); - if (subj != null && obj != null && op != null) { + // We don't want to filter out statements simply because we + // can't find a type for the property, so we'll just make a + // new ObjectProperty bean if we can't get one from the DAO. + if (op == null) { + op = new ObjectProperty(); + op.setURI(propertyURI); + } + if (subj != null && obj != null) { ObjectPropertyStatement ops = new ObjectPropertyStatementImpl(); ops.setSubject(subj); ops.setSubjectURI(subj.getURI());