From: <lor...@us...> - 2014-01-29 14:25:23
|
Revision: 4215 http://sourceforge.net/p/dl-learner/code/4215 Author: lorenz_b Date: 2014-01-29 14:25:19 +0000 (Wed, 29 Jan 2014) Log Message: ----------- Some modifications due to refactoring of neg. examples finder. Modified Paths: -------------- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java trunk/interfaces/src/main/java/org/dllearner/server/EnrichmentServlet.java trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluationMultithreaded.java trunk/test/isle/swore/ontology_with_comments.owl Modified: trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2014-01-29 14:24:16 UTC (rev 4214) +++ trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2014-01-29 14:25:19 UTC (rev 4215) @@ -205,7 +205,7 @@ cli.setContext(context); cli.setConfFile(file); cli.run(); - } catch (Exception e) { + } catch (Exception e) {e.printStackTrace(); String stacktraceFileName = "log/error.log"; // e.printStackTrace(); Modified: trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java 2014-01-29 14:24:16 UTC (rev 4214) +++ trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java 2014-01-29 14:25:19 UTC (rev 4215) @@ -879,7 +879,7 @@ } private void filter(Model model) { - // filter out triples with String literals, as there often occur + // filter out triples with String literals, as therein often occur // some syntax errors and they are not relevant for learning List<Statement> statementsToRemove = new ArrayList<Statement>(); List<Statement> statementsToAdd = new ArrayList<Statement>(); Modified: trunk/interfaces/src/main/java/org/dllearner/server/EnrichmentServlet.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/EnrichmentServlet.java 2014-01-29 14:24:16 UTC (rev 4214) +++ trunk/interfaces/src/main/java/org/dllearner/server/EnrichmentServlet.java 2014-01-29 14:25:19 UTC (rev 4215) @@ -436,12 +436,10 @@ long startTime = System.currentTimeMillis(); System.out.print("finding negatives ... "); AutomaticNegativeExampleFinderSPARQL2 finder = new AutomaticNegativeExampleFinderSPARQL2(ks.getEndpoint()); - SortedSet<String> negExStr = finder.getNegativeExamples(nc.getName(), posExStr); - negExStr = SetManipulation.fuzzyShrink(negExStr, 20); - SortedSet<Individual> negExamples = Helper.getIndividualSet(negExStr); + SortedSet<Individual> negExamples = finder.getNegativeExamples(nc, posExamples, 20); SortedSetTuple<Individual> examples = new SortedSetTuple<Individual>(posExamples, negExamples); long runTime = System.currentTimeMillis() - startTime; - System.out.println("done (" + negExStr.size()+ " examples fround in " + runTime + " ms)"); + System.out.println("done (" + negExamples.size()+ " examples fround in " + runTime + " ms)"); SparqlKnowledgeSource ks2; AbstractReasonerComponent rc; Modified: trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java 2014-01-29 14:24:16 UTC (rev 4214) +++ trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java 2014-01-29 14:25:19 UTC (rev 4215) @@ -639,18 +639,14 @@ // get instances of class as positive examples SPARQLReasoner sr = new SPARQLReasoner(ks); SortedSet<Individual> posExamples = sr.getIndividuals(nc, 20); - SortedSet<String> posExStr = Helper.getStringSet(posExamples); // get negative examples via various strategies System.out.print("finding negatives ... "); AutomaticNegativeExampleFinderSPARQL2 finder = new AutomaticNegativeExampleFinderSPARQL2(ks.getEndpoint()); - SortedSet<String> negExStr = finder.getNegativeExamples(nc.getName(), posExStr); - negExStr = SetManipulation.fuzzyShrink(negExStr, 20); - SortedSet<Individual> negExamples = Helper.getIndividualSet(negExStr); + SortedSet<Individual> negExamples = finder.getNegativeExamples(nc, posExamples, 20); SortedSetTuple<Individual> examples = new SortedSetTuple<Individual>(posExamples, negExamples); + System.out.println("done (" + negExamples.size()+ ")"); - System.out.println("done (" + negExStr.size()+ ")"); - ComponentManager cm = ComponentManager.getInstance(); SparqlKnowledgeSource ks2 = cm.knowledgeSource(SparqlKnowledgeSource.class); Modified: trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluationMultithreaded.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluationMultithreaded.java 2014-01-29 14:24:16 UTC (rev 4214) +++ trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluationMultithreaded.java 2014-01-29 14:25:19 UTC (rev 4215) @@ -645,20 +645,16 @@ private List<EvaluatedAxiom> applyCELOE(SparqlEndpointKS ks, NamedClass nc, boolean equivalence) throws ComponentInitException { // get instances of class as positive examples - SPARQLReasoner sr = new SPARQLReasoner(ks); - SortedSet<Individual> posExamples = sr.getIndividuals(nc, 20); - SortedSet<String> posExStr = Helper.getStringSet(posExamples); + SPARQLReasoner sr = new SPARQLReasoner(ks); + SortedSet<Individual> posExamples = sr.getIndividuals(nc, 20); + + // get negative examples via various strategies + System.out.print("finding negatives ... "); + AutomaticNegativeExampleFinderSPARQL2 finder = new AutomaticNegativeExampleFinderSPARQL2(ks.getEndpoint()); + SortedSet<Individual> negExamples = finder.getNegativeExamples(nc, posExamples, 20); + SortedSetTuple<Individual> examples = new SortedSetTuple<Individual>(posExamples, negExamples); + System.out.println("done (" + negExamples.size()+ ")"); - // get negative examples via various strategies - System.out.print("finding negatives ... "); - AutomaticNegativeExampleFinderSPARQL2 finder = new AutomaticNegativeExampleFinderSPARQL2(ks.getEndpoint()); - SortedSet<String> negExStr = finder.getNegativeExamples(nc.getName(), posExStr); - negExStr = SetManipulation.fuzzyShrink(negExStr, 20); - SortedSet<Individual> negExamples = Helper.getIndividualSet(negExStr); - SortedSetTuple<Individual> examples = new SortedSetTuple<Individual>(posExamples, negExamples); - - System.out.println("done (" + negExStr.size()+ ")"); - ComponentManager cm = ComponentManager.getInstance(); SparqlKnowledgeSource ks2 = cm.knowledgeSource(SparqlKnowledgeSource.class); Modified: trunk/test/isle/swore/ontology_with_comments.owl =================================================================== --- trunk/test/isle/swore/ontology_with_comments.owl 2014-01-29 14:24:16 UTC (rev 4214) +++ trunk/test/isle/swore/ontology_with_comments.owl 2014-01-29 14:25:19 UTC (rev 4215) @@ -430,11 +430,20 @@ <!-- http://purl.org/dc/elements/1.1/description --> - <owl:ObjectProperty rdf:about="&dc;description"> + <owl:DatatypeProperty rdf:about="&dc;description"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> <rdfs:label rdf:datatype="&xsd;string">description</rdfs:label> <rdfs:label xml:lang="de">Beschreibung</rdfs:label> <rdfs:range rdf:resource="&xsd;string"/> - </owl:ObjectProperty> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <rdf:Description rdf:about="&req;Goal"/> + <rdf:Description rdf:about="&req;Requirement"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + </owl:DatatypeProperty> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |