From: <jen...@us...> - 2009-01-08 15:27:57
|
Revision: 1570 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1570&view=rev Author: jenslehmann Date: 2009-01-08 15:27:50 +0000 (Thu, 08 Jan 2009) Log Message: ----------- continued EL operator benchmark Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java 2009-01-07 15:56:02 UTC (rev 1569) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java 2009-01-08 15:27:50 UTC (rev 1570) @@ -401,7 +401,7 @@ } // TODO: variables have been renamed in article - private boolean asCheck(ELDescriptionNode v) { + public boolean asCheck(ELDescriptionNode v) { // System.out.println("asCheck: " + v.getTree().toSimulationString()); // find all edges up to the root node @@ -421,9 +421,9 @@ ObjectProperty rp = piVEdge.getLabel(); ELDescriptionNode w = wp.getParent(); -// System.out.println(w); -// System.out.println(rp); -// System.out.println(wp); +// System.out.println("w: " + w); +// System.out.println("rp: " + rp); +// System.out.println("wp: " + wp); // go through all (w,s,w'') for(ELDescriptionEdge wEdge : w.getEdges()) { @@ -432,7 +432,7 @@ if(wp != wpp && opHierarchy.isSubpropertyOf(rp, rpp)) { // System.out.println("wp: " + wp); // System.out.println("wpp: " + wpp); - if(wp.getOut().contains(wpp)) { + if(wp.getIn().contains(wpp)) { return false; } } Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java 2009-01-07 15:56:02 UTC (rev 1569) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java 2009-01-08 15:27:50 UTC (rev 1570) @@ -62,7 +62,7 @@ // logger.removeAllAppenders(); // logger.addAppender(app); - String example = "/home/jl/promotion/ontologien/galen2.owl"; + String example = "/home/jl/ontologien/galen2.owl"; testOntology(example); System.exit(0); @@ -131,11 +131,11 @@ System.out.println("done."); System.out.println(); - int outerLoops = 100; + int outerLoops = 1000; for(int loop = 0; loop < outerLoops; loop++) { // application of operator and statistics recording - int nrOfApplications = 10; + int nrOfApplications = 15; ELDescriptionTree currTree = new ELDescriptionTree(reasoner, Thing.instance); ELDown2 operator = new ELDown2(reasoner); Stat runtime = new Stat(); Modified: trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java 2009-01-07 15:56:02 UTC (rev 1569) +++ trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java 2009-01-08 15:27:50 UTC (rev 1570) @@ -32,11 +32,15 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.SimpleLayout; +import org.dllearner.algorithms.el.ELDescriptionNode; +import org.dllearner.algorithms.el.ELDescriptionTree; import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.ObjectProperty; import org.dllearner.kb.OWLFile; import org.dllearner.parser.KBParser; import org.dllearner.parser.ParseException; @@ -185,7 +189,7 @@ ComponentManager cm = ComponentManager.getInstance(); KnowledgeSource source = cm.knowledgeSource(OWLFile.class); - String ont = "/home/jl/promotion/ontologien/galen2.owl"; + String ont = "/home/jl/ontologien/galen2.owl"; cm.applyConfigEntry(source, "url", new File(ont).toURI().toURL()); source.init(); ReasonerComponent reasoner = cm.reasoner(OWLAPIReasoner.class, source); @@ -195,9 +199,40 @@ Description input = KBParser.parseConcept("(\"http://www.co-ode.org/ontologies/galen#15.0\" AND (\"http://www.co-ode.org/ontologies/galen#30.0\" AND (EXISTS \"http://www.co-ode.org/ontologies/galen#Attribute\".\"http://www.co-ode.org/ontologies/galen#5.0\" AND EXISTS \"http://www.co-ode.org/ontologies/galen#Attribute\".\"http://www.co-ode.org/ontologies/galen#6.0\")))"); ConceptTransformation.cleanConcept(input); - RefinementOperator operator = new ELDown2(reasoner); + ELDown2 operator = new ELDown2(reasoner); operator.refine(input); + + } + @Test + public void asTest() throws ComponentInitException, MalformedURLException { + + ComponentManager cm = ComponentManager.getInstance(); + KnowledgeSource source = cm.knowledgeSource(OWLFile.class); + String ont = "/home/jl/ontologien/galen2.owl"; + cm.applyConfigEntry(source, "url", new File(ont).toURI().toURL()); + source.init(); + ReasonerComponent reasoner = cm.reasoner(OWLAPIReasoner.class, source); + reasoner.init(); + System.out.println("Galen loaded."); + + ELDescriptionTree tree = new ELDescriptionTree(reasoner); + NamedClass a1 = new NamedClass("http://www.co-ode.org/ontologies/galen#1.0"); + NamedClass a2 = new NamedClass("http://www.co-ode.org/ontologies/galen#10.0"); + NamedClass a3 = new NamedClass("http://www.co-ode.org/ontologies/galen#6.0"); + NamedClass a4 = new NamedClass("http://www.co-ode.org/ontologies/galen#TopCategory"); + ObjectProperty r1 = new ObjectProperty("http://www.co-ode.org/ontologies/galen#Attribute"); + ObjectProperty r2 = new ObjectProperty("http://www.co-ode.org/ontologies/galen#DomainAttribute"); + ELDescriptionNode v1 = new ELDescriptionNode(tree, a1, a2); + ELDescriptionNode v2 = new ELDescriptionNode(v1, r2, a1, a3, a4); + ELDescriptionNode v3 = new ELDescriptionNode(v1, r1, a1, a4); + new ELDescriptionNode(v3, r1); + + ELDescriptionNode w = new ELDescriptionNode(v2, r1); + + ELDown2 operator = new ELDown2(reasoner); + System.out.println(operator.asCheck(w)); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |