From: <ku...@us...> - 2008-08-31 17:18:36
|
Revision: 1161 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1161&view=rev Author: kurzum Date: 2008-08-31 17:18:32 +0000 (Sun, 31 Aug 2008) Log Message: ----------- Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBible2.java Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java 2008-08-31 16:58:06 UTC (rev 1160) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlKnowledgeSource.java 2008-08-31 17:18:32 UTC (rev 1161) @@ -100,7 +100,7 @@ // private Set<String> classList; private String format = "N-TRIPLES"; private boolean dumpToFile = true; - private boolean convertNT2RDF = true ; + private boolean convertNT2RDF = false ; private boolean useLits = false; private boolean getAllSuperClasses = true; private boolean closeAfterRecursion = true; Modified: trunk/src/dl-learner/org/dllearner/scripts/SemanticBible2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SemanticBible2.java 2008-08-31 16:58:06 UTC (rev 1160) +++ trunk/src/dl-learner/org/dllearner/scripts/SemanticBible2.java 2008-08-31 17:18:32 UTC (rev 1161) @@ -45,6 +45,7 @@ import org.dllearner.utilities.datastructures.SetManipulation; import org.dllearner.utilities.owl.ReasoningServiceFactory; import org.dllearner.utilities.owl.ReasoningServiceFactory.AvailableReasoners; +import org.dllearner.utilities.statistics.SimpleClock; import com.jamonapi.Monitor; @@ -81,7 +82,13 @@ int max = 100; SortedSet<String> confs = getFilesContaining(useSPARQL,"ten","all", "99+"); analyzeFiles(confs); - Files.createFile(log, "accOnFragment"+del+"accOnOnt"+del+"timeFragme"+del+"timeWhole"+cr); + Files.createFile(log, + "accOnFragment"+del+ + "accOnOnt"+del+ + "timeFragme"+del+ + "coveredPos"+del+ + "coveredNeg"+del+ + "timeWhole"+cr); reasoningService = ReasoningServiceFactory.getReasoningService(ontologyPath, AvailableReasoners.OWLAPIREASONERPELLET); @@ -101,7 +108,9 @@ //System.out.println(tmpFile.getCanonicalPath()); Monitor m = JamonMonitorLogger.getTimeMonitor(SemanticBible2.class, "learn on fragment").start(); + SimpleClock sc = new SimpleClock(); Start.main(new String[] { tmpFilename }); + long time = sc.getTime(); m.stop(); LearningAlgorithm la = getLearningAlgorithm(); @@ -110,10 +119,16 @@ SortedSet<Individual> retrieved = reasoningService.retrieval(onFragment.getDescription()); EvaluatedDescription onOnto = reEvaluateDescription( onFragment.getDescription(), retrieved, posEx, negEx); + if(onOnto.getAccuracy()!=1.0){ + Files.appendFile(log, onOnto.toString()+"\n"); + } logLine += StringFormatter.doubleToPercent(onOnto.getAccuracy())+del; - logLine += m.getTotal()+del+"missing instead size of retrieve: "+retrieved.size()+cr; - Files.appendFile(log, logLine); - //Cache.getDefaultCache().clearCache(); + logLine += time+del; + logLine += StringFormatter.doubleToPercent((double)(onOnto.getCoveredPositives().size()/5))+del; + logLine += StringFormatter.doubleToPercent((double)((5-onOnto.getCoveredNegatives().size())/5))+del; + logLine += " size of retrieve: "+retrieved.size(); + Files.appendFile(log, logLine+cr); + Cache.getDefaultCache().clearCache(); cm.freeAllComponents(); @@ -122,7 +137,9 @@ e.printStackTrace(); } + logger.info("Finished"); + } public static EvaluatedDescription reEvaluateDescription(Description d, SortedSet<Individual> retrieved ,SortedSet<Individual> posEx ,SortedSet<Individual> negEx ){ @@ -243,7 +260,7 @@ "refexamples.useNegation = true;\n"+ "refexamples.useCardinalityRestrictions = true;\n"+ "refexamples.guaranteeXgoodDescriptions = 1;\n"+ - "refexamples.maxExecutionTimeInSeconds = 100;\n"+ + "\n"+ "reasoner = owlAPI;\n"+ //"reasoner = fastInstanceChecker;\n"+ @@ -266,6 +283,7 @@ public static String normalOptions (){ String s="\n"+ "import(\"NTNcombined.owl\");\n"+ + "refexamples.maxExecutionTimeInSeconds = 1800;\n"+ getCombinedOptions()+ ""; return s; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |