From: <jen...@us...> - 2011-08-05 13:47:14
|
Revision: 3009 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3009&view=rev Author: jenslehmann Date: 2011-08-05 13:47:08 +0000 (Fri, 05 Aug 2011) Log Message: ----------- improved eval script output Modified Paths: -------------- trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java Modified: trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java 2011-08-05 13:33:42 UTC (rev 3008) +++ trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java 2011-08-05 13:47:08 UTC (rev 3009) @@ -30,8 +30,10 @@ import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.TreeSet; import java.util.prefs.Preferences; @@ -83,12 +85,19 @@ private List<Class<? extends AxiomLearningAlgorithm>> objectPropertyAlgorithms; private List<Class<? extends AxiomLearningAlgorithm>> dataPropertyAlgorithms; + private String baseURI = "http://dbpedia.org/resource/"; + private Map<String,String> prefixes; + private Connection conn; private PreparedStatement ps; public EnrichmentEvaluation() { initDBConnection(); + prefixes = new HashMap<String,String>(); + prefixes.put("dbp","http://dbpedia.org/property/"); + prefixes.put("dbo","http://dbpedia.org/ontology/"); + objectPropertyAlgorithms = new LinkedList<Class<? extends AxiomLearningAlgorithm>>(); // objectPropertyAlgorithms.add(DisjointPropertyAxiomLearner.class); // objectPropertyAlgorithms.add(EquivalentPropertyAxiomLearner.class); @@ -193,14 +202,14 @@ List<EvaluatedAxiom> learnedAxioms = learner .getCurrentlyBestEvaluatedAxioms(nrOfAxiomsToLearn); if (learnedAxioms == null) { - writeToDB(property.toString(), algName, "NULL", 0, runTime); + writeToDB(property.toManchesterSyntaxString(baseURI, prefixes), algName, "NULL", 0, runTime); } else { for (EvaluatedAxiom learnedAxiom : learnedAxioms) { double score = learnedAxiom.getScore().getAccuracy(); if (Double.isNaN(score)) { score = -1; } - writeToDB(property.toString(), algName, learnedAxiom.getAxiom().toString(), + writeToDB(property.toManchesterSyntaxString(baseURI, prefixes) .toString(), algName, learnedAxiom.getAxiom().toManchesterSyntaxString(baseURI, prefixes), score, runTime); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |