From: <lor...@us...> - 2012-03-29 13:09:10
|
Revision: 3624 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3624&view=rev Author: lorenz_b Date: 2012-03-29 13:09:03 +0000 (Thu, 29 Mar 2012) Log Message: ----------- Removed dependencies to SESAME. Changed some examples by reducing execution time. Fixed Unit test to ignore SPARQL examples correctly. Modified Paths: -------------- trunk/components-core/pom.xml trunk/components-core/src/main/java/org/dllearner/algorithms/DisjointClassesLearner.java trunk/components-core/src/main/java/org/dllearner/core/AbstractAxiomLearningAlgorithm.java trunk/components-core/src/main/java/org/dllearner/utilities/StructureBasedRootClassFinder.java trunk/examples/carcinogenesis/train.conf trunk/examples/family-benchmark/Aunt.conf trunk/interfaces/src/test/java/org/dllearner/test/junit/ExampleTests.java Modified: trunk/components-core/pom.xml =================================================================== --- trunk/components-core/pom.xml 2012-03-27 15:09:17 UTC (rev 3623) +++ trunk/components-core/pom.xml 2012-03-29 13:09:03 UTC (rev 3624) @@ -106,6 +106,10 @@ <artifactId>xercesImpl</artifactId> <groupId>xerces</groupId> </exclusion> + <exclusion> + <artifactId>any23-core</artifactId> + <groupId>org.deri.any23</groupId> + </exclusion> </exclusions> </dependency> Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/DisjointClassesLearner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/DisjointClassesLearner.java 2012-03-27 15:09:17 UTC (rev 3623) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/DisjointClassesLearner.java 2012-03-29 13:09:03 UTC (rev 3624) @@ -21,10 +21,8 @@ import java.net.URL; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -46,11 +44,8 @@ import org.dllearner.core.owl.NamedClass; import org.dllearner.kb.LocalModelBasedSparqlEndpointKS; import org.dllearner.kb.SparqlEndpointKS; -import org.dllearner.kb.sparql.SparqlEndpoint; import org.dllearner.learningproblems.AxiomScore; import org.dllearner.learningproblems.Heuristics; -import org.openrdf.model.vocabulary.OWL; -import org.openrdf.model.vocabulary.RDF; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -61,6 +56,8 @@ import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.vocabulary.OWL2; +import com.hp.hpl.jena.vocabulary.RDF; /** * Learns disjoint classes using SPARQL queries. @@ -340,7 +337,7 @@ //secondly, create disjoint classexpressions with score 1 - (#occurence/#all) for(Entry<NamedClass, Integer> entry : sortByValues(class2Count)){ //drop classes from OWL and RDF namespace - if(entry.getKey().getName().startsWith(OWL.NAMESPACE) || entry.getKey().getName().startsWith(RDF.NAMESPACE))continue; + if(entry.getKey().getName().startsWith(OWL2.getURI()) || entry.getKey().getName().startsWith(RDF.getURI()))continue; // evalDesc = new EvaluatedDescription(entry.getKey(), // new AxiomScore(1 - (entry.getValue() / (double)all))); double[] confidenceInterval = Heuristics.getConfidenceInterval95Wald(total, entry.getValue()); Modified: trunk/components-core/src/main/java/org/dllearner/core/AbstractAxiomLearningAlgorithm.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/AbstractAxiomLearningAlgorithm.java 2012-03-27 15:09:17 UTC (rev 3623) +++ trunk/components-core/src/main/java/org/dllearner/core/AbstractAxiomLearningAlgorithm.java 2012-03-29 13:09:03 UTC (rev 3624) @@ -44,9 +44,6 @@ import org.dllearner.learningproblems.Heuristics; import org.dllearner.reasoning.SPARQLReasoner; import org.dllearner.utilities.owl.AxiomComparator; -import org.openrdf.model.vocabulary.OWL; -import org.openrdf.model.vocabulary.RDF; -import org.openrdf.model.vocabulary.RDFS; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -58,6 +55,9 @@ import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP; import com.hp.hpl.jena.util.iterator.Filter; +import com.hp.hpl.jena.vocabulary.OWL2; +import com.hp.hpl.jena.vocabulary.RDF; +import com.hp.hpl.jena.vocabulary.RDFS; /** * @author Lorenz Bühmann @@ -334,7 +334,7 @@ @Override public boolean accept(OntClass cls) { if(!cls.isAnon()){ - return cls.getURI().startsWith(OWL.NAMESPACE); + return cls.getURI().startsWith(OWL2.getURI()); } return false; } @@ -346,7 +346,7 @@ @Override public boolean accept(OntClass cls) { if(!cls.isAnon()){ - return cls.getURI().startsWith(RDFS.NAMESPACE); + return cls.getURI().startsWith(RDFS.getURI()); } return false; } @@ -358,7 +358,7 @@ @Override public boolean accept(OntClass cls) { if(!cls.isAnon()){ - return cls.getURI().startsWith(RDF.NAMESPACE); + return cls.getURI().startsWith(RDF.getURI()); } return false; } Modified: trunk/components-core/src/main/java/org/dllearner/utilities/StructureBasedRootClassFinder.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/StructureBasedRootClassFinder.java 2012-03-27 15:09:17 UTC (rev 3623) +++ trunk/components-core/src/main/java/org/dllearner/utilities/StructureBasedRootClassFinder.java 2012-03-29 13:09:03 UTC (rev 3624) @@ -8,7 +8,6 @@ import java.util.Map; import java.util.Set; -import org.apache.commons.httpclient.methods.GetMethod; import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.model.AddAxiom; import org.semanticweb.owlapi.model.AxiomType; @@ -47,10 +46,6 @@ import org.semanticweb.owlapi.reasoner.OWLReasoner; import org.semanticweb.owlapi.reasoner.OWLReasonerFactory; -import uk.ac.manchester.cs.owlapi.modularity.ModuleType; - -import com.clarkparsia.modularity.ModularityUtils; -import com.clarkparsia.owlapi.modularity.locality.LocalityClass; import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory; public class StructureBasedRootClassFinder implements RootClassFinder, OWLClassExpressionVisitor { Modified: trunk/examples/carcinogenesis/train.conf =================================================================== --- trunk/examples/carcinogenesis/train.conf 2012-03-27 15:09:17 UTC (rev 3623) +++ trunk/examples/carcinogenesis/train.conf 2012-03-29 13:09:03 UTC (rev 3624) @@ -355,7 +355,7 @@ "kb:d335" } -op.type = "syncrho" +op.type = "rho" op.cardinalityLimit = 5 // CELOE configuration @@ -366,7 +366,7 @@ alg.writeSearchTree = false alg.noisePercentage = 32 alg.startClass = "http://dl-learner.org/carcinogenesis#Compound" -alg.maxExecutionTimeInSeconds = 1800 +alg.maxExecutionTimeInSeconds = 100 //alg.maxClassDescriptionTests = 10000000 // PCELOE configuration Modified: trunk/examples/family-benchmark/Aunt.conf =================================================================== --- trunk/examples/family-benchmark/Aunt.conf 2012-03-27 15:09:17 UTC (rev 3623) +++ trunk/examples/family-benchmark/Aunt.conf 2012-03-29 13:09:03 UTC (rev 3624) @@ -17,7 +17,7 @@ h.type ="celoe_heuristic" h.expansionPenaltyFactor = 0.02 alg.type = "celoe" -alg.maxExecutionTimeInSeconds = 200 +alg.maxExecutionTimeInSeconds = 100 alg.terminateOnNoiseReached = true Modified: trunk/interfaces/src/test/java/org/dllearner/test/junit/ExampleTests.java =================================================================== --- trunk/interfaces/src/test/java/org/dllearner/test/junit/ExampleTests.java 2012-03-27 15:09:17 UTC (rev 3623) +++ trunk/interfaces/src/test/java/org/dllearner/test/junit/ExampleTests.java 2012-03-29 13:09:03 UTC (rev 3624) @@ -163,13 +163,13 @@ // start example CLI start = new CLI(new File(conf)); start.init(); - start.run(); // System.out.println("algorithm: " + start.getLearningAlgorithm()); boolean isSparql = start.getKnowledgeSource() instanceof SparqlKnowledgeSource; // boolean isSparql = false; LearningAlgorithm algorithm = start.getLearningAlgorithm(); if((testGP || !(algorithm instanceof GP)) && (sparql == 0 || (sparql == 1 && isSparql) || (sparql == 2 && !isSparql) ) ) { + start.run(); started = true; // start.start(false); // test is successful if a concept was learned This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |