Merge branch 'maint-rel-1.6' into develop
This commit is contained in:
commit
8906743b74
5 changed files with 41 additions and 19 deletions
|
@ -271,7 +271,6 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
|
|||
|
||||
public ObjectProperty getObjectPropertyByURI(String propertyURI) {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
if( propertyURI == null ) return null;
|
||||
|
||||
OntModel ontModel = getOntModel();
|
||||
|
@ -279,7 +278,16 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
|
|||
|
||||
ontModel.enterCriticalSection(Lock.READ);
|
||||
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);
|
||||
return propertyFromOntProperty(op);
|
||||
} finally {
|
||||
|
|
|
@ -442,7 +442,7 @@ public class FakeApplicationOntologyService {
|
|||
private static String QUERY_STRING = ""
|
||||
+ "PREFIX obo: <http://purl.obolibrary.org/obo/> \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"
|
||||
+ " ?vIndividual vcard:hasTitle ?vTitle . \n"
|
||||
+ " ?vTitle vcard:title ?pt . \n" + "} LIMIT 1";
|
||||
|
|
|
@ -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.SimpleReasonerTBoxListener;
|
||||
import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.threads.VitroBackgroundThread;
|
||||
|
||||
public class SimpleReasonerSetup implements ServletContextListener {
|
||||
|
||||
|
@ -121,7 +122,7 @@ public class SimpleReasonerSetup implements ServletContextListener {
|
|||
simpleReasoner.recompute();
|
||||
} else if (RecomputeMode.BACKGROUND.equals(mode)) {
|
||||
log.info("starting ABox inference recompute in a separate thread.");
|
||||
new Thread(
|
||||
new VitroBackgroundThread(
|
||||
new ABoxRecomputer(
|
||||
simpleReasoner),"ABoxRecomputer").start();
|
||||
}
|
||||
|
|
|
@ -148,6 +148,10 @@ public class SparqlQueryDataGetter extends DataGetterBase implements DataGetter{
|
|||
for (String key: pageData.keySet()) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -161,9 +165,13 @@ public class SparqlQueryDataGetter extends DataGetterBase implements DataGetter{
|
|||
private String bindParameters(String text, Map<String, String> merged) {
|
||||
String bound = text;
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -300,21 +300,26 @@ public class GroupedPropertyList extends BaseTemplateModel {
|
|||
return false;
|
||||
}
|
||||
for (ObjectProperty op : opList) {
|
||||
if (op.getURI() != null && op.getURI().equals(pi.getPropertyURI())) {
|
||||
if(op.getDomainVClassURI() == null) {
|
||||
if(pi.getDomainClassURI() == null) {
|
||||
return true;
|
||||
}
|
||||
} else if (op.getDomainVClassURI().equals(pi.getDomainClassURI())) {
|
||||
return true;
|
||||
boolean uriMatches = (op.getURI() != null
|
||||
&& op.getURI().equals(pi.getPropertyURI()));
|
||||
boolean domainMatches = false;
|
||||
boolean rangeMatches = false;
|
||||
if(op.getDomainVClassURI() == null) {
|
||||
if(pi.getDomainClassURI() == null) {
|
||||
domainMatches = true;
|
||||
}
|
||||
if(op.getRangeVClassURI() == null) {
|
||||
if (pi.getDomainClassURI() == null) {
|
||||
return true;
|
||||
}
|
||||
} else if (op.getRangeVClassURI().equals(pi.getRangeClassURI())) {
|
||||
return true;
|
||||
} else if (op.getDomainVClassURI().equals(pi.getDomainClassURI())) {
|
||||
domainMatches = true;
|
||||
}
|
||||
if(op.getRangeVClassURI() == null) {
|
||||
if (pi.getDomainClassURI() == null) {
|
||||
rangeMatches = true;
|
||||
}
|
||||
} else if (op.getRangeVClassURI().equals(pi.getRangeClassURI())) {
|
||||
rangeMatches = true;
|
||||
}
|
||||
if (uriMatches && domainMatches && rangeMatches) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue