From: <lor...@us...> - 2010-11-12 09:53:06
|
Revision: 2428 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2428&view=rev Author: lorenz_b Date: 2010-11-12 09:52:59 +0000 (Fri, 12 Nov 2010) Log Message: ----------- Update to Pellet 2.2.2 and OWLAPI 3.1.0. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java trunk/components-core/src/main/java/org/dllearner/reasoning/PelletReasoner.java trunk/components-core/src/main/java/org/dllearner/reasoning/ProtegeReasoner.java trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIAxiomConvertVisitor.java trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIDescriptionConvertVisitor.java trunk/components-core/src/test/java/org/dllearner/test/FaCTBugDemo.java trunk/components-core/src/test/java/org/dllearner/test/HermitTest.java trunk/pom.xml Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:ignore - .lastUsedExample .settings .project .classpath classes log cache cachePersistant reports results local rdbtoonto the_log.txt tmp fragmentOntology.owl output ling osmdata matching stanley dllearner.jar father.inp lgd.nt files errorDescription bin tigerResults dbpedia_3.4.owl dbpedia_3.4.owl.count dbpedia_3.4.owl.expanded.count dbpedia_3.4.owl.purged.ser dbpedia_3.4.owl.sub.ser dbpedia_3.4.owl.super.ser dbpedia_3.4.owl.tar.gz skoscategories_en.nt skoscategories_en.nt.count skoscategories_en.nt.expanded.count skoscategories_en.nt.purged.ser skoscategories_en.nt.sub.ser skoscategories_en.nt.super.ser skoscategories_en.nt.tar.gz yagoclasses_links.nt yagoclasses_links.nt.count yagoclasses_links.nt.expanded.count yagoclasses_links.nt.purged.ser yagoclasses_links.nt.sub.ser yagoclasses_links.nt.super.ser yagoclasses_links.nt.tar.gz target dbpedia_3.4.owl (2) yagoclasses_links.nt (2) new.tar.gz dbpedia_3.5.1.owl dbpedia_3.5.1.owl.bz2 dbpedia_3.5.1.owl.count dbpedia_3.5.1.owl.expanded.count dbpedia_3.5.1.owl.purged.ser dbpedia_3.5.1.owl.sub.ser dbpedia_3.5.1.owl.super.ser + .lastUsedExample .settings .project .classpath classes log cache cachePersistant reports results local rdbtoonto the_log.txt tmp fragmentOntology.owl output ling osmdata matching tomcat stanley dllearner.jar father.inp lgd.nt files errorDescription bin tigerResults dbpedia_3.4.owl dbpedia_3.4.owl.count dbpedia_3.4.owl.expanded.count dbpedia_3.4.owl.purged.ser dbpedia_3.4.owl.sub.ser dbpedia_3.4.owl.super.ser dbpedia_3.4.owl.tar.gz skoscategories_en.nt skoscategories_en.nt.count skoscategories_en.nt.expanded.count skoscategories_en.nt.purged.ser skoscategories_en.nt.sub.ser skoscategories_en.nt.super.ser skoscategories_en.nt.tar.gz yagoclasses_links.nt yagoclasses_links.nt.count yagoclasses_links.nt.expanded.count yagoclasses_links.nt.purged.ser yagoclasses_links.nt.sub.ser yagoclasses_links.nt.super.ser yagoclasses_links.nt.tar.gz target dbpedia_3.4.owl (2) yagoclasses_links.nt (2) new.tar.gz dbpedia_3.5.1.owl dbpedia_3.5.1.owl.bz2 dbpedia_3.5.1.owl.count dbpedia_3.5.1.owl.expanded.count dbpedia_3.5.1.owl.purged.ser dbpedia_3.5.1.owl.sub.ser dbpedia_3.5.1.owl.super.ser Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2010-11-11 17:47:04 UTC (rev 2427) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2010-11-12 09:52:59 UTC (rev 2428) @@ -33,11 +33,11 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; -import java.util.Map.Entry; import org.apache.log4j.Level; import org.apache.log4j.Logger; @@ -98,13 +98,13 @@ import org.semanticweb.owlapi.model.OWLOntologyFormat; import org.semanticweb.owlapi.model.OWLOntologyManager; import org.semanticweb.owlapi.model.OWLOntologyStorageException; -import org.semanticweb.owlapi.model.OWLTypedLiteral; import org.semanticweb.owlapi.model.RemoveAxiom; import org.semanticweb.owlapi.model.UnknownOWLOntologyException; import org.semanticweb.owlapi.owllink.OWLlinkHTTPXMLReasonerFactory; import org.semanticweb.owlapi.owllink.OWLlinkReasonerConfiguration; import org.semanticweb.owlapi.reasoner.FreshEntityPolicy; import org.semanticweb.owlapi.reasoner.IndividualNodeSetPolicy; +import org.semanticweb.owlapi.reasoner.InferenceType; import org.semanticweb.owlapi.reasoner.Node; import org.semanticweb.owlapi.reasoner.NodeSet; import org.semanticweb.owlapi.reasoner.NullReasonerProgressMonitor; @@ -116,7 +116,6 @@ import org.semanticweb.owlapi.vocab.PrefixOWLOntologyFormat; import uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasonerFactory; -import uk.ac.manchester.cs.owl.owlapi.OWLStringLiteralImpl; import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory; @@ -375,7 +374,7 @@ boolean inconsistentOntology = !reasoner.isConsistent(); if(!inconsistentOntology) { - reasoner.prepareReasoner(); + reasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY, InferenceType.CLASS_ASSERTIONS); } else { throw new ComponentInitException("Inconsistent ontologies."); } @@ -569,7 +568,7 @@ @Override protected TreeSet<ObjectProperty> getSuperPropertiesImpl(ObjectProperty role) { - NodeSet<OWLObjectProperty> properties = null; + NodeSet<OWLObjectPropertyExpression> properties = null; properties = reasoner.getSuperObjectProperties(OWLAPIConverter.getOWLAPIObjectProperty(role), true); @@ -578,7 +577,7 @@ @Override protected TreeSet<ObjectProperty> getSubPropertiesImpl(ObjectProperty role) { - NodeSet<OWLObjectProperty> properties = null; + NodeSet<OWLObjectPropertyExpression> properties = null; properties = reasoner.getSubObjectProperties(OWLAPIConverter.getOWLAPIObjectProperty(role), true); @@ -814,20 +813,19 @@ // convert data back to DL-Learner structures SortedSet<Constant> is = new TreeSet<Constant>(); - for(OWLLiteral oi : constants) { + for(OWLLiteral literal : constants) { // for typed constants we have to figure out the correct // data type and value - if(oi instanceof OWLTypedLiteral) { - Datatype dt = OWLAPIConverter.convertDatatype(((OWLTypedLiteral)oi).getDatatype()); - is.add(new TypedConstant(oi.getLiteral(),dt)); + if(!literal.isRDFPlainLiteral()) { + Datatype dt = OWLAPIConverter.convertDatatype(literal.getDatatype()); + is.add(new TypedConstant(literal.getLiteral(), dt)); // for untyped constants we have to figure out the value // and language tag (if any) } else { - OWLStringLiteralImpl ouc = (OWLStringLiteralImpl) oi; - if(ouc.hasLang()) - is.add(new UntypedConstant(ouc.getLiteral(), ouc.getLang())); + if(literal.hasLang()) + is.add(new UntypedConstant(literal.getLiteral(), literal.getLang())); else - is.add(new UntypedConstant(ouc.getLiteral())); + is.add(new UntypedConstant(literal.getLiteral())); } } // only add individuals using the datatype property @@ -869,16 +867,16 @@ return concepts; } - private TreeSet<ObjectProperty> getFirstObjectProperties(NodeSet<OWLObjectProperty> nodeSet) { + private TreeSet<ObjectProperty> getFirstObjectProperties(NodeSet<OWLObjectPropertyExpression> nodeSet) { TreeSet<ObjectProperty> roles = new TreeSet<ObjectProperty>(roleComparator); - for(Node<OWLObjectProperty> node : nodeSet) { + for(Node<OWLObjectPropertyExpression> node : nodeSet) { if(node.isBottomNode() || node.isTopNode()){ continue; } // take one element from the set and ignore the rest // (TODO: we need to make sure we always ignore the same concepts) - OWLObjectProperty property = node.getRepresentativeElement(); - roles.add(new ObjectProperty(property.toStringID())); + OWLObjectPropertyExpression property = node.getRepresentativeElement(); + roles.add(new ObjectProperty(property.asOWLObjectProperty().toStringID())); } roles.remove(new ObjectProperty(factory.getOWLTopObjectProperty().toStringID())); roles.remove(new ObjectProperty(factory.getOWLBottomObjectProperty().toStringID())); Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/PelletReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/PelletReasoner.java 2010-11-11 17:47:04 UTC (rev 2427) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/PelletReasoner.java 2010-11-12 09:52:59 UTC (rev 2428) @@ -13,11 +13,11 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; -import java.util.Map.Entry; import org.apache.log4j.Level; import org.apache.log4j.Logger; @@ -96,7 +96,6 @@ import org.semanticweb.owlapi.model.OWLOntologyFormat; import org.semanticweb.owlapi.model.OWLOntologyManager; import org.semanticweb.owlapi.model.OWLOntologyStorageException; -import org.semanticweb.owlapi.model.OWLTypedLiteral; import org.semanticweb.owlapi.model.RemoveAxiom; import org.semanticweb.owlapi.model.UnknownOWLOntologyException; import org.semanticweb.owlapi.reasoner.Node; @@ -104,8 +103,6 @@ import org.semanticweb.owlapi.util.SimpleIRIMapper; import org.semanticweb.owlapi.vocab.PrefixOWLOntologyFormat; -import uk.ac.manchester.cs.owl.owlapi.OWLStringLiteralImpl; - import com.clarkparsia.modularity.IncrementalClassifier; import com.clarkparsia.modularity.PelletIncremantalReasonerFactory; import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory; @@ -635,7 +632,7 @@ public Set<Description> getComplementClasses(Description desc){ OWLClassExpression owlDesc = OWLAPIDescriptionConvertVisitor.getOWLClassExpression(desc); Set<Description> complements = new HashSet<Description>(); - for(OWLClass comp : reasoner.getDisjointClasses(owlDesc, false).getFlattened()){ + for(OWLClass comp : reasoner.getDisjointClasses(owlDesc).getFlattened()){ complements.add(OWLAPIConverter.convertClass(comp)); } return complements; @@ -679,7 +676,7 @@ @Override protected TreeSet<ObjectProperty> getSuperPropertiesImpl(ObjectProperty role) { - NodeSet<OWLObjectProperty> properties = null; + NodeSet<OWLObjectPropertyExpression> properties = null; properties = reasoner.getSuperObjectProperties(OWLAPIConverter.getOWLAPIObjectProperty(role), true); @@ -688,7 +685,7 @@ @Override protected TreeSet<ObjectProperty> getSubPropertiesImpl(ObjectProperty role) { - NodeSet<OWLObjectProperty> properties = null; + NodeSet<OWLObjectPropertyExpression> properties = null; properties = reasoner.getSubObjectProperties(OWLAPIConverter.getOWLAPIObjectProperty(role), true); @@ -1428,20 +1425,19 @@ // convert data back to DL-Learner structures SortedSet<Constant> is = new TreeSet<Constant>(); - for(OWLLiteral oi : constants) { + for(OWLLiteral literal : constants) { // for typed constants we have to figure out the correct // data type and value - if(oi instanceof OWLTypedLiteral) { - Datatype dt = OWLAPIConverter.convertDatatype(((OWLTypedLiteral)oi).getDatatype()); - is.add(new TypedConstant(oi.getLiteral(),dt)); + if(!literal.isRDFPlainLiteral()) { + Datatype dt = OWLAPIConverter.convertDatatype(literal.getDatatype()); + is.add(new TypedConstant(literal.getLiteral(), dt)); // for untyped constants we have to figure out the value // and language tag (if any) } else { - OWLStringLiteralImpl ouc = (OWLStringLiteralImpl) oi; - if(ouc.hasLang()) - is.add(new UntypedConstant(ouc.getLiteral(), ouc.getLang())); + if(literal.hasLang()) + is.add(new UntypedConstant(literal.getLiteral(), literal.getLang())); else - is.add(new UntypedConstant(ouc.getLiteral())); + is.add(new UntypedConstant(literal.getLiteral())); } } // only add individuals using the datatype property @@ -1483,17 +1479,19 @@ return concepts; } - private TreeSet<ObjectProperty> getFirstObjectProperties(NodeSet<OWLObjectProperty> setOfSets) { + private TreeSet<ObjectProperty> getFirstObjectProperties(NodeSet<OWLObjectPropertyExpression> nodeSet) { TreeSet<ObjectProperty> roles = new TreeSet<ObjectProperty>(roleComparator); - for(Node<OWLObjectProperty> innerSet : setOfSets) { - if(innerSet.isBottomNode() || innerSet.isTopNode()){ + for(Node<OWLObjectPropertyExpression> node : nodeSet) { + if(node.isBottomNode() || node.isTopNode()){ continue; } // take one element from the set and ignore the rest // (TODO: we need to make sure we always ignore the same concepts) - OWLObjectProperty property = innerSet.iterator().next(); - roles.add(new ObjectProperty(property.toStringID())); + OWLObjectPropertyExpression property = node.getRepresentativeElement(); + roles.add(new ObjectProperty(property.asOWLObjectProperty().toStringID())); } + roles.remove(new ObjectProperty(factory.getOWLTopObjectProperty().toStringID())); + roles.remove(new ObjectProperty(factory.getOWLBottomObjectProperty().toStringID())); return roles; } Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/ProtegeReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/ProtegeReasoner.java 2010-11-11 17:47:04 UTC (rev 2427) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/ProtegeReasoner.java 2010-11-12 09:52:59 UTC (rev 2428) @@ -11,11 +11,11 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; -import java.util.Map.Entry; import org.dllearner.core.ComponentInitException; import org.dllearner.core.KnowledgeSource; @@ -86,7 +86,6 @@ import org.semanticweb.owlapi.model.OWLOntologyFormat; import org.semanticweb.owlapi.model.OWLOntologyManager; import org.semanticweb.owlapi.model.OWLOntologyStorageException; -import org.semanticweb.owlapi.model.OWLTypedLiteral; import org.semanticweb.owlapi.model.RemoveAxiom; import org.semanticweb.owlapi.model.UnknownOWLOntologyException; import org.semanticweb.owlapi.reasoner.Node; @@ -96,8 +95,6 @@ import org.semanticweb.owlapi.util.SimpleIRIMapper; import org.semanticweb.owlapi.vocab.PrefixOWLOntologyFormat; -import uk.ac.manchester.cs.owl.owlapi.OWLStringLiteralImpl; - public class ProtegeReasoner extends ReasonerComponent { private OWLOntologyManager manager; @@ -428,7 +425,7 @@ public Set<Description> getComplementClasses(Description desc){ OWLClassExpression owlDesc = OWLAPIDescriptionConvertVisitor.getOWLClassExpression(desc); Set<Description> complements = new HashSet<Description>(); - for(OWLClass comp : reasoner.getDisjointClasses(owlDesc, false).getFlattened()){ + for(OWLClass comp : reasoner.getDisjointClasses(owlDesc).getFlattened()){ complements.add(OWLAPIConverter.convertClass(comp)); } return complements; @@ -472,7 +469,7 @@ @Override protected TreeSet<ObjectProperty> getSuperPropertiesImpl(ObjectProperty role) { - NodeSet<OWLObjectProperty> properties = null; + NodeSet<OWLObjectPropertyExpression> properties = null; properties = reasoner.getSuperObjectProperties(OWLAPIConverter.getOWLAPIObjectProperty(role), true); @@ -481,7 +478,7 @@ @Override protected TreeSet<ObjectProperty> getSubPropertiesImpl(ObjectProperty role) { - NodeSet<OWLObjectProperty> properties = null; + NodeSet<OWLObjectPropertyExpression> properties = null; properties = reasoner.getSubObjectProperties(OWLAPIConverter.getOWLAPIObjectProperty(role), true); @@ -1221,20 +1218,19 @@ // convert data back to DL-Learner structures SortedSet<Constant> is = new TreeSet<Constant>(); - for(OWLLiteral oi : constants) { + for(OWLLiteral literal : constants) { // for typed constants we have to figure out the correct // data type and value - if(oi instanceof OWLTypedLiteral) { - Datatype dt = OWLAPIConverter.convertDatatype(((OWLTypedLiteral)oi).getDatatype()); - is.add(new TypedConstant(oi.getLiteral(),dt)); + if(!literal.isRDFPlainLiteral()) { + Datatype dt = OWLAPIConverter.convertDatatype(literal.getDatatype()); + is.add(new TypedConstant(literal.getLiteral(), dt)); // for untyped constants we have to figure out the value // and language tag (if any) } else { - OWLStringLiteralImpl ouc = (OWLStringLiteralImpl) oi; - if(ouc.hasLang()) - is.add(new UntypedConstant(ouc.getLiteral(), ouc.getLang())); + if(literal.hasLang()) + is.add(new UntypedConstant(literal.getLiteral(), literal.getLang())); else - is.add(new UntypedConstant(ouc.getLiteral())); + is.add(new UntypedConstant(literal.getLiteral())); } } // only add individuals using the datatype property @@ -1276,19 +1272,21 @@ return concepts; } - private TreeSet<ObjectProperty> getFirstObjectProperties(NodeSet<OWLObjectProperty> setOfSets) { + private TreeSet<ObjectProperty> getFirstObjectProperties(NodeSet<OWLObjectPropertyExpression> nodeSet) { TreeSet<ObjectProperty> roles = new TreeSet<ObjectProperty>(roleComparator); - for(Node<OWLObjectProperty> innerSet : setOfSets) { - if(innerSet.isBottomNode() || innerSet.isTopNode()){ + for(Node<OWLObjectPropertyExpression> node : nodeSet) { + if(node.isBottomNode() || node.isTopNode()){ continue; } // take one element from the set and ignore the rest // (TODO: we need to make sure we always ignore the same concepts) - OWLObjectProperty property = innerSet.iterator().next(); - roles.add(new ObjectProperty(property.toStringID())); + OWLObjectPropertyExpression property = node.getRepresentativeElement(); + roles.add(new ObjectProperty(property.asOWLObjectProperty().toStringID())); } + roles.remove(new ObjectProperty(factory.getOWLTopObjectProperty().toStringID())); + roles.remove(new ObjectProperty(factory.getOWLBottomObjectProperty().toStringID())); return roles; - } + } private TreeSet<DatatypeProperty> getFirstDatatypeProperties(NodeSet<OWLDataProperty> setOfSets) { TreeSet<DatatypeProperty> roles = new TreeSet<DatatypeProperty>(roleComparator); Modified: trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIAxiomConvertVisitor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIAxiomConvertVisitor.java 2010-11-11 17:47:04 UTC (rev 2427) +++ trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIAxiomConvertVisitor.java 2010-11-12 09:52:59 UTC (rev 2428) @@ -58,12 +58,12 @@ import org.semanticweb.owlapi.model.OWLDataProperty; import org.semanticweb.owlapi.model.OWLDatatype; import org.semanticweb.owlapi.model.OWLIndividual; +import org.semanticweb.owlapi.model.OWLLiteral; import org.semanticweb.owlapi.model.OWLObjectProperty; import org.semanticweb.owlapi.model.OWLOntology; import org.semanticweb.owlapi.model.OWLOntologyChangeException; import org.semanticweb.owlapi.model.OWLOntologyCreationException; import org.semanticweb.owlapi.model.OWLOntologyManager; -import org.semanticweb.owlapi.model.OWLTypedLiteral; /** * A converter from DL-Learner axioms to OWL API axioms based on the visitor @@ -168,9 +168,8 @@ public void visit(DoubleDatatypePropertyAssertion axiom) { OWLIndividual i = factory.getOWLNamedIndividual(IRI.create(axiom.getIndividual().getName())); OWLDataProperty dp = factory.getOWLDataProperty(IRI.create(axiom.getDatatypeProperty().getName())); - Double value = axiom.getValue(); - OWLDatatype doubleType = factory.getDoubleOWLDatatype(); - OWLTypedLiteral valueConstant = factory.getOWLTypedLiteral(value.toString(), doubleType); + double value = axiom.getValue(); + OWLLiteral valueConstant = factory.getOWLLiteral(value); OWLAxiom axiomOWLAPI = factory.getOWLDataPropertyAssertionAxiom(dp, i, valueConstant); addAxiom(axiomOWLAPI); } @@ -181,9 +180,8 @@ public void visit(BooleanDatatypePropertyAssertion axiom) { OWLIndividual i = factory.getOWLNamedIndividual(IRI.create(axiom.getIndividual().getName())); OWLDataProperty dp = factory.getOWLDataProperty(IRI.create(axiom.getDatatypeProperty().getName())); - Boolean value = axiom.getValue(); - OWLDatatype booleanType = factory.getBooleanOWLDatatype(); - OWLTypedLiteral valueConstant = factory.getOWLTypedLiteral(value.toString(), booleanType); + boolean value = axiom.getValue(); + OWLLiteral valueConstant = factory.getOWLLiteral(value); OWLAxiom axiomOWLAPI = factory.getOWLDataPropertyAssertionAxiom(dp, i, valueConstant); addAxiom(axiomOWLAPI); } @@ -355,8 +353,7 @@ OWLIndividual i = factory.getOWLNamedIndividual(IRI.create(axiom.getIndividual().getName())); OWLDataProperty dp = factory.getOWLDataProperty(IRI.create(axiom.getDatatypeProperty().getName())); String value = axiom.getValue(); - OWLDatatype stringType = factory.getOWLDatatype(IRI.create("http://www.w3.org/2001/XMLSchema#string")); - OWLTypedLiteral valueConstant = factory.getOWLTypedLiteral(value.toString(), stringType); + OWLLiteral valueConstant = factory.getOWLLiteral(value); OWLAxiom axiomOWLAPI = factory.getOWLDataPropertyAssertionAxiom(dp, i, valueConstant); addAxiom(axiomOWLAPI); } Modified: trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIDescriptionConvertVisitor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIDescriptionConvertVisitor.java 2010-11-11 17:47:04 UTC (rev 2427) +++ trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIDescriptionConvertVisitor.java 2010-11-12 09:52:59 UTC (rev 2428) @@ -64,7 +64,6 @@ import org.semanticweb.owlapi.model.OWLIndividual; import org.semanticweb.owlapi.model.OWLLiteral; import org.semanticweb.owlapi.model.OWLObjectProperty; -import org.semanticweb.owlapi.model.OWLTypedLiteral; import org.semanticweb.owlapi.vocab.OWLFacet; import org.semanticweb.owlapi.vocab.XSDVocabulary; @@ -314,10 +313,10 @@ DatatypeProperty dp = (DatatypeProperty) description.getRestrictedPropertyExpression(); // currently only double restrictions implemented SimpleDoubleDataRange dr = (SimpleDoubleDataRange) description.getDataRange(); - Double value = dr.getValue(); + double value = dr.getValue(); OWLDatatype doubleDataType = factory.getOWLDatatype(XSDVocabulary.DOUBLE.getIRI()); - OWLTypedLiteral constant = factory.getOWLTypedLiteral(value.toString(), doubleDataType); + OWLLiteral constant = factory.getOWLLiteral(value); OWLFacet facet; if(dr instanceof DoubleMinValue) @@ -350,13 +349,13 @@ if(constant instanceof TypedConstant) { Datatype dt = ((TypedConstant)constant).getDatatype(); OWLDatatype odt = convertDatatype(dt); - owlConstant = factory.getOWLTypedLiteral(constant.getLiteral(), odt); + owlConstant = factory.getOWLLiteral(constant.getLiteral(), odt); } else { UntypedConstant uc = (UntypedConstant) constant; if(uc.hasLang()) { - owlConstant = factory.getOWLStringLiteral(uc.getLiteral(), uc.getLang()); + owlConstant = factory.getOWLLiteral(uc.getLiteral(), uc.getLang()); } else { - owlConstant = factory.getOWLStringLiteral(uc.getLiteral()); + owlConstant = factory.getOWLLiteral(uc.getLiteral(), ""); } } return owlConstant; Modified: trunk/components-core/src/test/java/org/dllearner/test/FaCTBugDemo.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/FaCTBugDemo.java 2010-11-11 17:47:04 UTC (rev 2427) +++ trunk/components-core/src/test/java/org/dllearner/test/FaCTBugDemo.java 2010-11-12 09:52:59 UTC (rev 2428) @@ -16,6 +16,7 @@ import org.semanticweb.owlapi.model.OWLOntology; import org.semanticweb.owlapi.model.OWLOntologyCreationException; import org.semanticweb.owlapi.model.OWLOntologyManager; +import org.semanticweb.owlapi.reasoner.InferenceType; import org.semanticweb.owlapi.reasoner.OWLReasoner; import uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasonerFactory; @@ -36,7 +37,7 @@ OWLReasoner reasoner = new FaCTPlusPlusReasonerFactory().createReasoner(ont); // OWLReasoner reasoner = new PelletReasonerFactory().createReasoner(ont);: - reasoner.prepareReasoner(); + reasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY, InferenceType.CLASS_ASSERTIONS); OWLDataFactory factory = manager.getOWLDataFactory(); Modified: trunk/components-core/src/test/java/org/dllearner/test/HermitTest.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/HermitTest.java 2010-11-11 17:47:04 UTC (rev 2427) +++ trunk/components-core/src/test/java/org/dllearner/test/HermitTest.java 2010-11-12 09:52:59 UTC (rev 2428) @@ -9,6 +9,7 @@ import org.semanticweb.owlapi.model.OWLOntologyCreationException; import org.semanticweb.owlapi.model.OWLOntologyManager; import org.semanticweb.owlapi.reasoner.ConsoleProgressMonitor; +import org.semanticweb.owlapi.reasoner.InferenceType; import org.semanticweb.owlapi.reasoner.OWLReasoner; import org.semanticweb.owlapi.reasoner.OWLReasonerConfiguration; import org.semanticweb.owlapi.reasoner.SimpleConfiguration; @@ -28,7 +29,7 @@ System.out.println("Using Pellet reasoner"); OWLReasoner pellet = PelletReasonerFactory.getInstance().createNonBufferingReasoner(ontology, conf); - pellet.prepareReasoner(); + pellet.precomputeInferences(InferenceType.CLASS_HIERARCHY, InferenceType.CLASS_ASSERTIONS); for(OWLIndividual ind : ontology.getIndividualsInSignature(true)){ System.out.println("Individual: " + ind); @@ -40,7 +41,7 @@ System.out.println("Using HermiT reasoner"); OWLReasoner hermit = new ReasonerFactory().createNonBufferingReasoner(ontology, conf); - hermit.prepareReasoner(); + hermit.precomputeInferences(InferenceType.CLASS_HIERARCHY, InferenceType.CLASS_ASSERTIONS); for(OWLIndividual ind : ontology.getIndividualsInSignature(true)){ System.out.println("Individual: " + ind); Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-11-11 17:47:04 UTC (rev 2427) +++ trunk/pom.xml 2010-11-12 09:52:59 UTC (rev 2428) @@ -95,13 +95,13 @@ <dependency> <groupId>net.sourceforge.owlapi</groupId> <artifactId>owlapi</artifactId> - <version>3.0.0</version> + <version>3.1.0</version> </dependency> <dependency> <groupId>com.owldl</groupId> <artifactId>pellet</artifactId> - <version>2.2.1</version> + <version>2.2.2</version> </dependency> <dependency> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |