Merge branch 'maint-rel-1.6' into develop

This commit is contained in:
j2blake 2013-11-06 11:45:43 -05:00
commit 8906743b74
5 changed files with 41 additions and 19 deletions

View file

@ -271,7 +271,6 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
public ObjectProperty getObjectPropertyByURI(String propertyURI) { public ObjectProperty getObjectPropertyByURI(String propertyURI) {
long start = System.currentTimeMillis();
if( propertyURI == null ) return null; if( propertyURI == null ) return null;
OntModel ontModel = getOntModel(); OntModel ontModel = getOntModel();
@ -279,7 +278,16 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
ontModel.enterCriticalSection(Lock.READ); ontModel.enterCriticalSection(Lock.READ);
try { try {
localModel.add(ontModel.listStatements(ontModel.getResource(propertyURI), null, (RDFNode) null)); Resource prop = ontModel.getResource(propertyURI);
localModel.add(ontModel.listStatements(prop, null, (RDFNode) null));
StmtIterator invit = ontModel.listStatements(prop, OWL.inverseOf, (RDFNode) null);
while (invit.hasNext()) {
Statement invSit = invit.nextStatement();
if (invSit.getObject().isURIResource()) {
Resource invProp = (Resource) invSit.getObject();
localModel.add(ontModel.listStatements(invProp, null, (RDFNode) null));
}
}
OntProperty op = localModel.getObjectProperty(propertyURI); OntProperty op = localModel.getObjectProperty(propertyURI);
return propertyFromOntProperty(op); return propertyFromOntProperty(op);
} finally { } finally {

View file

@ -442,7 +442,7 @@ public class FakeApplicationOntologyService {
private static String QUERY_STRING = "" private static String QUERY_STRING = ""
+ "PREFIX obo: <http://purl.obolibrary.org/obo/> \n" + "PREFIX obo: <http://purl.obolibrary.org/obo/> \n"
+ "PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> \n" + "PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> \n"
+ "SELECT ?uri ?pt \n" + "WHERE { \n" + "SELECT ?pt \n" + "WHERE { \n"
+ " ?uri obo:ARG_2000028 ?vIndividual . \n" + " ?uri obo:ARG_2000028 ?vIndividual . \n"
+ " ?vIndividual vcard:hasTitle ?vTitle . \n" + " ?vIndividual vcard:hasTitle ?vTitle . \n"
+ " ?vTitle vcard:title ?pt . \n" + "} LIMIT 1"; + " ?vTitle vcard:title ?pt . \n" + "} LIMIT 1";

View file

@ -33,6 +33,7 @@ import edu.cornell.mannlib.vitro.webapp.reasoner.ReasonerPlugin;
import edu.cornell.mannlib.vitro.webapp.reasoner.SimpleReasoner; import edu.cornell.mannlib.vitro.webapp.reasoner.SimpleReasoner;
import edu.cornell.mannlib.vitro.webapp.reasoner.SimpleReasonerTBoxListener; import edu.cornell.mannlib.vitro.webapp.reasoner.SimpleReasonerTBoxListener;
import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus; import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
import edu.cornell.mannlib.vitro.webapp.utils.threads.VitroBackgroundThread;
public class SimpleReasonerSetup implements ServletContextListener { public class SimpleReasonerSetup implements ServletContextListener {
@ -121,7 +122,7 @@ public class SimpleReasonerSetup implements ServletContextListener {
simpleReasoner.recompute(); simpleReasoner.recompute();
} else if (RecomputeMode.BACKGROUND.equals(mode)) { } else if (RecomputeMode.BACKGROUND.equals(mode)) {
log.info("starting ABox inference recompute in a separate thread."); log.info("starting ABox inference recompute in a separate thread.");
new Thread( new VitroBackgroundThread(
new ABoxRecomputer( new ABoxRecomputer(
simpleReasoner),"ABoxRecomputer").start(); simpleReasoner),"ABoxRecomputer").start();
} }

View file

@ -148,6 +148,10 @@ public class SparqlQueryDataGetter extends DataGetterBase implements DataGetter{
for (String key: pageData.keySet()) { for (String key: pageData.keySet()) {
merged.put(key, String.valueOf(pageData.get(key))); merged.put(key, String.valueOf(pageData.get(key)));
} }
if (log.isDebugEnabled()) {
log.debug("Merging request parameters " + parameterMap
+ " with page data " + pageData + " results in " + merged);
}
return merged; return merged;
} }
@ -161,9 +165,13 @@ public class SparqlQueryDataGetter extends DataGetterBase implements DataGetter{
private String bindParameters(String text, Map<String, String> merged) { private String bindParameters(String text, Map<String, String> merged) {
String bound = text; String bound = text;
for (String key : merged.keySet()) { for (String key : merged.keySet()) {
bound.replace('?' + key, '<' + merged.get(key) + '>'); bound = bound.replace('?' + key, '<' + merged.get(key) + '>');
}
if (log.isDebugEnabled()) {
log.debug("parameters: " + merged);
log.debug("query before binding parameters:" + text);
log.debug("query after binding parameters: " + bound);
} }
log.debug("query after binding parameters: " + bound);
return bound; return bound;
} }

View file

@ -300,21 +300,26 @@ public class GroupedPropertyList extends BaseTemplateModel {
return false; return false;
} }
for (ObjectProperty op : opList) { for (ObjectProperty op : opList) {
if (op.getURI() != null && op.getURI().equals(pi.getPropertyURI())) { boolean uriMatches = (op.getURI() != null
if(op.getDomainVClassURI() == null) { && op.getURI().equals(pi.getPropertyURI()));
if(pi.getDomainClassURI() == null) { boolean domainMatches = false;
return true; boolean rangeMatches = false;
} if(op.getDomainVClassURI() == null) {
} else if (op.getDomainVClassURI().equals(pi.getDomainClassURI())) { if(pi.getDomainClassURI() == null) {
return true; domainMatches = true;
} }
if(op.getRangeVClassURI() == null) { } else if (op.getDomainVClassURI().equals(pi.getDomainClassURI())) {
if (pi.getDomainClassURI() == null) { domainMatches = true;
return true; }
} if(op.getRangeVClassURI() == null) {
} else if (op.getRangeVClassURI().equals(pi.getRangeClassURI())) { if (pi.getDomainClassURI() == null) {
return true; rangeMatches = true;
} }
} else if (op.getRangeVClassURI().equals(pi.getRangeClassURI())) {
rangeMatches = true;
}
if (uriMatches && domainMatches && rangeMatches) {
return true;
} }
} }
return false; return false;