You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(120) |
Sep
(36) |
Oct
(116) |
Nov
(17) |
Dec
(44) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(143) |
Feb
(192) |
Mar
(74) |
Apr
(84) |
May
(105) |
Jun
(64) |
Jul
(49) |
Aug
(120) |
Sep
(159) |
Oct
(156) |
Nov
(51) |
Dec
(28) |
2009 |
Jan
(17) |
Feb
(55) |
Mar
(33) |
Apr
(57) |
May
(54) |
Jun
(28) |
Jul
(6) |
Aug
(16) |
Sep
(38) |
Oct
(30) |
Nov
(26) |
Dec
(52) |
2010 |
Jan
(7) |
Feb
(91) |
Mar
(65) |
Apr
(2) |
May
(14) |
Jun
(25) |
Jul
(38) |
Aug
(48) |
Sep
(80) |
Oct
(70) |
Nov
(75) |
Dec
(77) |
2011 |
Jan
(68) |
Feb
(53) |
Mar
(51) |
Apr
(35) |
May
(65) |
Jun
(101) |
Jul
(29) |
Aug
(230) |
Sep
(95) |
Oct
(49) |
Nov
(110) |
Dec
(63) |
2012 |
Jan
(41) |
Feb
(42) |
Mar
(25) |
Apr
(46) |
May
(51) |
Jun
(44) |
Jul
(45) |
Aug
(29) |
Sep
(12) |
Oct
(9) |
Nov
(17) |
Dec
(2) |
2013 |
Jan
(12) |
Feb
(14) |
Mar
(7) |
Apr
(16) |
May
(54) |
Jun
(27) |
Jul
(11) |
Aug
(5) |
Sep
(85) |
Oct
(27) |
Nov
(37) |
Dec
(32) |
2014 |
Jan
(8) |
Feb
(29) |
Mar
(5) |
Apr
(3) |
May
(22) |
Jun
(3) |
Jul
(4) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <lor...@us...> - 2014-05-02 19:25:08
|
Revision: 4259 http://sourceforge.net/p/dl-learner/code/4259 Author: lorenz_b Date: 2014-05-02 19:25:05 +0000 (Fri, 02 May 2014) Log Message: ----------- Bug fix. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/kb/sparql/ConciseBoundedDescriptionGeneratorImpl.java Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/ConciseBoundedDescriptionGeneratorImpl.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/ConciseBoundedDescriptionGeneratorImpl.java 2014-05-02 19:22:37 UTC (rev 4258) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/ConciseBoundedDescriptionGeneratorImpl.java 2014-05-02 19:25:05 UTC (rev 4259) @@ -42,6 +42,14 @@ this(endpoint, cache.getCacheDirectory(), maxRecursionDepth); } + public ConciseBoundedDescriptionGeneratorImpl(SparqlEndpoint endpoint, CacheEx cache) { + qef = new QueryExecutionFactoryHttp(endpoint.getURL().toString(), endpoint.getDefaultGraphURIs()); + if(cache != null){ + qef = new QueryExecutionFactoryCacheEx(qef, cache); + } + qef = new QueryExecutionFactoryPaginated(qef, 10000); + } + public ConciseBoundedDescriptionGeneratorImpl(SparqlEndpoint endpoint, String cacheDir, int maxRecursionDepth) { this.maxRecursionDepth = maxRecursionDepth; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2014-05-02 19:22:40
|
Revision: 4258 http://sourceforge.net/p/dl-learner/code/4258 Author: lorenz_b Date: 2014-05-02 19:22:37 +0000 (Fri, 02 May 2014) Log Message: ----------- Added method to get score object. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/core/EvaluatedDescription.java Modified: trunk/components-core/src/main/java/org/dllearner/core/EvaluatedDescription.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/EvaluatedDescription.java 2014-05-02 19:21:56 UTC (rev 4257) +++ trunk/components-core/src/main/java/org/dllearner/core/EvaluatedDescription.java 2014-05-02 19:22:37 UTC (rev 4258) @@ -69,6 +69,13 @@ } /** + * @return the score + */ + public Score getScore() { + return score; + } + + /** * Used for rewriting (simplification, beautification) of * evaluated descriptions returned by the learning algorithm. * @param description The description to set. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2014-05-02 19:21:59
|
Revision: 4257 http://sourceforge.net/p/dl-learner/code/4257 Author: lorenz_b Date: 2014-05-02 19:21:56 +0000 (Fri, 02 May 2014) Log Message: ----------- Added score for query trees. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/learningproblems/ScoreTwoValued.java Added Paths: ----------- trunk/components-core/src/main/java/org/dllearner/learningproblems/QueryTreeScore.java Added: trunk/components-core/src/main/java/org/dllearner/learningproblems/QueryTreeScore.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/QueryTreeScore.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/QueryTreeScore.java 2014-05-02 19:21:56 UTC (rev 4257) @@ -0,0 +1,86 @@ +/** + * + */ +package org.dllearner.learningproblems; + +import java.util.Set; + +import org.dllearner.core.Score; +import org.dllearner.core.owl.Individual; + +/** + * @author Lorenz Buehmann + * + */ +public class QueryTreeScore extends Score { + + private double score; + + private double coverageScore; + + private double specifityScore; + private int nrOfSpecificNodes; + + private Set<Individual> posAsPos; + private Set<Individual> posAsNeg; + private Set<Individual> negAsPos; + private Set<Individual> negAsNeg; + + public QueryTreeScore(double score, double coverageScore, + Set<Individual> posAsPos, Set<Individual> posAsNeg, Set<Individual> negAsPos, Set<Individual> negAsNeg, + double specifityScore, int nrOfSpecificNodes) { + super(); + this.score = score; + this.coverageScore = coverageScore; + this.posAsPos = posAsPos; + this.posAsNeg = posAsNeg; + this.negAsPos = negAsPos; + this.negAsNeg = negAsNeg; + this.specifityScore = specifityScore; + this.nrOfSpecificNodes = nrOfSpecificNodes; + } + + /** + * @return the score + */ + public double getScore() { + return score; + } + + /* (non-Javadoc) + * @see org.dllearner.core.Score#getAccuracy() + */ + @Override + public double getAccuracy() { + return score; + } + + public Set<Individual> getCoveredNegatives() { + return negAsPos; + } + + public Set<Individual> getCoveredPositives() { + return posAsPos; + } + + public Set<Individual> getNotCoveredPositives() { + return posAsNeg; + } + + public Set<Individual> getNotCoveredNegatives() { + return negAsNeg; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return score + + "(coverage=" + coverageScore + + "(+" + posAsPos.size() + "/" + (posAsPos.size() + posAsNeg.size()) + + "|-" + negAsPos.size() + "/" + (negAsPos.size() + negAsNeg.size()) + ")|" + + "specifity=" + specifityScore + "(" + nrOfSpecificNodes + "))"; + } + +} Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/ScoreTwoValued.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/ScoreTwoValued.java 2014-05-02 19:20:23 UTC (rev 4256) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/ScoreTwoValued.java 2014-05-02 19:21:56 UTC (rev 4257) @@ -136,5 +136,12 @@ public ScorePosNeg getModifiedLengthScore(int newLength) { return new ScoreTwoValued(newLength, percentPerLengthUnit, posAsPos, posAsNeg, negAsPos, negAsNeg); } + + /** + * @param accuracy the accuracy to set + */ + public void setAccuracy(double accuracy) { + this.accuracy = accuracy; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2014-05-02 19:20:25
|
Revision: 4256 http://sourceforge.net/p/dl-learner/code/4256 Author: lorenz_b Date: 2014-05-02 19:20:23 +0000 (Fri, 02 May 2014) Log Message: ----------- Added more data range support. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/utilities/owl/DLLearnerDescriptionConvertVisitor.java trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIDescriptionConvertVisitor.java Added Paths: ----------- trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLDataRangeConverter.java Modified: trunk/components-core/src/main/java/org/dllearner/utilities/owl/DLLearnerDescriptionConvertVisitor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/owl/DLLearnerDescriptionConvertVisitor.java 2014-05-02 19:18:34 UTC (rev 4255) +++ trunk/components-core/src/main/java/org/dllearner/utilities/owl/DLLearnerDescriptionConvertVisitor.java 2014-05-02 19:20:23 UTC (rev 4256) @@ -23,12 +23,14 @@ import java.util.List; import java.util.Stack; +import org.dllearner.core.owl.Constant; import org.dllearner.core.owl.DataRange; import org.dllearner.core.owl.DatatypeExactCardinalityRestriction; import org.dllearner.core.owl.DatatypeMaxCardinalityRestriction; import org.dllearner.core.owl.DatatypeMinCardinalityRestriction; import org.dllearner.core.owl.DatatypeProperty; import org.dllearner.core.owl.DatatypeSomeRestriction; +import org.dllearner.core.owl.DatatypeValueRestriction; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.Intersection; @@ -55,6 +57,7 @@ import org.semanticweb.owlapi.model.OWLDataMaxCardinality; import org.semanticweb.owlapi.model.OWLDataMinCardinality; import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom; +import org.semanticweb.owlapi.model.OWLDatatypeRestriction; import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; import org.semanticweb.owlapi.model.OWLObjectComplementOf; import org.semanticweb.owlapi.model.OWLObjectExactCardinality; @@ -191,7 +194,7 @@ public void visit(OWLDataSomeValuesFrom description) { DatatypeProperty property = new DatatypeProperty(description.getProperty().asOWLDataProperty() .getIRI().toString()); - DataRange dataRange = OWLAPIConverter.convertDatatype(description.getFiller().asOWLDatatype()); + DataRange dataRange = OWLDataRangeConverter.convert(description.getFiller()); stack.push(new DatatypeSomeRestriction(property, dataRange)); } @@ -206,20 +209,16 @@ @Override public void visit(OWLDataHasValue description) { -// DatatypeProperty property = new DatatypeProperty(description.getProperty().asOWLDataProperty() -// .getURI().toString()); -// Constant c = OWLAPIConverter.convertConstant(description.getValue()); -// -// DataRange dataRange = OWLAPIConverter.convertDatatype(description.getFiller().asOWLDataType()); -// stack.push(new DatatypeValueRestriction(property, dataRange)); - + DatatypeProperty property = new DatatypeProperty(description.getProperty().asOWLDataProperty().getIRI().toString()); + Constant value = OWLAPIConverter.convertConstant(description.getValue()); + stack.push(new DatatypeValueRestriction(property, value)); } @Override public void visit(OWLDataMinCardinality description) { DatatypeProperty property = new DatatypeProperty(description.getProperty().asOWLDataProperty() .getIRI().toString()); - DataRange dataRange = OWLAPIConverter.convertDatatype(description.getFiller().asOWLDatatype()); + DataRange dataRange = OWLDataRangeConverter.convert(description.getFiller()); int min = description.getCardinality(); stack.push(new DatatypeMinCardinalityRestriction(property, dataRange,min)); @@ -229,7 +228,7 @@ public void visit(OWLDataExactCardinality description) { DatatypeProperty property = new DatatypeProperty(description.getProperty().asOWLDataProperty() .getIRI().toString()); - DataRange dataRange = OWLAPIConverter.convertDatatype(description.getFiller().asOWLDatatype()); + DataRange dataRange = OWLDataRangeConverter.convert(description.getFiller()); int minmax = description.getCardinality(); stack.push(new DatatypeExactCardinalityRestriction(property, dataRange, minmax)); @@ -239,7 +238,7 @@ public void visit(OWLDataMaxCardinality description) { DatatypeProperty property = new DatatypeProperty(description.getProperty().asOWLDataProperty() .getIRI().toString()); - DataRange dataRange = OWLAPIConverter.convertDatatype(description.getFiller().asOWLDatatype()); + DataRange dataRange = OWLDataRangeConverter.convert(description.getFiller()); int max = description.getCardinality(); stack.push(new DatatypeMaxCardinalityRestriction(property, dataRange, max)); Modified: trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIDescriptionConvertVisitor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIDescriptionConvertVisitor.java 2014-05-02 19:18:34 UTC (rev 4255) +++ trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAPIDescriptionConvertVisitor.java 2014-05-02 19:20:23 UTC (rev 4256) @@ -35,6 +35,7 @@ import org.dllearner.core.owl.DatatypeValueRestriction; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.DescriptionVisitor; +import org.dllearner.core.owl.DoubleMinMaxRange; import org.dllearner.core.owl.DoubleMinValue; import org.dllearner.core.owl.Intersection; import org.dllearner.core.owl.NamedClass; @@ -334,6 +335,10 @@ facet = OWLFacet.MAX_INCLUSIVE; owlDataRange = factory.getOWLDatatypeRestriction(doubleDataType, facet, constant); + } else if(dataRange instanceof DoubleMinMaxRange){ + // currently only double restrictions implemented + owlDataRange = factory.getOWLDatatypeMinMaxInclusiveRestriction( + ((DoubleMinMaxRange) dataRange).getMinValue(), ((DoubleMinMaxRange) dataRange).getMaxValue()); } else { throw new UnsupportedOperationException("Can not convert " + description); } Added: trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLDataRangeConverter.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLDataRangeConverter.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLDataRangeConverter.java 2014-05-02 19:20:23 UTC (rev 4256) @@ -0,0 +1,113 @@ +/** + * + */ +package org.dllearner.utilities.owl; + +import java.util.HashSet; +import java.util.Set; + +import org.dllearner.core.owl.Constant; +import org.dllearner.core.owl.DataOneOf; +import org.dllearner.core.owl.DataRange; +import org.dllearner.core.owl.DoubleMaxValue; +import org.dllearner.core.owl.DoubleMinMaxRange; +import org.dllearner.core.owl.DoubleMinValue; +import org.semanticweb.owlapi.model.OWLDataComplementOf; +import org.semanticweb.owlapi.model.OWLDataIntersectionOf; +import org.semanticweb.owlapi.model.OWLDataOneOf; +import org.semanticweb.owlapi.model.OWLDataRange; +import org.semanticweb.owlapi.model.OWLDataRangeVisitor; +import org.semanticweb.owlapi.model.OWLDataUnionOf; +import org.semanticweb.owlapi.model.OWLDatatype; +import org.semanticweb.owlapi.model.OWLDatatypeRestriction; +import org.semanticweb.owlapi.model.OWLFacetRestriction; +import org.semanticweb.owlapi.model.OWLLiteral; +import org.semanticweb.owlapi.vocab.OWLFacet; + +/** + * @author Lorenz Buehmann + * + */ +public class OWLDataRangeConverter implements OWLDataRangeVisitor{ + + private DataRange dataRange; + + public static DataRange convert(OWLDataRange owlDataRange){ + OWLDataRangeConverter converter = new OWLDataRangeConverter(); + owlDataRange.accept(converter); + return converter.dataRange; + } + + /* (non-Javadoc) + * @see org.semanticweb.owlapi.model.OWLDataRangeVisitor#visit(org.semanticweb.owlapi.model.OWLDatatype) + */ + @Override + public void visit(OWLDatatype datatype) { + dataRange = OWLAPIConverter.convertDatatype(datatype); + } + + /* (non-Javadoc) + * @see org.semanticweb.owlapi.model.OWLDataRangeVisitor#visit(org.semanticweb.owlapi.model.OWLDataOneOf) + */ + @Override + public void visit(OWLDataOneOf dataOneOf) { + Set<OWLLiteral> owlLiterals = dataOneOf.getValues(); + Set<Constant> constants = new HashSet<Constant>(owlLiterals.size()); + for (OWLLiteral owlLiteral : owlLiterals) { + constants.add(OWLAPIConverter.convertConstant(owlLiteral)); + } + dataRange = new DataOneOf(constants); + } + + /* (non-Javadoc) + * @see org.semanticweb.owlapi.model.OWLDataRangeVisitor#visit(org.semanticweb.owlapi.model.OWLDataComplementOf) + */ + @Override + public void visit(OWLDataComplementOf arg0) { + } + + /* (non-Javadoc) + * @see org.semanticweb.owlapi.model.OWLDataRangeVisitor#visit(org.semanticweb.owlapi.model.OWLDataIntersectionOf) + */ + @Override + public void visit(OWLDataIntersectionOf arg0) { + } + + /* (non-Javadoc) + * @see org.semanticweb.owlapi.model.OWLDataRangeVisitor#visit(org.semanticweb.owlapi.model.OWLDataUnionOf) + */ + @Override + public void visit(OWLDataUnionOf arg0) { + } + + /* (non-Javadoc) + * @see org.semanticweb.owlapi.model.OWLDataRangeVisitor#visit(org.semanticweb.owlapi.model.OWLDatatypeRestriction) + */ + @Override + public void visit(OWLDatatypeRestriction restriction) { + Set<OWLFacetRestriction> facetRestrictions = restriction.getFacetRestrictions(); + Constant min = null; + Constant max = null; + for (OWLFacetRestriction facetRestriction : facetRestrictions) { + OWLFacet facet = facetRestriction.getFacet(); + OWLLiteral value = facetRestriction.getFacetValue(); + if(facet == OWLFacet.MIN_INCLUSIVE){ + min = OWLAPIConverter.convertConstant(value); + } else if(facet == OWLFacet.MAX_INCLUSIVE){ + max = OWLAPIConverter.convertConstant(value); + } + } + double minValue = Double.parseDouble(min.getLiteral()); + double maxValue = Double.parseDouble(max.getLiteral()); + if(min != null && max != null){ + dataRange = new DoubleMinMaxRange(minValue, maxValue); + } else if(min != null && max == null){ + dataRange = new DoubleMinValue(minValue); + } else if(max != null && min == null){ + dataRange = new DoubleMaxValue(maxValue); + } else { + + } + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2014-05-02 19:18:37
|
Revision: 4255 http://sourceforge.net/p/dl-learner/code/4255 Author: lorenz_b Date: 2014-05-02 19:18:34 +0000 (Fri, 02 May 2014) Log Message: ----------- Continued disjunctive version of QTL. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2Disjunctive.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/impl/QueryTreeImpl.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/EvaluatedQueryTree.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGGMultithreaded.java Added Paths: ----------- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/rendering/ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/rendering/Edge.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/rendering/Vertex.java Removed Paths: ------------- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGG.java Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2.java 2014-05-02 19:17:05 UTC (rev 4254) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2.java 2014-05-02 19:18:34 UTC (rev 4255) @@ -3,9 +3,13 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.PriorityQueue; import java.util.Queue; +import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -27,11 +31,16 @@ import org.dllearner.core.owl.Individual; import org.dllearner.kb.OWLFile; import org.dllearner.learningproblems.AxiomScore; -import org.dllearner.learningproblems.Heuristics; import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.learningproblems.QueryTreeScore; import org.dllearner.utilities.owl.DLLearnerDescriptionConvertVisitor; +import org.semanticweb.owlapi.io.ToStringRenderer; +import org.semanticweb.owlapi.util.SimpleShortFormProvider; import org.springframework.beans.factory.annotation.Autowired; +import uk.ac.manchester.cs.owl.owlapi.mansyntaxrenderer.ManchesterOWLSyntaxOWLObjectRendererImpl; + +import com.google.common.collect.Sets; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.jamonapi.Monitor; @@ -50,8 +59,10 @@ private double currentlyBestScore = 0d; - private List<QueryTree<String>> posExamples; - private List<QueryTree<String>> negExamples; + private List<QueryTree<String>> currentPosExampleTrees; + private List<QueryTree<String>> currentNegExampleTrees; + + private Map<QueryTree<String>, Individual> tree2Indivual; private double coverageWeight = 1; private double specifityWeight = 0; @@ -67,6 +78,9 @@ private volatile boolean stop; private boolean isRunning; + private Monitor subMon; + private Monitor lggMon; + public QTL2() {} public QTL2(PosNegLP learningProblem, AbstractReasonerComponent reasoner) throws LearningProblemUnsupportedException{ @@ -87,17 +101,31 @@ public void init() throws ComponentInitException { logger.info("Initializing..."); treeCache = new QueryTreeCache(model); + tree2Indivual = new HashMap<QueryTree<String>, Individual>(lp.getPositiveExamples().size()+lp.getNegativeExamples().size()); - posExamples = new ArrayList<QueryTree<String>>(); - negExamples = new ArrayList<QueryTree<String>>(); + currentPosExampleTrees = new ArrayList<QueryTree<String>>(lp.getPositiveExamples().size()); + currentNegExampleTrees = new ArrayList<QueryTree<String>>(lp.getNegativeExamples().size()); //get the query trees + QueryTree<String> queryTree; for (Individual ind : lp.getPositiveExamples()) { - posExamples.add(treeCache.getQueryTree(ind.getName())); + queryTree = treeCache.getQueryTree(ind.getName()); + tree2Indivual.put(queryTree, ind); + currentPosExampleTrees.add(queryTree); } for (Individual ind : lp.getNegativeExamples()) { - negExamples.add(treeCache.getQueryTree(ind.getName())); + queryTree = treeCache.getQueryTree(ind.getName()); + tree2Indivual.put(queryTree, ind); + currentNegExampleTrees.add(treeCache.getQueryTree(ind.getName())); } + + //some logging + subMon = MonitorFactory.getTimeMonitor("subsumption-mon"); + lggMon = MonitorFactory.getTimeMonitor("lgg-mon"); + + //console rendering of class expressions + ToStringRenderer.getInstance().setRenderer(new ManchesterOWLSyntaxOWLObjectRendererImpl()); + ToStringRenderer.getInstance().setShortFormProvider(new SimpleShortFormProvider()); } /* (non-Javadoc) @@ -111,11 +139,8 @@ long startTime = System.currentTimeMillis(); currentlyBestScore = 0d; - Monitor subMon = MonitorFactory.getTimeMonitor("subsumption-mon"); - Monitor lggMon = MonitorFactory.getTimeMonitor("lgg-mon"); + initTodoList(currentPosExampleTrees, currentNegExampleTrees); - init(posExamples, negExamples); - EvaluatedQueryTree<String> currentElement; do{ logger.trace("TODO list size: " + todoList.size()); @@ -134,7 +159,7 @@ //evaluate the LGG - EvaluatedQueryTree<String> solution = evaluate(lgg); + EvaluatedQueryTree<String> solution = evaluate(lgg, true); if(solution.getScore() >= currentlyBestScore){ //add to todo list, if not already contained in todo list or solution list @@ -226,35 +251,48 @@ stop = true; } - private EvaluatedQueryTree<String> evaluate(QueryTree<String> tree){ + private EvaluatedQueryTree<String> evaluate(QueryTree<String> tree, boolean useSpecifity){ //1. get a score for the coverage = recall oriented //compute positive examples which are not covered by LGG - Collection<QueryTree<String>> uncoveredPositiveExamples = getUncoveredTrees(tree, posExamples); + Collection<QueryTree<String>> uncoveredPositiveExampleTrees = getUncoveredTrees(tree, currentPosExampleTrees); + Set<Individual> uncoveredPosExamples = new HashSet<Individual>(); + for (QueryTree<String> queryTree : uncoveredPositiveExampleTrees) { + uncoveredPosExamples.add(tree2Indivual.get(queryTree)); + } //compute negative examples which are covered by LGG - Collection<QueryTree<String>> coveredNegativeExamples = getCoveredTrees(tree, negExamples); + Collection<QueryTree<String>> coveredNegativeExampleTrees = getCoveredTrees(tree, currentNegExampleTrees); + Set<Individual> coveredNegExamples = new HashSet<Individual>(); + for (QueryTree<String> queryTree : coveredNegativeExampleTrees) { + coveredNegExamples.add(tree2Indivual.get(queryTree)); + } //compute score - int coveredPositiveExamples = posExamples.size() - uncoveredPositiveExamples.size(); - double recall = coveredPositiveExamples / (double)posExamples.size(); - double precision = (coveredNegativeExamples.size() + coveredPositiveExamples == 0) + int coveredPositiveExamples = currentPosExampleTrees.size() - uncoveredPositiveExampleTrees.size(); + double recall = coveredPositiveExamples / (double)currentPosExampleTrees.size(); + double precision = (coveredNegativeExampleTrees.size() + coveredPositiveExamples == 0) ? 0 - : coveredPositiveExamples / (double)(coveredPositiveExamples + coveredNegativeExamples.size()); + : coveredPositiveExamples / (double)(coveredPositiveExamples + coveredNegativeExampleTrees.size()); double coverageScore = recall;//Heuristics.getFScore(recall, precision); //2. get a score for the specifity of the query, i.e. how many edges/nodes = precision oriented - int numberOfSpecificNodes = 0; + int nrOfSpecificNodes = 0; for (QueryTree<String> childNode : tree.getChildrenClosure()) { if(!childNode.getUserObject().equals("?")){ - numberOfSpecificNodes++; + nrOfSpecificNodes++; } } - double specifityScore = Math.log(numberOfSpecificNodes); + double specifityScore = Math.log(nrOfSpecificNodes); //3.compute the total score double score = coverageWeight * coverageScore + specifityWeight * specifityScore; - EvaluatedQueryTree<String> evaluatedTree = new EvaluatedQueryTree<String>(tree, uncoveredPositiveExamples, coveredNegativeExamples, score); + QueryTreeScore queryTreeScore = new QueryTreeScore(score, coverageScore, + uncoveredPosExamples, Sets.difference(lp.getPositiveExamples(), uncoveredPosExamples), + coveredNegExamples, Sets.difference(lp.getNegativeExamples(), coveredNegExamples), + specifityScore, nrOfSpecificNodes); + EvaluatedQueryTree<String> evaluatedTree = new EvaluatedQueryTree<String>(tree, uncoveredPositiveExampleTrees, coveredNegativeExampleTrees, queryTreeScore); + return evaluatedTree; } @@ -297,7 +335,7 @@ * Firstly, distinct trees are computed and afterwards, for each tree a score is computed. * @param trees */ - private void init(List<QueryTree<String>> posExamples, List<QueryTree<String>> negExamples){ + private void initTodoList(List<QueryTree<String>> posExamples, List<QueryTree<String>> negExamples){ todoList = new PriorityQueue<EvaluatedQueryTree<String>>(); solutions = new TreeSet<EvaluatedQueryTree<String>>(); // EvaluatedQueryTree<String> dummy = new EvaluatedQueryTree<String>(new QueryTreeImpl<String>((N)"TOP"), trees, 0d); @@ -319,19 +357,8 @@ } } for (QueryTree<String> queryTree : distinctTrees) {//System.out.println(queryTree.getStringRepresentation()); - //compute positive examples which are not covered by LGG - Collection<QueryTree<String>> uncoveredPositiveExamples = getUncoveredTrees(queryTree, posExamples); - //compute negative examples which are covered by LGG - Collection<QueryTree<String>> coveredNegativeExamples = getCoveredTrees(queryTree, negExamples); - //compute score - int coveredPositiveExamples = posExamples.size() - uncoveredPositiveExamples.size(); - double recall = coveredPositiveExamples / (double)posExamples.size(); - double precision = (coveredNegativeExamples.size() + coveredPositiveExamples == 0) - ? 0 - : coveredPositiveExamples / (double)(coveredPositiveExamples + coveredNegativeExamples.size()); - - double score = Heuristics.getFScore(recall, precision); - todoList.add(new EvaluatedQueryTree<String>(queryTree, uncoveredPositiveExamples, coveredNegativeExamples, score)); + EvaluatedQueryTree<String> evaluatedQueryTree = evaluate(queryTree, false); + todoList.add(evaluatedQueryTree); } } Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2Disjunctive.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2Disjunctive.java 2014-05-02 19:17:05 UTC (rev 4254) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2Disjunctive.java 2014-05-02 19:18:34 UTC (rev 4255) @@ -3,10 +3,15 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Map; import java.util.PriorityQueue; import java.util.Queue; +import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -26,10 +31,11 @@ import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.Union; import org.dllearner.kb.OWLFile; -import org.dllearner.learningproblems.AxiomScore; import org.dllearner.learningproblems.Heuristics; import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.learningproblems.QueryTreeScore; import org.dllearner.utilities.owl.DLLearnerDescriptionConvertVisitor; import org.dllearner.utilities.owl.OWLAPIConverter; import org.semanticweb.owlapi.io.ToStringRenderer; @@ -38,6 +44,7 @@ import uk.ac.manchester.cs.owl.owlapi.mansyntaxrenderer.ManchesterOWLSyntaxOWLObjectRendererImpl; +import com.google.common.collect.Sets; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.jamonapi.Monitor; @@ -52,15 +59,19 @@ private LGGGenerator<String> lggGenerator = new LGGGeneratorImpl<String>(); private Queue<EvaluatedQueryTree<String>> todoList; - private SortedSet<EvaluatedQueryTree<String>> solutions; + private SortedSet<EvaluatedQueryTree<String>> currentPartialSolutions; private double currentlyBestScore = 0d; - private List<QueryTree<String>> posExamples; - private List<QueryTree<String>> negExamples; + private List<QueryTree<String>> currentPosExampleTrees; + private List<QueryTree<String>> currentNegExampleTrees; + private Set<Individual> currentPosExamples; + private Set<Individual> currentNegExamples; + + private Map<QueryTree<String>, Individual> tree2Individual; - private double coverageWeight = 0.6; - private double specifityWeight = 0.4; + private double coverageWeight = 0.8; + private double specifityWeight = 0.2; private QueryTreeCache treeCache; @@ -75,13 +86,14 @@ private Monitor subMon; private Monitor lggMon; + + private List<EvaluatedQueryTree<String>> partialSolutions; public QTL2Disjunctive() {} public QTL2Disjunctive(PosNegLP learningProblem, AbstractReasonerComponent reasoner) throws LearningProblemUnsupportedException{ this.lp = learningProblem; this.reasoner = reasoner; - } public QTL2Disjunctive(PosNegLP lp, Model model) { @@ -90,7 +102,7 @@ } public EvaluatedQueryTree<String> getBestSolution(){ - return solutions.first(); + return currentPartialSolutions.first(); } /* (non-Javadoc) @@ -100,17 +112,33 @@ public void init() throws ComponentInitException { logger.info("Initializing..."); treeCache = new QueryTreeCache(model); + tree2Individual = new HashMap<QueryTree<String>, Individual>(lp.getPositiveExamples().size()+lp.getNegativeExamples().size()); - posExamples = new ArrayList<QueryTree<String>>(); - negExamples = new ArrayList<QueryTree<String>>(); + currentPosExampleTrees = new ArrayList<QueryTree<String>>(lp.getPositiveExamples().size()); + currentNegExampleTrees = new ArrayList<QueryTree<String>>(lp.getNegativeExamples().size()); + currentPosExamples = new TreeSet<Individual>(lp.getPositiveExamples()); + currentNegExamples = new TreeSet<Individual>(lp.getNegativeExamples()); //get the query trees + QueryTree<String> queryTree; for (Individual ind : lp.getPositiveExamples()) { - posExamples.add(treeCache.getQueryTree(ind.getName())); + queryTree = treeCache.getQueryTree(ind.getName()); + tree2Individual.put(queryTree, ind); + currentPosExampleTrees.add(queryTree); } for (Individual ind : lp.getNegativeExamples()) { - negExamples.add(treeCache.getQueryTree(ind.getName())); + queryTree = treeCache.getQueryTree(ind.getName()); + tree2Individual.put(queryTree, ind); + currentNegExampleTrees.add(queryTree); } + + //some logging + subMon = MonitorFactory.getTimeMonitor("subsumption-mon"); + lggMon = MonitorFactory.getTimeMonitor("lgg-mon"); + + //console rendering of class expressions + ToStringRenderer.getInstance().setRenderer(new ManchesterOWLSyntaxOWLObjectRendererImpl()); + ToStringRenderer.getInstance().setShortFormProvider(new SimpleShortFormProvider()); } /* (non-Javadoc) @@ -119,49 +147,79 @@ @Override public void start() { logger.info("Running..."); - stop = false; - isRunning = true; long startTime = System.currentTimeMillis(); - currentlyBestScore = 0d; - subMon = MonitorFactory.getTimeMonitor("subsumption-mon"); - lggMon = MonitorFactory.getTimeMonitor("lgg-mon"); + reset(); - - //outer loop: compute LGG, pick best solution and remove all covered positive and negative examples - List<EvaluatedQueryTree<String>> unionSolutions = new ArrayList<EvaluatedQueryTree<String>>(); + int i = 1; do { + logger.info(i++ + ". iteration..."); + logger.info("#Remaining pos. examples:" + currentPosExampleTrees.size()); + logger.info("#Remaining neg. examples:" + currentNegExampleTrees.size()); + //compute LGG computeLGG(); - //pick best solution computed so far - EvaluatedQueryTree<String> bestSolution = solutions.first(); - unionSolutions.add(bestSolution); - logger.info("#Uncovered pos. examples:" + bestSolution.getFalseNegatives().size()); + //pick best (partial) solution computed so far + EvaluatedQueryTree<String> bestPartialSolution = currentPartialSolutions.first(); + partialSolutions.add(bestPartialSolution); //remove all covered examples QueryTree<String> tree; - for (Iterator<QueryTree<String>> iterator = posExamples.iterator(); iterator.hasNext();) { + for (Iterator<QueryTree<String>> iterator = currentPosExampleTrees.iterator(); iterator.hasNext();) { tree = iterator.next(); - if(tree.isSubsumedBy(bestSolution.getTree())){ + if(tree.isSubsumedBy(bestPartialSolution.getTree())){ iterator.remove(); + currentPosExamples.remove(tree2Individual.get(tree)); } } - for (Iterator<QueryTree<String>> iterator = negExamples.iterator(); iterator.hasNext();) { + for (Iterator<QueryTree<String>> iterator = currentNegExampleTrees.iterator(); iterator.hasNext();) { tree = iterator.next(); - if(tree.isSubsumedBy(bestSolution.getTree())){ + if(tree.isSubsumedBy(bestPartialSolution.getTree())){ iterator.remove(); + currentNegExamples.remove(tree2Individual.get(tree)); } } - } while (!(stop || posExamples.isEmpty())); + } while (!(stop || currentPosExampleTrees.isEmpty())); + isRunning = false; + long endTime = System.currentTimeMillis(); + logger.info("Finished in " + (endTime-startTime) + "ms."); + + EvaluatedDescription combinedSolution = buildCombinedSolution(); + System.out.println(OWLAPIConverter.getOWLAPIDescription(combinedSolution.getDescription())); + } + private EvaluatedDescription buildCombinedSolution(){ + List<Description> disjuncts = new ArrayList<Description>(); + Description partialDescription; + for (EvaluatedQueryTree<String> partialSolution : partialSolutions) { + partialDescription = DLLearnerDescriptionConvertVisitor.getDLLearnerDescription( + partialSolution.getTree().asOWLClassExpression(LiteralNodeConversionStrategy.FACET_RESTRICTION)); + disjuncts.add(partialDescription); + } + Description unionDescription = new Union(disjuncts); + + return new EvaluatedDescription(unionDescription, null); + } + + private void reset(){ + partialSolutions = new ArrayList<EvaluatedQueryTree<String>>(); + + stop = false; + isRunning = true; + + subMon.reset(); + lggMon.reset(); + } + private void computeLGG(){ currentlyBestScore = 0d; - initTodoList(posExamples, negExamples); + initTodoList(currentPosExampleTrees, currentNegExampleTrees); + long startTime = System.currentTimeMillis(); EvaluatedQueryTree<String> currentElement; do{ @@ -178,28 +236,27 @@ lggMon.stop(); //evaluate the LGG - EvaluatedQueryTree<String> solution = evaluate(lgg); + EvaluatedQueryTree<String> solution = evaluate(lgg, true); if(solution.getScore() >= currentlyBestScore){ //add to todo list, if not already contained in todo list or solution list todo(solution); if(solution.getScore() > currentlyBestScore){ - logger.info("Got better solution:" + currentlyBestScore); + logger.info("Got better solution:" + solution.getTreeScore()); } currentlyBestScore = solution.getScore(); } } - solutions.add(currentElement); + currentPartialSolutions.add(currentElement); // todoList.remove(currentElement); } while(!terminationCriteriaSatisfied()); long endTime = System.currentTimeMillis(); logger.info("Finished in " + (endTime-startTime) + "ms."); EvaluatedDescription bestSolution = getCurrentlyBestEvaluatedDescription(); - ToStringRenderer.getInstance().setRenderer(new ManchesterOWLSyntaxOWLObjectRendererImpl()); - ToStringRenderer.getInstance().setShortFormProvider(new SimpleShortFormProvider()); - logger.info("Best solution:\n" + OWLAPIConverter.getOWLAPIDescription(bestSolution.getDescription()) + "\n(" + bestSolution.getAccuracy() + ")"); + logger.info("Best solution:\n" + OWLAPIConverter.getOWLAPIDescription(bestSolution.getDescription()) + "\n(" + bestSolution.getScore() + ")"); + logger.trace("LGG time: " + lggMon.getTotal() + "ms"); logger.trace("Avg. LGG time: " + lggMon.getAvg() + "ms"); logger.trace("#LGG computations: " + lggMon.getHits()); @@ -229,10 +286,8 @@ */ @Override public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { - EvaluatedQueryTree<String> bestSolution = solutions.first(); - Description description = DLLearnerDescriptionConvertVisitor.getDLLearnerDescription( - bestSolution.getTree().asOWLClassExpression(LiteralNodeConversionStrategy.FACET_RESTRICTION)); - return new EvaluatedDescription(description, new AxiomScore(bestSolution.getScore())); + EvaluatedQueryTree<String> bestSolution = currentPartialSolutions.first(); + return bestSolution.asEvaluatedDescription(); } /* (non-Javadoc) @@ -270,35 +325,55 @@ return treeCache; } - private EvaluatedQueryTree<String> evaluate(QueryTree<String> tree){ + private EvaluatedQueryTree<String> evaluate(QueryTree<String> tree, boolean useSpecifity){ //1. get a score for the coverage = recall oriented //compute positive examples which are not covered by LGG - Collection<QueryTree<String>> uncoveredPositiveExamples = getUncoveredTrees(tree, posExamples); + Set<QueryTree<String>> uncoveredPositiveExampleTrees = getUncoveredTrees(tree, currentPosExampleTrees); + Set<Individual> uncoveredPosExamples = new HashSet<Individual>(); + for (QueryTree<String> queryTree : uncoveredPositiveExampleTrees) { + uncoveredPosExamples.add(tree2Individual.get(queryTree)); + } //compute negative examples which are covered by LGG - Collection<QueryTree<String>> coveredNegativeExamples = getCoveredTrees(tree, negExamples); + Collection<QueryTree<String>> coveredNegativeExampleTrees = getCoveredTrees(tree, currentNegExampleTrees); + Set<Individual> coveredNegExamples = new HashSet<Individual>(); + for (QueryTree<String> queryTree : coveredNegativeExampleTrees) { + coveredNegExamples.add(tree2Individual.get(queryTree)); + } //compute score - int coveredPositiveExamples = posExamples.size() - uncoveredPositiveExamples.size(); - double recall = coveredPositiveExamples / (double)posExamples.size(); - double precision = (coveredNegativeExamples.size() + coveredPositiveExamples == 0) + int coveredPositiveExamples = currentPosExampleTrees.size() - uncoveredPositiveExampleTrees.size(); + double recall = coveredPositiveExamples / (double)currentPosExampleTrees.size(); + double precision = (coveredNegativeExampleTrees.size() + coveredPositiveExamples == 0) ? 0 - : coveredPositiveExamples / (double)(coveredPositiveExamples + coveredNegativeExamples.size()); + : coveredPositiveExamples / (double)(coveredPositiveExamples + coveredNegativeExampleTrees.size()); - double coverageScore = recall;//Heuristics.getFScore(recall, precision); + double coverageScore = Heuristics.getFScore(recall, precision); //2. get a score for the specifity of the query, i.e. how many edges/nodes = precision oriented - int numberOfSpecificNodes = 0; + int nrOfSpecificNodes = 0; for (QueryTree<String> childNode : tree.getChildrenClosure()) { if(!childNode.getUserObject().equals("?")){ - numberOfSpecificNodes++; + nrOfSpecificNodes++; } } - double specifityScore = Math.log(numberOfSpecificNodes); + double specifityScore = 0d; + if(useSpecifity){ + specifityScore = Math.log(nrOfSpecificNodes); + } //3.compute the total score double score = coverageWeight * coverageScore + specifityWeight * specifityScore; - EvaluatedQueryTree<String> evaluatedTree = new EvaluatedQueryTree<String>(tree, uncoveredPositiveExamples, coveredNegativeExamples, score); + QueryTreeScore queryTreeScore = new QueryTreeScore(score, coverageScore, + Sets.difference(currentPosExamples, uncoveredPosExamples), uncoveredPosExamples, + coveredNegExamples, Sets.difference(currentNegExamples, coveredNegExamples), + specifityScore, nrOfSpecificNodes); +// QueryTreeScore queryTreeScore = new QueryTreeScore(score, coverageScore, +// null,null,null,null, +// specifityScore, nrOfSpecificNodes); + + EvaluatedQueryTree<String> evaluatedTree = new EvaluatedQueryTree<String>(tree, uncoveredPositiveExampleTrees, coveredNegativeExampleTrees, queryTreeScore); + return evaluatedTree; } @@ -308,8 +383,8 @@ * @param allTrees * @return */ - private Collection<QueryTree<String>> getCoveredTrees(QueryTree<String> tree, List<QueryTree<String>> trees){ - Collection<QueryTree<String>> coveredTrees = new ArrayList<QueryTree<String>>(); + private List<QueryTree<String>> getCoveredTrees(QueryTree<String> tree, List<QueryTree<String>> trees){ + List<QueryTree<String>> coveredTrees = new ArrayList<QueryTree<String>>(); for (QueryTree<String> queryTree : trees) { boolean subsumed = queryTree.isSubsumedBy(tree); if(subsumed){ @@ -325,8 +400,8 @@ * @param allTrees * @return */ - private Collection<QueryTree<String>> getUncoveredTrees(QueryTree<String> tree, List<QueryTree<String>> allTrees){ - Collection<QueryTree<String>> uncoveredTrees = new ArrayList<QueryTree<String>>(); + private Set<QueryTree<String>> getUncoveredTrees(QueryTree<String> tree, List<QueryTree<String>> allTrees){ + Set<QueryTree<String>> uncoveredTrees = new LinkedHashSet<QueryTree<String>>(); for (QueryTree<String> queryTree : allTrees) { boolean subsumed = queryTree.isSubsumedBy(tree); if(!subsumed){ @@ -343,7 +418,7 @@ */ private void initTodoList(List<QueryTree<String>> posExamples, List<QueryTree<String>> negExamples){ todoList = new PriorityQueue<EvaluatedQueryTree<String>>(); - solutions = new TreeSet<EvaluatedQueryTree<String>>(); + currentPartialSolutions = new TreeSet<EvaluatedQueryTree<String>>(); // EvaluatedQueryTree<String> dummy = new EvaluatedQueryTree<String>(new QueryTreeImpl<String>((N)"TOP"), trees, 0d); // todoList.add(dummy); //compute distinct trees @@ -363,19 +438,8 @@ } } for (QueryTree<String> queryTree : distinctTrees) {//System.out.println(queryTree.getStringRepresentation()); - //compute positive examples which are not covered by LGG - Collection<QueryTree<String>> uncoveredPositiveExamples = getUncoveredTrees(queryTree, posExamples); - //compute negative examples which are covered by LGG - Collection<QueryTree<String>> coveredNegativeExamples = getCoveredTrees(queryTree, negExamples); - //compute score - int coveredPositiveExamples = posExamples.size() - uncoveredPositiveExamples.size(); - double recall = coveredPositiveExamples / (double)posExamples.size(); - double precision = (coveredNegativeExamples.size() + coveredPositiveExamples == 0) - ? 0 - : coveredPositiveExamples / (double)(coveredPositiveExamples + coveredNegativeExamples.size()); - - double score = Heuristics.getFScore(recall, precision); - todoList.add(new EvaluatedQueryTree<String>(queryTree, uncoveredPositiveExamples, coveredNegativeExamples, score)); + EvaluatedQueryTree<String> evaluatedQueryTree = evaluate(queryTree, false); + todoList.add(evaluatedQueryTree); } } @@ -384,7 +448,7 @@ } private boolean terminationCriteriaSatisfied(){ - return stop || todoList.isEmpty() || posExamples.isEmpty(); + return stop || todoList.isEmpty() || currentPosExampleTrees.isEmpty(); } /** @@ -399,14 +463,11 @@ } } //check if not already contained in solutions - for (EvaluatedQueryTree<String> evTree : solutions) { + for (EvaluatedQueryTree<String> evTree : currentPartialSolutions) { if(sameTrees(solution.getTree(), evTree.getTree())){ return; } } todoList.add(solution); } - - - } Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/impl/QueryTreeImpl.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/impl/QueryTreeImpl.java 2014-05-02 19:17:05 UTC (rev 4254) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/impl/QueryTreeImpl.java 2014-05-02 19:18:34 UTC (rev 4255) @@ -210,6 +210,8 @@ addChild(subTree, tree.getEdge(child)); } setIsResourceNode(tree.isResourceNode()); + setIsLiteralNode(tree.isLiteralNode()); + addLiterals(tree.getLiterals()); } public boolean sameType(QueryTree<N> tree){ Added: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/rendering/Edge.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/rendering/Edge.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/rendering/Edge.java 2014-05-02 19:18:34 UTC (rev 4255) @@ -0,0 +1,47 @@ +package org.dllearner.algorithms.qtl.datastructures.rendering; + +public class Edge { + int id; + String label; + + public Edge(int id, String label) { + this.id = id; + this.label = label; + } + + /** + * @return the id + */ + public int getId() { + return id; + } + + /** + * @return the label + */ + public String getLabel() { + return label; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + id; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Edge other = (Edge) obj; + if (id != other.id) + return false; + return true; + } +} \ No newline at end of file Added: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/rendering/Vertex.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/rendering/Vertex.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/rendering/Vertex.java 2014-05-02 19:18:34 UTC (rev 4255) @@ -0,0 +1,47 @@ +package org.dllearner.algorithms.qtl.datastructures.rendering; + +public class Vertex { + int id; + String label; + + public Vertex(int id, String label) { + this.id = id; + this.label = label; + } + + /** + * @return the id + */ + public int getId() { + return id; + } + + /** + * @return the label + */ + public String getLabel() { + return label; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + id; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Vertex other = (Vertex) obj; + if (id != other.id) + return false; + return true; + } +} \ No newline at end of file Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/EvaluatedQueryTree.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/EvaluatedQueryTree.java 2014-05-02 19:17:05 UTC (rev 4254) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/EvaluatedQueryTree.java 2014-05-02 19:18:34 UTC (rev 4255) @@ -3,17 +3,21 @@ import java.util.Collection; import org.dllearner.algorithms.qtl.datastructures.QueryTree; -import org.dllearner.learningproblems.ScoreTwoValued; +import org.dllearner.algorithms.qtl.datastructures.impl.QueryTreeImpl.LiteralNodeConversionStrategy; +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.learningproblems.QueryTreeScore; +import org.dllearner.utilities.owl.DLLearnerDescriptionConvertVisitor; public class EvaluatedQueryTree<N> implements Comparable<EvaluatedQueryTree<N>>{ private QueryTree<N> tree; private Collection<QueryTree<N>> falseNegatives; private Collection<QueryTree<N>> falsePositives; - private double score; + private QueryTreeScore score; // private ScoreTwoValued score; - public EvaluatedQueryTree(QueryTree<N> tree, Collection<QueryTree<N>> falseNegatives, Collection<QueryTree<N>> falsePositives, double score) { + public EvaluatedQueryTree(QueryTree<N> tree, Collection<QueryTree<N>> falseNegatives, + Collection<QueryTree<N>> falsePositives, QueryTreeScore score) { this.tree = tree; this.falseNegatives = falseNegatives; this.falsePositives = falsePositives; @@ -44,12 +48,16 @@ } public double getScore() { + return score.getScore(); + } + + public QueryTreeScore getTreeScore() { return score; } @Override public int compareTo(EvaluatedQueryTree<N> other) { - double diff = score - other.getScore(); + double diff = getScore() - other.getScore(); if(diff == 0){ return -1; } else if(diff > 0){ @@ -59,6 +67,11 @@ } } + public EvaluatedDescription asEvaluatedDescription(){ + return new EvaluatedDescription(DLLearnerDescriptionConvertVisitor.getDLLearnerDescription( + getTree().asOWLClassExpression(LiteralNodeConversionStrategy.FACET_RESTRICTION)), score); + } + /* (non-Javadoc) * @see java.lang.Object#toString() */ Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java 2014-05-02 19:17:05 UTC (rev 4254) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java 2014-05-02 19:18:34 UTC (rev 4255) @@ -168,7 +168,7 @@ // } // } // } - if(!lgg.sameType(tree2) || !lgg.getUserObject().equals(tree2.getUserObject())){ + if(!(lgg.sameType(tree2) || lgg.getUserObject().equals(tree2.getUserObject()))){ lgg.setUserObject((N)"?"); lgg.setIsLiteralNode(false); lgg.setIsResourceNode(false); @@ -178,7 +178,7 @@ RDFDatatype d1 = tree1.getDatatype(); RDFDatatype d2 = tree2.getDatatype(); // if(d1 != null && d2 != null && d1 == d2){ - if(d1 == d2){ + if(d1.equals(d2)){ ((QueryTreeImpl<N>)lgg).addLiterals(((QueryTreeImpl<N>)tree1).getLiterals()); ((QueryTreeImpl<N>)lgg).addLiterals(((QueryTreeImpl<N>)tree2).getLiterals()); } @@ -194,6 +194,10 @@ addedChildren = new HashSet<QueryTreeImpl<N>>(); for(QueryTree<N> child1 : tree1.getChildren(edge)){ for(QueryTree<N> child2 : tree2.getChildren(edge)){ +// if(edge.equals("http://dl-learner.org/carcinogenesis#amesTestPositive")){ +// System.out.println(child1); +// System.out.println(child1.isLiteralNode());System.out.println(child2.isLiteralNode() + "\n#######"); +// } lggChild = (QueryTreeImpl<N>) computeLGG(child1, child2, learnFilters); boolean add = true; for(QueryTreeImpl<N> addedChild : addedChildren){ Deleted: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGG.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGG.java 2014-05-02 19:17:05 UTC (rev 4254) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGG.java 2014-05-02 19:18:34 UTC (rev 4255) @@ -1,228 +0,0 @@ -package org.dllearner.algorithms.qtl.operations.lgg; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.PriorityQueue; -import java.util.Queue; -import java.util.SortedSet; -import java.util.TreeSet; - -import org.apache.log4j.Logger; -import org.dllearner.algorithms.qtl.datastructures.QueryTree; -import org.dllearner.learningproblems.Heuristics; - -import com.jamonapi.Monitor; -import com.jamonapi.MonitorFactory; - -public class NoiseSensitiveLGG<N> { - - - private static final Logger logger = Logger.getLogger(NoiseSensitiveLGG.class.getName()); - - private LGGGenerator<N> lggGenerator = new LGGGeneratorImpl<N>(); - - private Queue<EvaluatedQueryTree<N>> todoList; - private SortedSet<EvaluatedQueryTree<N>> solutions; - - private double currentlyBestScore = 0d; - - private List<QueryTree<N>> posExamples; - - private List<QueryTree<N>> negExamples; - - private double coverageWeight = 0.6; - private double specifityWeight = 0.4; - - public NoiseSensitiveLGG() { - } - - public List<EvaluatedQueryTree<N>> computeLGG(List<QueryTree<N>> posExampleTrees){ - return computeLGG(posExampleTrees, Collections.<QueryTree<N>>emptyList()); - } - - public List<EvaluatedQueryTree<N>> computeLGG(List<QueryTree<N>> posExamples, List<QueryTree<N>> negExamples){ - this.posExamples = posExamples; - this.negExamples = negExamples; - - currentlyBestScore = 0d; - - Monitor subMon = MonitorFactory.getTimeMonitor("subsumption-mon"); - Monitor lggMon = MonitorFactory.getTimeMonitor("lgg-mon"); - init(posExamples, negExamples); - EvaluatedQueryTree<N> currentElement; - do{ - logger.trace("TODO list size: " + todoList.size()); - //pick best element from todo list - currentElement = todoList.poll(); - //generate the LGG between the chosen tree and each uncovered positive example - for (QueryTree<N> example : currentElement.getFalseNegatives()) { - QueryTree<N> tree = currentElement.getTree(); - //compute the LGG - lggMon.start(); - QueryTree<N> lgg = lggGenerator.getLGG(tree, example); - lggMon.stop(); - - //evaluate the LGG - EvaluatedQueryTree<N> solution = evaluate(lgg); - - if(solution.getScore() >= currentlyBestScore){ - //add to todo list, if not already contained in todo list or solution list - todo(solution); - currentlyBestScore = solution.getScore(); - } - - } - solutions.add(currentElement); -// todoList.remove(currentElement); - } while(!terminationCriteriaSatisfied()); - logger.trace("LGG time: " + lggMon.getTotal() + "ms"); - logger.trace("Avg. LGG time: " + lggMon.getAvg() + "ms"); - logger.trace("#LGG computations: " + lggMon.getHits()); - logger.trace("Subsumption test time: " + subMon.getTotal() + "ms"); - logger.trace("Avg. subsumption test time: " + subMon.getAvg() + "ms"); - logger.trace("#Subsumption tests: " + subMon.getHits()); - return new ArrayList<EvaluatedQueryTree<N>>(solutions); - } - - private EvaluatedQueryTree<N> evaluate(QueryTree<N> lgg){ - //1. get a score for the coverage = recall oriented - //compute positive examples which are not covered by LGG - Collection<QueryTree<N>> uncoveredPositiveExamples = getUncoveredTrees(lgg, posExamples); - //compute negative examples which are covered by LGG - Collection<QueryTree<N>> coveredNegativeExamples = getCoveredTrees(lgg, negExamples); - //compute score - int coveredPositiveExamples = posExamples.size() - uncoveredPositiveExamples.size(); - double recall = coveredPositiveExamples / (double)posExamples.size(); - double precision = (coveredNegativeExamples.size() + coveredPositiveExamples == 0) - ? 0 - : coveredPositiveExamples / (double)(coveredPositiveExamples + coveredNegativeExamples.size()); - - double coverageScore = recall;//Heuristics.getFScore(recall, precision); - - //2. get a score for the specifity of the query, i.e. how many edges/nodes = precision oriented - int numberOfSpecificNodes = 0; - for (QueryTree<N> childNode : lgg.getChildrenClosure()) { - if(!childNode.getUserObject().equals("?")){ - numberOfSpecificNodes++; - } - } - double specifityScore = Math.log(numberOfSpecificNodes); - - //3.compute the total score - double score = coverageWeight * coverageScore + specifityWeight * specifityScore; - - EvaluatedQueryTree<N> solution = new EvaluatedQueryTree<N>(lgg, uncoveredPositiveExamples, coveredNegativeExamples, score); - - return solution; - } - - /** - * Return all trees from the given list {@code allTrees} which are not already subsumed by {@code tree}. - * @param tree - * @param allTrees - * @return - */ - private Collection<QueryTree<N>> getUncoveredTrees(QueryTree<N> tree, List<QueryTree<N>> allTrees){ - Collection<QueryTree<N>> uncoveredTrees = new ArrayList<QueryTree<N>>(); - for (QueryTree<N> queryTree : allTrees) { - boolean subsumed = queryTree.isSubsumedBy(tree); - if(!subsumed){ - uncoveredTrees.add(queryTree); - } - } - return uncoveredTrees; - } - - /** - * Return all trees from the given list {@code allTrees} which are not already subsumed by {@code tree}. - * @param tree - * @param allTrees - * @return - */ - private Collection<QueryTree<N>> getCoveredTrees(QueryTree<N> tree, List<QueryTree<N>> trees){ - Collection<QueryTree<N>> coveredTrees = new ArrayList<QueryTree<N>>(); - for (QueryTree<N> queryTree : trees) { - boolean subsumed = queryTree.isSubsumedBy(tree); - if(subsumed){ - coveredTrees.add(queryTree); - } - } - return coveredTrees; - } - - /** - * Initializes the todo list with all distinct trees contained in the given list {@code trees}. - * Firstly, distinct trees are computed and afterwards, for each tree a score is computed. - * @param trees - */ - private void init(List<QueryTree<N>> posExamples, List<QueryTree<N>> negExamples){ - todoList = new PriorityQueue<EvaluatedQueryTree<N>>(); - solutions = new TreeSet<EvaluatedQueryTree<N>>(); -// EvaluatedQueryTree<N> dummy = new EvaluatedQueryTree<N>(new QueryTreeImpl<N>((N)"TOP"), trees, 0d); -// todoList.add(dummy); - //compute distinct trees - Collection<QueryTree<N>> distinctTrees = new ArrayList<QueryTree<N>>(); - for (QueryTree<N> queryTree : posExamples) { - boolean distinct = true; - for (QueryTree<N> otherTree : distinctTrees) { - if(!queryTree.equals(otherTree)){ - if(queryTree.isSameTreeAs(otherTree)){ - distinct = false; - break; - } - } - } - if(distinct){ - distinctTrees.add(queryTree); - } - } - for (QueryTree<N> queryTree : distinctTrees) {//System.out.println(queryTree.getStringRepresentation()); - //compute positive examples which are not covered by LGG - Collection<QueryTree<N>> uncoveredPositiveExamples = getUncoveredTrees(queryTree, posExamples); - //compute negative examples which are covered by LGG - Collection<QueryTree<N>> coveredNegativeExamples = getCoveredTrees(queryTree, negExamples); - //compute score - int coveredPositiveExamples = posExamples.size() - uncoveredPositiveExamples.size(); - double recall = coveredPositiveExamples / (double)posExamples.size(); - double precision = (coveredNegativeExamples.size() + coveredPositiveExamples == 0) - ? 0 - : coveredPositiveExamples / (double)(coveredPositiveExamples + coveredNegativeExamples.size()); - - double score = Heuristics.getFScore(recall, precision); - todoList.add(new EvaluatedQueryTree<N>(queryTree, uncoveredPositiveExamples, coveredNegativeExamples, score)); - } - } - - /** - * Add tree to todo list if not already contained in that list or the solutions. - * @param solution - */ - private void todo(EvaluatedQueryTree<N> solution){ - //check if not already contained in todo list - for (EvaluatedQueryTree<N> evTree : todoList) { - if(sameTrees(solution.getTree(), evTree.getTree())){ - return; - } - } - //check if not already contained in solutions - for (EvaluatedQueryTree<N> evTree : solutions) { - if(sameTrees(solution.getTree(), evTree.getTree())){ - return; - } - } - todoList.add(solution); - } - - private boolean sameTrees(QueryTree<N> tree1, QueryTree<N> tree2){ - return tree1.isSubsumedBy(tree2) && tree2.isSubsumedBy(tree1); - } - - private boolean terminationCriteriaSatisfied(){ - return todoList.isEmpty(); - } - - - -} Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGGMultithreaded.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGGMultithreaded.java 2014-05-02 19:17:05 UTC (rev 4254) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGGMultithreaded.java 2014-05-02 19:18:34 UTC (rev 4255) @@ -20,6 +20,7 @@ import com.google.common.collect.Lists; import com.hp.hpl.jena.rdf.model.Model; +@Deprecated public class NoiseSensitiveLGGMultithreaded<N> { private LGGGenerator<N> lggGenerator = new LGGGeneratorImpl<N>(); @@ -80,8 +81,8 @@ //compute score double score = Heuristics.getConfidenceInterval95WaldAverage(trees.size(), trees.size() - uncoveredExamples.size()); //add to todo list, if not already contained in todo list or solution list - EvaluatedQueryTree<N> solution = new EvaluatedQueryTree<N>(lgg, uncoveredExamples, null, score); - todo(solution); +// EvaluatedQueryTree<N> solution = new EvaluatedQueryTree<N>(lgg, uncoveredExamples, null, score); +// todo(solution); } solutions.add(evaluatedQueryTree); } @@ -110,7 +111,7 @@ Collection<QueryTree<N>> uncoveredExamples = new ArrayList<QueryTree<N>>(distinctTrees); uncoveredExamples.remove(queryTree); double score = (trees.size() - uncoveredExamples.size()) / (double)trees.size(); - todoList.add(new EvaluatedQueryTree<N>(queryTree, uncoveredExamples, null, score)); +// todoList.add(new EvaluatedQueryTree<N>(queryTree, uncoveredExamples, null, score)); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2014-05-02 19:17:08
|
Revision: 4254 http://sourceforge.net/p/dl-learner/code/4254 Author: lorenz_b Date: 2014-05-02 19:17:05 +0000 (Fri, 02 May 2014) Log Message: ----------- Added QTL cross validation. Modified Paths: -------------- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java Added Paths: ----------- trunk/interfaces/src/main/java/org/dllearner/cli/SPARQLCrossValidation.java Modified: trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2014-04-30 11:45:53 UTC (rev 4253) +++ trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2014-05-02 19:17:05 UTC (rev 4254) @@ -27,18 +27,23 @@ import java.util.List; import java.util.Map.Entry; - import org.apache.commons.lang.exception.ExceptionUtils; import org.apache.log4j.Level; import org.apache.xmlbeans.XmlObject; import org.dllearner.algorithms.ParCEL.ParCELPosNegLP; +import org.dllearner.algorithms.qtl.QTL2; import org.dllearner.configuration.IConfiguration; import org.dllearner.configuration.spring.ApplicationContextBuilder; import org.dllearner.configuration.spring.DefaultApplicationContextBuilder; import org.dllearner.configuration.util.SpringConfigurationXMLBeanConverter; import org.dllearner.confparser3.ConfParserConfiguration; import org.dllearner.confparser3.ParseException; -import org.dllearner.core.*; +import org.dllearner.core.AbstractCELA; +import org.dllearner.core.AbstractReasonerComponent; +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.KnowledgeSource; +import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.ReasoningMethodUnsupportedException; import org.dllearner.learningproblems.PosNegLP; import org.dllearner.utilities.Files; import org.slf4j.Logger; @@ -136,7 +141,11 @@ } catch (BeansException be) { PosNegLP lp = context.getBean(PosNegLP.class); - new CrossValidation(la,lp,rs,nrOfFolds,false); + if(la instanceof QTL2){ + new SPARQLCrossValidation((QTL2) la,lp,nrOfFolds,false); + } else { + new CrossValidation(la,lp,rs,nrOfFolds,false); + } } } else { Added: trunk/interfaces/src/main/java/org/dllearner/cli/SPARQLCrossValidation.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/SPARQLCrossValidation.java (rev 0) +++ trunk/interfaces/src/main/java/org/dllearner/cli/SPARQLCrossValidation.java 2014-05-02 19:17:05 UTC (rev 4254) @@ -0,0 +1,373 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.cli; + +import java.io.File; +import java.text.DecimalFormat; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Random; +import java.util.Set; +import java.util.TreeSet; + +import org.dllearner.algorithms.qtl.QTL2; +import org.dllearner.algorithms.qtl.datastructures.QueryTree; +import org.dllearner.algorithms.qtl.datastructures.impl.QueryTreeImpl.LiteralNodeSubsumptionStrategy; +import org.dllearner.core.AbstractLearningProblem; +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; +import org.dllearner.learningproblems.Heuristics; +import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.learningproblems.PosOnlyLP; +import org.dllearner.reasoning.SPARQLReasoner; +import org.dllearner.utilities.Files; +import org.dllearner.utilities.Helper; +import org.dllearner.utilities.datastructures.Datastructures; +import org.dllearner.utilities.statistics.Stat; + +/** + * Performs cross validation for the given problem. Supports + * k-fold cross-validation and leave-one-out cross-validation. + * + * @author Jens Lehmann + * + */ +public class SPARQLCrossValidation { + + // statistical values + protected Stat runtime = new Stat(); + protected Stat accuracy = new Stat(); + protected Stat length = new Stat(); + protected Stat accuracyTraining = new Stat(); + protected Stat fMeasure = new Stat(); + protected Stat fMeasureTraining = new Stat(); + protected static boolean writeToFile = false; + protected static File outputFile; + + + protected Stat trainingCompletenessStat = new Stat(); + protected Stat trainingCorrectnessStat = new Stat(); + + protected Stat testingCompletenessStat = new Stat(); + protected Stat testingCorrectnessStat = new Stat(); + + LiteralNodeSubsumptionStrategy literalNodeSubsumptionStrategy = LiteralNodeSubsumptionStrategy.INTERVAL; + + public SPARQLCrossValidation() { + + } + + public SPARQLCrossValidation(QTL2 la, AbstractLearningProblem lp, int folds, boolean leaveOneOut) { + + DecimalFormat df = new DecimalFormat(); + + // the training and test sets used later on + List<Set<Individual>> trainingSetsPos = new LinkedList<Set<Individual>>(); + List<Set<Individual>> trainingSetsNeg = new LinkedList<Set<Individual>>(); + List<Set<Individual>> testSetsPos = new LinkedList<Set<Individual>>(); + List<Set<Individual>> testSetsNeg = new LinkedList<Set<Individual>>(); + + // get examples and shuffle them too + Set<Individual> posExamples; + Set<Individual> negExamples; + if(lp instanceof PosNegLP){ + posExamples = ((PosNegLP)lp).getPositiveExamples(); + negExamples = ((PosNegLP)lp).getNegativeExamples(); + } else if(lp instanceof PosOnlyLP){ + posExamples = ((PosNegLP)lp).getPositiveExamples(); + negExamples = new HashSet<Individual>(); + } else { + throw new IllegalArgumentException("Only PosNeg and PosOnly learning problems are supported"); + } + List<Individual> posExamplesList = new LinkedList<Individual>(posExamples); + List<Individual> negExamplesList = new LinkedList<Individual>(negExamples); + Collections.shuffle(posExamplesList, new Random(1)); + Collections.shuffle(negExamplesList, new Random(2)); + + // sanity check whether nr. of folds makes sense for this benchmark + if(!leaveOneOut && (posExamples.size()<folds && negExamples.size()<folds)) { + System.out.println("The number of folds is higher than the number of " + + "positive/negative examples. This can result in empty test sets. Exiting."); + System.exit(0); + } + + if(leaveOneOut) { + // note that leave-one-out is not identical to k-fold with + // k = nr. of examples in the current implementation, because + // with n folds and n examples there is no guarantee that a fold + // is never empty (this is an implementation issue) + int nrOfExamples = posExamples.size() + negExamples.size(); + for(int i = 0; i < nrOfExamples; i++) { + // ... + } + System.out.println("Leave-one-out not supported yet."); + System.exit(1); + } else { + // calculating where to split the sets, ; note that we split + // positive and negative examples separately such that the + // distribution of positive and negative examples remains similar + // (note that there are better but more complex ways to implement this, + // which guarantee that the sum of the elements of a fold for pos + // and neg differs by at most 1 - it can differ by 2 in our implementation, + // e.g. with 3 folds, 4 pos. examples, 4 neg. examples) + int[] splitsPos = calculateSplits(posExamples.size(),folds); + int[] splitsNeg = calculateSplits(negExamples.size(),folds); + +// System.out.println(splitsPos[0]); +// System.out.println(splitsNeg[0]); + + // calculating training and test sets + for(int i=0; i<folds; i++) { + Set<Individual> testPos = getTestingSet(posExamplesList, splitsPos, i); + Set<Individual> testNeg = getTestingSet(negExamplesList, splitsNeg, i); + testSetsPos.add(i, testPos); + testSetsNeg.add(i, testNeg); + trainingSetsPos.add(i, getTrainingSet(posExamples, testPos)); + trainingSetsNeg.add(i, getTrainingSet(negExamples, testNeg)); + } + + } + + // run the algorithm + for(int currFold=0; currFold<folds; currFold++) { + + Set<String> pos = Datastructures.individualSetToStringSet(trainingSetsPos.get(currFold)); + Set<String> neg = Datastructures.individualSetToStringSet(trainingSetsNeg.get(currFold)); + if(lp instanceof PosNegLP){ + ((PosNegLP)lp).setPositiveExamples(trainingSetsPos.get(currFold)); + ((PosNegLP)lp).setNegativeExamples(trainingSetsNeg.get(currFold)); + } else if(lp instanceof PosOnlyLP){ + ((PosOnlyLP)lp).setPositiveExamples(new TreeSet<Individual>(trainingSetsPos.get(currFold))); + } + + + try { + lp.init(); + la.init(); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + long algorithmStartTime = System.nanoTime(); + la.start(); + long algorithmDuration = System.nanoTime() - algorithmStartTime; + runtime.addNumber(algorithmDuration/(double)1000000000); + + Description concept = la.getCurrentlyBestDescription(); + System.out.println(concept); +// Set<Individual> tmp = rs.hasType(concept, testSetsPos.get(currFold)); + Set<Individual> tmp = hasType(testSetsPos.get(currFold), la); + Set<Individual> tmp2 = Helper.difference(testSetsPos.get(currFold), tmp); +// Set<Individual> tmp3 = rs.hasType(concept, testSetsNeg.get(currFold)); + Set<Individual> tmp3 = hasType(testSetsNeg.get(currFold), la); + + outputWriter("test set errors pos: " + tmp2); + outputWriter("test set errors neg: " + tmp3); + + // calculate training accuracies +// int trainingCorrectPosClassified = getCorrectPosClassified(rs, concept, trainingSetsPos.get(currFold)); + int trainingCorrectPosClassified = getCorrectPosClassified(trainingSetsPos.get(currFold), la); +// int trainingCorrectNegClassified = getCorrectNegClassified(rs, concept, trainingSetsNeg.get(currFold)); + int trainingCorrectNegClassified = getCorrectNegClassified(trainingSetsNeg.get(currFold), la); + int trainingCorrectExamples = trainingCorrectPosClassified + trainingCorrectNegClassified; + double trainingAccuracy = 100*((double)trainingCorrectExamples/(trainingSetsPos.get(currFold).size()+ + trainingSetsNeg.get(currFold).size())); + accuracyTraining.addNumber(trainingAccuracy); + // calculate test accuracies +// int correctPosClassified = getCorrectPosClassified(rs, concept, testSetsPos.get(currFold)); + int correctPosClassified = getCorrectPosClassified(testSetsPos.get(currFold), la); +// int correctNegClassified = getCorrectNegClassified(rs, concept, testSetsNeg.get(currFold)); + int correctNegClassified = getCorrectNegClassified(testSetsNeg.get(currFold), la); + int correctExamples = correctPosClassified + correctNegClassified; + double currAccuracy = 100*((double)correctExamples/(testSetsPos.get(currFold).size()+ + testSetsNeg.get(currFold).size())); + accuracy.addNumber(currAccuracy); + // calculate training F-Score +// int negAsPosTraining = rs.hasType(concept, trainingSetsNeg.get(currFold)).size(); + int negAsPosTraining = trainingSetsNeg.get(currFold).size() - trainingCorrectNegClassified; + double precisionTraining = trainingCorrectPosClassified + negAsPosTraining == 0 ? 0 : trainingCorrectPosClassified / (double) (trainingCorrectPosClassified + negAsPosTraining); + double recallTraining = trainingCorrectPosClassified / (double) trainingSetsPos.get(currFold).size(); + fMeasureTraining.addNumber(100*Heuristics.getFScore(recallTraining, precisionTraining)); + // calculate test F-Score +// int negAsPos = rs.hasType(concept, testSetsNeg.get(currFold)).size(); + int negAsPos = testSetsNeg.get(currFold).size() - correctNegClassified; + double precision = correctPosClassified + negAsPos == 0 ? 0 : correctPosClassified / (double) (correctPosClassified + negAsPos); + double recall = correctPosClassified / (double) testSetsPos.get(currFold).size(); +// System.out.println(precision);System.out.println(recall); + fMeasure.addNumber(100*Heuristics.getFScore(recall, precision)); + + length.addNumber(concept.getLength()); + + outputWriter("fold " + currFold + ":"); + outputWriter(" training: " + pos.size() + " positive and " + neg.size() + " negative examples"); + outputWriter(" testing: " + correctPosClassified + "/" + testSetsPos.get(currFold).size() + " correct positives, " + + correctNegClassified + "/" + testSetsNeg.get(currFold).size() + " correct negatives"); + outputWriter(" concept: " + concept); + outputWriter(" accuracy: " + df.format(currAccuracy) + "% (" + df.format(trainingAccuracy) + "% on training set)"); + outputWriter(" length: " + df.format(concept.getLength())); + outputWriter(" runtime: " + df.format(algorithmDuration/(double)1000000000) + "s"); + + } + + outputWriter(""); + outputWriter("Finished " + folds + "-folds cross-validation."); + outputWriter("runtime: " + statOutput(df, runtime, "s")); + outputWriter("length: " + statOutput(df, length, "")); + outputWriter("F-Measure on training set: " + statOutput(df, fMeasureTraining, "%")); + outputWriter("F-Measure: " + statOutput(df, fMeasure, "%")); + outputWriter("predictive accuracy on training set: " + statOutput(df, accuracyTraining, "%")); + outputWriter("predictive accuracy: " + statOutput(df, accuracy, "%")); + + } + + protected int getCorrectPosClassified(SPARQLReasoner rs, Description concept, Set<Individual> testSetPos) { + return rs.hasType(concept, testSetPos).size(); + } + + protected Set<Individual> hasType(Set<Individual> individuals, QTL2 qtl) { + Set<Individual> coveredIndividuals = new HashSet<Individual>(); + QueryTree<String> solutionTree = qtl.getBestSolution().getTree(); + QueryTree<String> tree; + for (Individual ind : individuals) { + tree = qtl.getTreeCache().getQueryTree(ind.getName()); + if(tree.isSubsumedBy(solutionTree, literalNodeSubsumptionStrategy)){ + coveredIndividuals.add(ind); + } else { +// System.out.println("NOT COVERED"); +// System.out.println(tree.isSubsumedBy(solutionTree, literalNodeSubsumptionStrategy)); +// System.out.println(tree.isSubsumedBy(solutionTree)); +// tree.isSubsumedBy(solutionTree, literalNodeSubsumptionStrategy); +// tree.dump(); + } + } + return coveredIndividuals; + } + + protected int getCorrectPosClassified(Set<Individual> testSetPos, QTL2 qtl) { + QueryTree<String> tree = qtl.getBestSolution().getTree(); + QueryTree<String> posTree; + int i = 0; + for (Individual posInd : testSetPos) { + posTree = qtl.getTreeCache().getQueryTree(posInd.getName()); + if(posTree.isSubsumedBy(tree, literalNodeSubsumptionStrategy)){ + i++; + } + else { + System.out.println("POS NOT COVERED"); + posTree.dump(); + } + } + return i; + } + + protected int getCorrectNegClassified(SPARQLReasoner rs, Description concept, Set<Individual> testSetNeg) { + return testSetNeg.size() - rs.hasType(concept, testSetNeg).size(); + } + + protected int getCorrectNegClassified(Set<Individual> testSetNeg, QTL2 qtl) { + QueryTree<String> tree = qtl.getBestSolution().getTree(); + QueryTree<String> negTree; + int i = testSetNeg.size(); + for (Individual negInd : testSetNeg) { + negTree = qtl.getTreeCache().getQueryTree(negInd.getName()); + if(negTree.isSubsumedBy(tree, literalNodeSubsumptionStrategy)){ + i--; + } + } + return i; + } + + public static Set<Individual> getTestingSet(List<Individual> examples, int[] splits, int fold) { + int fromIndex; + // we either start from 0 or after the last fold ended + if(fold == 0) + fromIndex = 0; + else + fromIndex = splits[fold-1]; + // the split corresponds to the ends of the folds + int toIndex = splits[fold]; + +// System.out.println("from " + fromIndex + " to " + toIndex); + + Set<Individual> testingSet = new HashSet<Individual>(); + // +1 because 2nd element is exclusive in subList method + testingSet.addAll(examples.subList(fromIndex, toIndex)); + return testingSet; + } + + public static Set<Individual> getTrainingSet(Set<Individual> examples, Set<Individual> testingSet) { + return Helper.difference(examples, testingSet); + } + + // takes nr. of examples and the nr. of folds for this examples; + // returns an array which says where each fold ends, i.e. + // splits[i] is the index of the last element of fold i in the examples + public static int[] calculateSplits(int nrOfExamples, int folds) { + int[] splits = new int[folds]; + for(int i=1; i<=folds; i++) { + // we always round up to the next integer + splits[i-1] = (int)Math.ceil(i*nrOfExamples/(double)folds); + } + return splits; + } + + public static String statOutput(DecimalFormat df, Stat stat, String unit) { + String str = "av. " + df.format(stat.getMean()) + unit; + str += " (deviation " + df.format(stat.getStandardDeviation()) + unit + "; "; + str += "min " + df.format(stat.getMin()) + unit + "; "; + str += "max " + df.format(stat.getMax()) + unit + ")"; + return str; + } + + public Stat getAccuracy() { + return accuracy; + } + + public Stat getLength() { + return length; + } + + public Stat getRuntime() { + return runtime; + } + + protected void outputWriter(String output) { + if(writeToFile) { + Files.appendToFile(outputFile, output +"\n"); + System.out.println(output); + } else { + System.out.println(output); + } + + } + + public Stat getfMeasure() { + return fMeasure; + } + + public Stat getfMeasureTraining() { + return fMeasureTraining; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2014-04-30 11:45:56
|
Revision: 4253 http://sourceforge.net/p/dl-learner/code/4253 Author: lorenz_b Date: 2014-04-30 11:45:53 +0000 (Wed, 30 Apr 2014) Log Message: ----------- Added new data range classes. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/core/AnnComponentManager.java trunk/components-core/src/main/java/org/dllearner/core/Score.java trunk/components-core/src/main/java/org/dllearner/core/owl/DatatypeValueRestriction.java trunk/components-core/src/main/java/org/dllearner/core/owl/KBElementVisitor.java trunk/components-core/src/main/java/org/dllearner/core/owl/ObjectValueRestriction.java Added Paths: ----------- trunk/components-core/src/main/java/org/dllearner/core/owl/DataOneOf.java trunk/components-core/src/main/java/org/dllearner/core/owl/DoubleMinMaxRange.java trunk/components-core/src/main/java/org/dllearner/core/owl/IntDataRange.java trunk/components-core/src/main/java/org/dllearner/core/owl/IntMaxValue.java trunk/components-core/src/main/java/org/dllearner/core/owl/IntMinValue.java trunk/components-core/src/main/java/org/dllearner/core/owl/SimpleIntDataRange.java Modified: trunk/components-core/src/main/java/org/dllearner/core/AnnComponentManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/AnnComponentManager.java 2014-04-30 11:43:20 UTC (rev 4252) +++ trunk/components-core/src/main/java/org/dllearner/core/AnnComponentManager.java 2014-04-30 11:45:53 UTC (rev 4253) @@ -75,6 +75,8 @@ "org.dllearner.algorithms.DisjointClassesLearner", "org.dllearner.algorithms.SimpleSubclassLearner", "org.dllearner.algorithms.qtl.QTL", + "org.dllearner.algorithms.qtl.QTL2", + "org.dllearner.algorithms.qtl.QTL2Disjunctive", "org.dllearner.kb.KBFile", "org.dllearner.kb.OWLFile", "org.dllearner.kb.SparqlEndpointKS", Modified: trunk/components-core/src/main/java/org/dllearner/core/Score.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/Score.java 2014-04-30 11:43:20 UTC (rev 4252) +++ trunk/components-core/src/main/java/org/dllearner/core/Score.java 2014-04-30 11:45:53 UTC (rev 4253) @@ -48,4 +48,5 @@ */ public abstract double getAccuracy(); + } Added: trunk/components-core/src/main/java/org/dllearner/core/owl/DataOneOf.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/DataOneOf.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/DataOneOf.java 2014-04-30 11:45:53 UTC (rev 4253) @@ -0,0 +1,115 @@ +/** + * Copyright (C) 2007-2011, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package org.dllearner.core.owl; + +import java.util.Map; +import java.util.Set; + +public class DataOneOf implements DataRange{ + + private static final long serialVersionUID = 5494347630962268139L; + + private Set<Constant> values; + + + public DataOneOf(Set<Constant> values){ + this.values = values; + } + + public Set<Constant> getValues(){ + return values; + } + + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + StringBuffer sb = new StringBuffer(); + int count = 1; + sb.append("{"); + for(Constant ind : values){ + sb.append(ind.toString(baseURI, prefixes)); + if(count < values.size()){ + sb.append(","); + count++; + } + } + sb.append("}"); + + return sb.toString(); + } + + + @Override + public String toKBSyntaxString(String baseURI, Map<String, String> prefixes) { + StringBuffer sb = new StringBuffer(); + int count = 1; + sb.append("{"); + for(Constant ind : values){ + sb.append(ind.toKBSyntaxString(baseURI, prefixes)); + if(count < values.size()){ + sb.append(","); + count++; + } + } + sb.append("}"); + + return sb.toString(); + } + + @Override + public String toString(String baseURI, Map<String, String> prefixes) { + StringBuffer sb = new StringBuffer(); + int count = 1; + sb.append("{"); + for(Constant ind : values){ + sb.append(ind.toString(baseURI, prefixes)); + if(count < values.size()){ + sb.append(", "); + count++; + } + } + sb.append("}"); + + return sb.toString(); + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DataRange#isDatatype() + */ + @Override + public boolean isDatatype() { + return false; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#getLength() + */ + @Override + public int getLength() { + return 1; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#accept(org.dllearner.core.owl.KBElementVisitor) + */ + @Override + public void accept(KBElementVisitor visitor) { + } + +} Modified: trunk/components-core/src/main/java/org/dllearner/core/owl/DatatypeValueRestriction.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/DatatypeValueRestriction.java 2014-04-30 11:43:20 UTC (rev 4252) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/DatatypeValueRestriction.java 2014-04-30 11:45:53 UTC (rev 4253) @@ -29,7 +29,7 @@ * @author Jens Lehmann * */ -public abstract class DatatypeValueRestriction extends ValueRestriction { +public class DatatypeValueRestriction extends ValueRestriction { /** * @@ -94,5 +94,13 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#getLength() + */ + @Override + public int getLength() { + return 2; } } Added: trunk/components-core/src/main/java/org/dllearner/core/owl/DoubleMinMaxRange.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/DoubleMinMaxRange.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/DoubleMinMaxRange.java 2014-04-30 11:45:53 UTC (rev 4253) @@ -0,0 +1,94 @@ +/** + * Copyright (C) 2007-2011, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package org.dllearner.core.owl; + +import java.util.Map; + +/** + * Double data range restricted by a maximum value, e.g. + * hasAge <= 65. + * + * @author Jens Lehmann + * + */ +public class DoubleMinMaxRange implements DoubleDataRange { + + private static final long serialVersionUID = 465847501541695475L; + + private double minValue; + private double maxValue; + + public DoubleMinMaxRange(double minValue, double maxValue) { + this.minValue = minValue; + this.maxValue = maxValue; + } + + /** + * @return The minimum value. + */ + public double getMinValue() { + return minValue; + } + + /** + * @return The maximum value. + */ + public double getMaxValue() { + return maxValue; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#getLength() + */ + public int getLength() { + return 2; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#toString(java.lang.String, java.util.Map) + */ + public String toString(String baseURI, Map<String, String> prefixes) { + return " [>= " + minValue + " <= " + maxValue + "]"; + } + + public String toKBSyntaxString(String baseURI, Map<String, String> prefixes) { + return " [>= " + minValue + " <= " + maxValue + "]"; + } + + public void accept(KBElementVisitor visitor) { + visitor.visit(this); + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#toManchesterSyntaxString(java.lang.String, java.util.Map) + */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + return " [>= " + minValue + " <= " + maxValue + "]"; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DataRange#isDatatype() + */ + @Override + public boolean isDatatype() { + return false; + } +} Added: trunk/components-core/src/main/java/org/dllearner/core/owl/IntDataRange.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/IntDataRange.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/IntDataRange.java 2014-04-30 11:45:53 UTC (rev 4253) @@ -0,0 +1,30 @@ +/** + * Copyright (C) 2007-2011, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package org.dllearner.core.owl; + +/** + * Ranges of type double for use in datatye restrictions. + * + * @author Jens Lehmann + * + */ +public interface IntDataRange extends DataRange { + +} Added: trunk/components-core/src/main/java/org/dllearner/core/owl/IntMaxValue.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/IntMaxValue.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/IntMaxValue.java 2014-04-30 11:45:53 UTC (rev 4253) @@ -0,0 +1,88 @@ +/** + * Copyright (C) 2007-2011, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package org.dllearner.core.owl; + +import java.util.Map; + +/** + * Double data range restricted by a maximum value, e.g. + * hasAge <= 65. + * + * @author Jens Lehmann + * + */ +public class IntMaxValue implements SimpleIntDataRange { + + /** + * + */ + private static final long serialVersionUID = 465847501541695475L; + private int value; + + public IntMaxValue(int value) { + this.value = value; + } + + /** + * @return The maximum value. + */ + public int getValue() { + return value; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#getLength() + */ + public int getLength() { + return 2; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#toString(java.lang.String, java.util.Map) + */ + public String toString(String baseURI, Map<String, String> prefixes) { + return " <= " + value; + } + + public String toKBSyntaxString(String baseURI, Map<String, String> prefixes) { + return " <= " + value; + } + + public void accept(KBElementVisitor visitor) { + visitor.visit(this); + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#toManchesterSyntaxString(java.lang.String, java.util.Map) + */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + return " <= " + value; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DataRange#isDatatype() + */ + @Override + public boolean isDatatype() { + return false; + } + +} Added: trunk/components-core/src/main/java/org/dllearner/core/owl/IntMinValue.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/IntMinValue.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/IntMinValue.java 2014-04-30 11:45:53 UTC (rev 4253) @@ -0,0 +1,87 @@ +/** + * Copyright (C) 2007-2011, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package org.dllearner.core.owl; + +import java.util.Map; + +/** + * Double data range restricted by a minimum value, e.g. + * hasAge >= 18. + * + * @author Jens Lehmann + * + */ +public class IntMinValue implements SimpleIntDataRange { + + /** + * + */ + private static final long serialVersionUID = 8808907963085216763L; + private int value; + + public IntMinValue(int value) { + this.value = value; + } + + /** + * @return The maximum value. + */ + public int getValue() { + return value; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#getLength() + */ + public int getLength() { + return 2; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#toString(java.lang.String, java.util.Map) + */ + public String toString(String baseURI, Map<String, String> prefixes) { + return " >= " + value; + } + + public String toKBSyntaxString(String baseURI, Map<String, String> prefixes) { + return " >= " + value; + } + + public void accept(KBElementVisitor visitor) { + visitor.visit(this); + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#toManchesterSyntaxString(java.lang.String, java.util.Map) + */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + return " >= " + value; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.DataRange#isDatatype() + */ + @Override + public boolean isDatatype() { + return false; + } +} Modified: trunk/components-core/src/main/java/org/dllearner/core/owl/KBElementVisitor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/KBElementVisitor.java 2014-04-30 11:43:20 UTC (rev 4252) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/KBElementVisitor.java 2014-04-30 11:45:53 UTC (rev 4253) @@ -34,7 +34,11 @@ void visit(DoubleMaxValue doubleMaxValue); void visit(DoubleMinValue doubleMinValue); + + void visit(IntMaxValue doubleMaxValue); + void visit(IntMinValue doubleMinValue); + void visit(Individual individual); void visit(KB kb); @@ -45,4 +49,9 @@ void visit(Annotation annotation); + /** + * @param doubleMinMaxRange + */ + void visit(DoubleMinMaxRange doubleMinMaxRange); + } Modified: trunk/components-core/src/main/java/org/dllearner/core/owl/ObjectValueRestriction.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/ObjectValueRestriction.java 2014-04-30 11:43:20 UTC (rev 4252) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/ObjectValueRestriction.java 2014-04-30 11:45:53 UTC (rev 4253) @@ -69,11 +69,11 @@ * @see org.dllearner.core.owl.KBElement#toString(java.lang.String, java.util.Map) */ public String toString(String baseURI, Map<String, String> prefixes) { - return restrictedPropertyExpression.toString(baseURI, prefixes) + " hasValue " + value.toString(baseURI, prefixes); + return restrictedPropertyExpression.toString(baseURI, prefixes) + " VALUE " + value.toString(baseURI, prefixes); } public String toKBSyntaxString(String baseURI, Map<String, String> prefixes) { - return "(" + restrictedPropertyExpression.toKBSyntaxString(baseURI, prefixes) + " HASVALUE " + value.toKBSyntaxString(baseURI, prefixes) + ")"; + return "(" + restrictedPropertyExpression.toKBSyntaxString(baseURI, prefixes) + " VALUE " + value.toKBSyntaxString(baseURI, prefixes) + ")"; } public Individual getIndividual() { Added: trunk/components-core/src/main/java/org/dllearner/core/owl/SimpleIntDataRange.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/SimpleIntDataRange.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/SimpleIntDataRange.java 2014-04-30 11:45:53 UTC (rev 4253) @@ -0,0 +1,33 @@ +/** + * Copyright (C) 2007-2011, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package org.dllearner.core.owl; + +/** + * A int data range with a single value used for restrictions, + * e.g. hasAge >= 18 (but not 65 >= hasAge >= 18). + * + * @author Jens Lehmann + * + */ +public interface SimpleIntDataRange extends IntDataRange { + + public int getValue(); + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2014-04-30 11:43:26
|
Revision: 4252 http://sourceforge.net/p/dl-learner/code/4252 Author: lorenz_b Date: 2014-04-30 11:43:20 +0000 (Wed, 30 Apr 2014) Log Message: ----------- Added new version of QTL. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/cache/QueryTreeCache.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/QueryTree.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/impl/QueryTreeImpl.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/impl/QueryTreeFactoryImpl.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/NBR.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/PostLGG.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/EvaluatedQueryTree.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/NoiseSensitiveLGG.java Added Paths: ----------- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2Disjunctive.java Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL.java 2014-04-23 10:47:59 UTC (rev 4251) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL.java 2014-04-30 11:43:20 UTC (rev 4252) @@ -19,6 +19,7 @@ */ package org.dllearner.algorithms.qtl; +import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -31,7 +32,15 @@ import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; +import java.util.concurrent.TimeUnit; +import org.aksw.jena_sparql_api.cache.core.QueryExecutionFactoryCacheEx; +import org.aksw.jena_sparql_api.cache.extra.CacheCoreEx; +import org.aksw.jena_sparql_api.cache.extra.CacheCoreH2; +import org.aksw.jena_sparql_api.cache.extra.CacheEx; +import org.aksw.jena_sparql_api.cache.extra.CacheExImpl; +import org.aksw.jena_sparql_api.http.QueryExecutionFactoryHttp; +import org.aksw.jena_sparql_api.model.QueryExecutionFactoryModel; import org.apache.commons.collections15.ListUtils; import org.apache.log4j.Logger; import org.dllearner.algorithms.qtl.cache.QueryTreeCache; @@ -46,34 +55,36 @@ import org.dllearner.algorithms.qtl.operations.lgg.LGGGenerator; import org.dllearner.algorithms.qtl.operations.lgg.LGGGeneratorImpl; import org.dllearner.algorithms.qtl.util.SPARQLEndpointEx; -import org.dllearner.core.AbstractComponent; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.AbstractLearningProblem; import org.dllearner.core.ComponentAnn; -import org.dllearner.core.ComponentManager; +import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.SparqlQueryLearningAlgorithm; import org.dllearner.core.options.CommonConfigOptions; import org.dllearner.core.options.ConfigOption; import org.dllearner.core.options.IntegerConfigOption; +import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.kb.LocalModelBasedSparqlEndpointKS; import org.dllearner.kb.SparqlEndpointKS; import org.dllearner.kb.sparql.CachingConciseBoundedDescriptionGenerator; import org.dllearner.kb.sparql.ConciseBoundedDescriptionGenerator; import org.dllearner.kb.sparql.ConciseBoundedDescriptionGeneratorImpl; -import org.dllearner.kb.sparql.ExtractionDBCache; import org.dllearner.kb.sparql.SparqlEndpoint; -import org.dllearner.kb.sparql.SparqlQuery; import org.dllearner.learningproblems.PosNegLP; import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.utilities.Helper; +import org.dllearner.utilities.owl.DLLearnerDescriptionConvertVisitor; +import org.dllearner.utilities.owl.OWLAPIDescriptionConvertVisitor; +import org.semanticweb.owlapi.owllink.parser.OWLlinkDescriptionElementHandler; import org.springframework.beans.factory.annotation.Autowired; -import com.hp.hpl.jena.query.QueryExecutionFactory; +import com.google.common.collect.Sets; +import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSet; -import com.hp.hpl.jena.query.ResultSetRewindable; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.Statement; import com.hp.hpl.jena.rdf.model.StmtIterator; @@ -89,7 +100,7 @@ * */ @ComponentAnn(name="query tree learner", shortName="qtl", version=0.8) -public class QTL extends AbstractComponent implements SparqlQueryLearningAlgorithm { +public class QTL extends AbstractCELA implements SparqlQueryLearningAlgorithm { private static final Logger logger = Logger.getLogger(QTL.class); @@ -99,7 +110,8 @@ private SparqlEndpoint endpoint; private Model model; - private ExtractionDBCache cache; + private org.aksw.jena_sparql_api.core.QueryExecutionFactory qef; + private String cacheDirectory; private QueryTreeCache treeCache; @@ -123,6 +135,7 @@ private SortedSet<String> lggInstances; private Set<String> objectNamespacesToIgnore = new HashSet<String>(); + private Set<String> allowedNamespaces = new HashSet<String>(); private Map<String, String> prefixes = new HashMap<String, String>(); private boolean enableNumericLiteralFilters = false; @@ -137,52 +150,44 @@ } public QTL(AbstractLearningProblem learningProblem, SparqlEndpointKS endpointKS) throws LearningProblemUnsupportedException{ - if(!(learningProblem instanceof PosOnlyLP || learningProblem instanceof PosNegLP)){ - throw new LearningProblemUnsupportedException(learningProblem.getClass(), getClass()); - } - this.learningProblem = learningProblem; - this.endpointKS = endpointKS; - -// this.configurator = new QTLConfigurator(this); + this(learningProblem, endpointKS, null); } - public QTL(AbstractLearningProblem learningProblem, SparqlEndpointKS endpointKS, ExtractionDBCache cache) throws LearningProblemUnsupportedException{ + public QTL(AbstractLearningProblem learningProblem, SparqlEndpointKS endpointKS, String cacheDirectory) throws LearningProblemUnsupportedException{ if(!(learningProblem instanceof PosOnlyLP || learningProblem instanceof PosNegLP)){ throw new LearningProblemUnsupportedException(learningProblem.getClass(), getClass()); } this.learningProblem = learningProblem; this.endpointKS = endpointKS; - this.cache = cache; - -// this.configurator = new QTLConfigurator(this); + this.cacheDirectory = cacheDirectory; } - public QTL(SPARQLEndpointEx endpoint, ExtractionDBCache cache) { + public QTL(SPARQLEndpointEx endpoint, String cacheDirectory) { this.endpoint = endpoint; - this.cache = cache; + this.cacheDirectory = cacheDirectory; treeCache = new QueryTreeCache(); - cbdGenerator = new CachingConciseBoundedDescriptionGenerator(new ConciseBoundedDescriptionGeneratorImpl(endpoint, cache)); + cbdGenerator = new CachingConciseBoundedDescriptionGenerator(new ConciseBoundedDescriptionGeneratorImpl(endpoint, cacheDirectory)); cbdGenerator.setRecursionDepth(maxQueryTreeDepth); lggGenerator = new LGGGeneratorImpl<String>(); - nbr = new NBR<String>(endpoint, cache); + nbr = new NBR<String>(endpoint, cacheDirectory); nbr.setMaxExecutionTimeInSeconds(maxExecutionTimeInSeconds); posExampleTrees = new ArrayList<QueryTree<String>>(); negExampleTrees = new ArrayList<QueryTree<String>>(); } - public QTL(SparqlEndpointKS endpointKS, ExtractionDBCache cache) { + public QTL(SparqlEndpointKS endpointKS, String cacheDirectory) { this.endpointKS = endpointKS; - this.cache = cache; + this.cacheDirectory = cacheDirectory; treeCache = new QueryTreeCache(); - cbdGenerator = new CachingConciseBoundedDescriptionGenerator(new ConciseBoundedDescriptionGeneratorImpl(endpoint, cache)); + cbdGenerator = new CachingConciseBoundedDescriptionGenerator(new ConciseBoundedDescriptionGeneratorImpl(endpoint, cacheDirectory)); cbdGenerator.setRecursionDepth(maxQueryTreeDepth); lggGenerator = new LGGGeneratorImpl<String>(); - nbr = new NBR<String>(endpoint, cache); + nbr = new NBR<String>(endpoint, cacheDirectory); nbr.setMaxExecutionTimeInSeconds(maxExecutionTimeInSeconds); posExampleTrees = new ArrayList<QueryTree<String>>(); @@ -369,20 +374,15 @@ private SortedSet<String> getResources(QueryTree<String> tree){ SortedSet<String> resources = new TreeSet<String>(); String query = getDistinctSPARQLQuery(tree); - ResultSet rs; - if(endpoint != null){ - rs = SparqlQuery.convertJSONtoResultSet(cache.executeSelectQuery(endpoint, query)); - } else { - rs = QueryExecutionFactory.create(query, model).execSelect(); - } + QueryExecution qe = qef.createQueryExecution(query); + ResultSet rs = qe.execSelect(); - String uri; QuerySolution qs; while(rs.hasNext()){ qs = rs.next(); - uri = qs.getResource("x0").getURI(); - resources.add(uri); + resources.add(qs.getResource("x0").getURI()); } + qe.close(); return resources; } @@ -392,12 +392,30 @@ return query; } +// @Override +// public void start(){ +// generatePositiveExampleTrees(); +// +// lgg = lggGenerator.getLGG(posExampleTrees); +// +// if(queryTreeFilter != null){ +// lgg = queryTreeFilter.getFilteredQueryTree(lgg); +// } +// if(logger.isDebugEnabled()){ +// logger.debug("LGG: \n" + lgg.getStringRepresentation()); +// } +// if(logger.isInfoEnabled()){ +// logger.info("Generated SPARQL query:\n" + lgg.toSPARQLQueryString(true, enableNumericLiteralFilters, prefixes)); +// } +// } + @Override public void start(){ + //build the query trees for the positive examples generatePositiveExampleTrees(); + //compute the LGG lgg = lggGenerator.getLGG(posExampleTrees); - if(queryTreeFilter != null){ lgg = queryTreeFilter.getFilteredQueryTree(lgg); } @@ -405,8 +423,36 @@ logger.debug("LGG: \n" + lgg.getStringRepresentation()); } if(logger.isInfoEnabled()){ - logger.info(lgg.toSPARQLQueryString(true, enableNumericLiteralFilters, prefixes)); + logger.info("Generated SPARQL query:\n" + lgg.toSPARQLQueryString(true, enableNumericLiteralFilters, prefixes)); } + + //build the query trees for the negative examples + if(!negExamples.isEmpty()){ + generateNegativeExampleTrees(); + + try { + //check if the LGG covers a negative example + int index = coversNegativeQueryTree(lgg); + if(index != -1){ + throw new NegativeTreeCoverageExecption(negExamples.get(index)); + } + + lggInstances = getResources(lgg); + nbr.setLGGInstances(lggInstances); + + String question; + if(negExamples.isEmpty()){ + question = nbr.getQuestion(lgg, negExampleTrees, getKnownResources()); + } else { + question = nbr.getQuestion(lgg, negExampleTrees, getKnownResources()); + } + logger.info("Question:\n" + question); + } catch (NegativeTreeCoverageExecption e) { + e.printStackTrace(); + } catch (TimeOutException e) { + e.printStackTrace(); + } + } } public void setEnableNumericLiteralFilters(boolean enableNumericLiteralFilters) { @@ -428,19 +474,43 @@ } public void init() { + if(endpointKS.isRemote()){ + SparqlEndpoint endpoint = endpointKS.getEndpoint(); + qef = new QueryExecutionFactoryHttp(endpoint.getURL().toString(), endpoint.getDefaultGraphURIs()); + if(cacheDirectory != null){ + try { + long timeToLive = TimeUnit.DAYS.toMillis(30); + CacheCoreEx cacheBackend = CacheCoreH2.create(cacheDirectory, timeToLive, true); + CacheEx cacheFrontend = new CacheExImpl(cacheBackend); + qef = new QueryExecutionFactoryCacheEx(qef, cacheFrontend); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } catch (SQLException e) { + e.printStackTrace(); + } + } +// qef = new QueryExecutionFactoryPaginated(qef, 10000); + + } else { + qef = new QueryExecutionFactoryModel(((LocalModelBasedSparqlEndpointKS)endpointKS).getModel()); + } + + if(learningProblem instanceof PosOnlyLP){ this.posExamples = convert(((PosOnlyLP)learningProblem).getPositiveExamples()); + this.negExamples = new ArrayList<String>(); } else if(learningProblem instanceof PosNegLP){ this.posExamples = convert(((PosNegLP)learningProblem).getPositiveExamples()); this.negExamples = convert(((PosNegLP)learningProblem).getNegativeExamples()); } treeCache = new QueryTreeCache(); + treeCache.addAllowedNamespaces(allowedNamespaces); if(endpointKS instanceof LocalModelBasedSparqlEndpointKS){ cbdGenerator = new CachingConciseBoundedDescriptionGenerator(new ConciseBoundedDescriptionGeneratorImpl(((LocalModelBasedSparqlEndpointKS) endpointKS).getModel())); } else { endpoint = endpointKS.getEndpoint(); - cbdGenerator = new CachingConciseBoundedDescriptionGenerator(new ConciseBoundedDescriptionGeneratorImpl(endpoint, cache)); + cbdGenerator = new CachingConciseBoundedDescriptionGenerator(new ConciseBoundedDescriptionGeneratorImpl(endpoint, endpointKS.getCache())); } cbdGenerator.setRecursionDepth(maxQueryTreeDepth); @@ -464,6 +534,58 @@ return lgg; } + @Autowired + public void setLearningProblem(LearningProblem learningProblem) { + this.learningProblem = learningProblem; + } + + public SparqlEndpointKS getEndpointKS() { + return endpointKS; + } + + @Autowired + public void setEndpointKS(SparqlEndpointKS endpointKS) { + this.endpointKS = endpointKS; + } + + /* (non-Javadoc) + * @see org.dllearner.core.StoppableLearningAlgorithm#stop() + */ + @Override + public void stop() { + } + + /* (non-Javadoc) + * @see org.dllearner.core.StoppableLearningAlgorithm#isRunning() + */ + @Override + public boolean isRunning() { + return false; + } + + /* (non-Javadoc) + * @see org.dllearner.core.AbstractCELA#getCurrentlyBestDescription() + */ + @Override + public Description getCurrentlyBestDescription() { + return (lgg == null) ? null : DLLearnerDescriptionConvertVisitor.getDLLearnerDescription(lgg.asOWLClassExpression()); + } + + /* (non-Javadoc) + * @see org.dllearner.core.AbstractCELA#getCurrentlyBestEvaluatedDescription() + */ + @Override + public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { + return null; + } + + /** + * @param allowedNamespaces the allowedNamespaces to set + */ + public void setAllowedNamespaces(Set<String> allowedNamespaces) { + this.allowedNamespaces = allowedNamespaces; + } + public static void main(String[] args) throws Exception { Set<String> positiveExamples = new HashSet<String>(); positiveExamples.add("http://dbpedia.org/resource/Liverpool_F.C."); @@ -473,31 +595,14 @@ ks.init(); PosOnlyLP lp = new PosOnlyLP(); lp.setPositiveExamples(Helper.getIndividualSet(positiveExamples)); - QTL qtl = new QTL(lp, ks); + QTL qtl = new QTL(lp, ks, "cache"); + qtl.setAllowedNamespaces(Sets.newHashSet("http://dbpedia.org/ontology/", "http://dbpedia.org/resource/")); qtl.addQueryTreeFilter(new QuestionBasedQueryTreeFilter(Arrays.asList("soccer club", "Premier League"))); qtl.init(); qtl.start(); String query = qtl.getBestSPARQLQuery(); System.out.println(query); + System.out.println(qtl.getCurrentlyBestDescription()); } - - public LearningProblem getLearningProblem() { - return learningProblem; - } - - @Autowired - public void setLearningProblem(LearningProblem learningProblem) { - this.learningProblem = learningProblem; - } - - public SparqlEndpointKS getEndpointKS() { - return endpointKS; - } - - @Autowired - public void setEndpointKS(SparqlEndpointKS endpointKS) { - this.endpointKS = endpointKS; - } - } Added: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2.java 2014-04-30 11:43:20 UTC (rev 4252) @@ -0,0 +1,368 @@ +package org.dllearner.algorithms.qtl; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.PriorityQueue; +import java.util.Queue; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.apache.log4j.Logger; +import org.dllearner.algorithms.qtl.cache.QueryTreeCache; +import org.dllearner.algorithms.qtl.datastructures.QueryTree; +import org.dllearner.algorithms.qtl.datastructures.impl.QueryTreeImpl.LiteralNodeConversionStrategy; +import org.dllearner.algorithms.qtl.operations.lgg.EvaluatedQueryTree; +import org.dllearner.algorithms.qtl.operations.lgg.LGGGenerator; +import org.dllearner.algorithms.qtl.operations.lgg.LGGGeneratorImpl; +import org.dllearner.core.AbstractCELA; +import org.dllearner.core.AbstractReasonerComponent; +import org.dllearner.core.ComponentAnn; +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.KnowledgeSource; +import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; +import org.dllearner.kb.OWLFile; +import org.dllearner.learningproblems.AxiomScore; +import org.dllearner.learningproblems.Heuristics; +import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.utilities.owl.DLLearnerDescriptionConvertVisitor; +import org.springframework.beans.factory.annotation.Autowired; + +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; +import com.jamonapi.Monitor; +import com.jamonapi.MonitorFactory; + +@ComponentAnn(name="query tree learner with noise", shortName="qtl2", version=0.8) +public class QTL2 extends AbstractCELA { + + + private static final Logger logger = Logger.getLogger(QTL2.class.getName()); + + private LGGGenerator<String> lggGenerator = new LGGGeneratorImpl<String>(); + + private Queue<EvaluatedQueryTree<String>> todoList; + private SortedSet<EvaluatedQueryTree<String>> solutions; + + private double currentlyBestScore = 0d; + + private List<QueryTree<String>> posExamples; + private List<QueryTree<String>> negExamples; + + private double coverageWeight = 1; + private double specifityWeight = 0; + + private QueryTreeCache treeCache; + + private PosNegLP lp; + + private Model model; + + private AbstractReasonerComponent reasoner; + + private volatile boolean stop; + private boolean isRunning; + + public QTL2() {} + + public QTL2(PosNegLP learningProblem, AbstractReasonerComponent reasoner) throws LearningProblemUnsupportedException{ + this.lp = learningProblem; + this.reasoner = reasoner; + + } + + public QTL2(PosNegLP lp, Model model) { + this.lp = lp; + this.model = model; + } + + /* (non-Javadoc) + * @see org.dllearner.core.Component#init() + */ + @Override + public void init() throws ComponentInitException { + logger.info("Initializing..."); + treeCache = new QueryTreeCache(model); + + posExamples = new ArrayList<QueryTree<String>>(); + negExamples = new ArrayList<QueryTree<String>>(); + + //get the query trees + for (Individual ind : lp.getPositiveExamples()) { + posExamples.add(treeCache.getQueryTree(ind.getName())); + } + for (Individual ind : lp.getNegativeExamples()) { + negExamples.add(treeCache.getQueryTree(ind.getName())); + } + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#start() + */ + @Override + public void start() { + logger.info("Running..."); + stop = false; + isRunning = true; + long startTime = System.currentTimeMillis(); + currentlyBestScore = 0d; + + Monitor subMon = MonitorFactory.getTimeMonitor("subsumption-mon"); + Monitor lggMon = MonitorFactory.getTimeMonitor("lgg-mon"); + + init(posExamples, negExamples); + + EvaluatedQueryTree<String> currentElement; + do{ + logger.trace("TODO list size: " + todoList.size()); + //pick best element from todo list + currentElement = todoList.poll(); + //generate the LGG between the chosen tree and each uncovered positive example + for (QueryTree<String> example : currentElement.getFalseNegatives()) { + QueryTree<String> tree = currentElement.getTree(); + //compute the LGG + lggMon.start(); + QueryTree<String> lgg = lggGenerator.getLGG(tree, example); + lggMon.stop(); +// tree.dump();System.out.println("++++++++++++++++++++++++++++++++"); +// example.dump();System.out.println("############################"); +// lgg.dump();System.out.println("******************************"); + + + //evaluate the LGG + EvaluatedQueryTree<String> solution = evaluate(lgg); + + if(solution.getScore() >= currentlyBestScore){ + //add to todo list, if not already contained in todo list or solution list + todo(solution); + currentlyBestScore = solution.getScore(); + } + + } + solutions.add(currentElement); +// todoList.remove(currentElement); + } while(!terminationCriteriaSatisfied()); + long endTime = System.currentTimeMillis(); + logger.info("Finished in " + (endTime-startTime) + "ms."); + logger.info("Best solution:\n" + getCurrentlyBestEvaluatedDescription()); + + logger.trace("LGG time: " + lggMon.getTotal() + "ms"); + logger.trace("Avg. LGG time: " + lggMon.getAvg() + "ms"); + logger.trace("#LGG computations: " + lggMon.getHits()); + logger.trace("Subsumption test time: " + subMon.getTotal() + "ms"); + logger.trace("Avg. subsumption test time: " + subMon.getAvg() + "ms"); + logger.trace("#Subsumption tests: " + subMon.getHits()); + } + + public EvaluatedQueryTree<String> getBestSolution(){ + return solutions.first(); + } + + /* (non-Javadoc) + * @see org.dllearner.core.AbstractCELA#getCurrentlyBestDescription() + */ + @Override + public Description getCurrentlyBestDescription() { + return getCurrentlyBestEvaluatedDescription().getDescription(); + } + + /* (non-Javadoc) + * @see org.dllearner.core.AbstractCELA#getCurrentlyBestEvaluatedDescription() + */ + @Override + public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { + EvaluatedQueryTree<String> bestSolution = solutions.first(); + Description description = DLLearnerDescriptionConvertVisitor.getDLLearnerDescription( + bestSolution.getTree().asOWLClassExpression(LiteralNodeConversionStrategy.FACET_RESTRICTION)); + return new EvaluatedDescription(description, new AxiomScore(bestSolution.getScore())); + } + + /** + * @return the treeCache + */ + public QueryTreeCache getTreeCache() { + return treeCache; + } + + /* (non-Javadoc) + * @see org.dllearner.core.StoppableLearningAlgorithm#isRunning() + */ + @Override + public boolean isRunning() { + return isRunning; + } + + @Autowired + public void setLearningProblem(PosNegLP learningProblem) { + this.lp = learningProblem; + } + + @Autowired + public void setReasoner(AbstractReasonerComponent reasoner){ + this.reasoner = reasoner; + model = ModelFactory.createDefaultModel(); + for (KnowledgeSource ks : reasoner.getSources()) { + if(ks instanceof OWLFile){ + try { + model.read(((OWLFile) ks).getURL().openStream(), null); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + + + /* (non-Javadoc) + * @see org.dllearner.core.StoppableLearningAlgorithm#stop() + */ + @Override + public void stop() { + stop = true; + } + + private EvaluatedQueryTree<String> evaluate(QueryTree<String> tree){ + //1. get a score for the coverage = recall oriented + //compute positive examples which are not covered by LGG + Collection<QueryTree<String>> uncoveredPositiveExamples = getUncoveredTrees(tree, posExamples); + //compute negative examples which are covered by LGG + Collection<QueryTree<String>> coveredNegativeExamples = getCoveredTrees(tree, negExamples); + //compute score + int coveredPositiveExamples = posExamples.size() - uncoveredPositiveExamples.size(); + double recall = coveredPositiveExamples / (double)posExamples.size(); + double precision = (coveredNegativeExamples.size() + coveredPositiveExamples == 0) + ? 0 + : coveredPositiveExamples / (double)(coveredPositiveExamples + coveredNegativeExamples.size()); + + double coverageScore = recall;//Heuristics.getFScore(recall, precision); + + //2. get a score for the specifity of the query, i.e. how many edges/nodes = precision oriented + int numberOfSpecificNodes = 0; + for (QueryTree<String> childNode : tree.getChildrenClosure()) { + if(!childNode.getUserObject().equals("?")){ + numberOfSpecificNodes++; + } + } + double specifityScore = Math.log(numberOfSpecificNodes); + + //3.compute the total score + double score = coverageWeight * coverageScore + specifityWeight * specifityScore; + + EvaluatedQueryTree<String> evaluatedTree = new EvaluatedQueryTree<String>(tree, uncoveredPositiveExamples, coveredNegativeExamples, score); + + return evaluatedTree; + } + + /** + * Return all trees from the given list {@code allTrees} which are not already subsumed by {@code tree}. + * @param tree + * @param allTrees + * @return + */ + private Collection<QueryTree<String>> getCoveredTrees(QueryTree<String> tree, List<QueryTree<String>> trees){ + Collection<QueryTree<String>> coveredTrees = new ArrayList<QueryTree<String>>(); + for (QueryTree<String> queryTree : trees) { + boolean subsumed = queryTree.isSubsumedBy(tree); + if(subsumed){ + coveredTrees.add(queryTree); + } + } + return coveredTrees; + } + + /** + * Return all trees from the given list {@code allTrees} which are not already subsumed by {@code tree}. + * @param tree + * @param allTrees + * @return + */ + private Collection<QueryTree<String>> getUncoveredTrees(QueryTree<String> tree, List<QueryTree<String>> allTrees){ + Collection<QueryTree<String>> uncoveredTrees = new ArrayList<QueryTree<String>>(); + for (QueryTree<String> queryTree : allTrees) { + boolean subsumed = queryTree.isSubsumedBy(tree); + if(!subsumed){ + uncoveredTrees.add(queryTree); + } + } + return uncoveredTrees; + } + + /** + * Initializes the todo list with all distinct trees contained in the given list {@code trees}. + * Firstly, distinct trees are computed and afterwards, for each tree a score is computed. + * @param trees + */ + private void init(List<QueryTree<String>> posExamples, List<QueryTree<String>> negExamples){ + todoList = new PriorityQueue<EvaluatedQueryTree<String>>(); + solutions = new TreeSet<EvaluatedQueryTree<String>>(); +// EvaluatedQueryTree<String> dummy = new EvaluatedQueryTree<String>(new QueryTreeImpl<String>((N)"TOP"), trees, 0d); +// todoList.add(dummy); + //compute distinct trees + Collection<QueryTree<String>> distinctTrees = new ArrayList<QueryTree<String>>(); + for (QueryTree<String> queryTree : posExamples) { + boolean distinct = true; + for (QueryTree<String> otherTree : distinctTrees) { + if(!queryTree.equals(otherTree)){ + if(queryTree.isSameTreeAs(otherTree)){ + distinct = false; + break; + } + } + } + if(distinct){ + distinctTrees.add(queryTree); + } + } + for (QueryTree<String> queryTree : distinctTrees) {//System.out.println(queryTree.getStringRepresentation()); + //compute positive examples which are not covered by LGG + Collection<QueryTree<String>> uncoveredPositiveExamples = getUncoveredTrees(queryTree, posExamples); + //compute negative examples which are covered by LGG + Collection<QueryTree<String>> coveredNegativeExamples = getCoveredTrees(queryTree, negExamples); + //compute score + int coveredPositiveExamples = posExamples.size() - uncoveredPositiveExamples.size(); + double recall = coveredPositiveExamples / (double)posExamples.size(); + double precision = (coveredNegativeExamples.size() + coveredPositiveExamples == 0) + ? 0 + : coveredPositiveExamples / (double)(coveredPositiveExamples + coveredNegativeExamples.size()); + + double score = Heuristics.getFScore(recall, precision); + todoList.add(new EvaluatedQueryTree<String>(queryTree, uncoveredPositiveExamples, coveredNegativeExamples, score)); + } + } + + private boolean sameTrees(QueryTree<String> tree1, QueryTree<String> tree2){ + return tree1.isSubsumedBy(tree2) && tree2.isSubsumedBy(tree1); + } + + private boolean terminationCriteriaSatisfied(){ + return stop || todoList.isEmpty(); + } + + /** + * Add tree to todo list if not already contained in that list or the solutions. + * @param solution + */ + private void todo(EvaluatedQueryTree<String> solution){ + //check if not already contained in todo list + for (EvaluatedQueryTree<String> evTree : todoList) { + if(sameTrees(solution.getTree(), evTree.getTree())){ + return; + } + } + //check if not already contained in solutions + for (EvaluatedQueryTree<String> evTree : solutions) { + if(sameTrees(solution.getTree(), evTree.getTree())){ + return; + } + } + todoList.add(solution); + } + + + +} Added: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2Disjunctive.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2Disjunctive.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/QTL2Disjunctive.java 2014-04-30 11:43:20 UTC (rev 4252) @@ -0,0 +1,412 @@ +package org.dllearner.algorithms.qtl; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.PriorityQueue; +import java.util.Queue; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.apache.log4j.Logger; +import org.dllearner.algorithms.qtl.cache.QueryTreeCache; +import org.dllearner.algorithms.qtl.datastructures.QueryTree; +import org.dllearner.algorithms.qtl.datastructures.impl.QueryTreeImpl.LiteralNodeConversionStrategy; +import org.dllearner.algorithms.qtl.operations.lgg.EvaluatedQueryTree; +import org.dllearner.algorithms.qtl.operations.lgg.LGGGenerator; +import org.dllearner.algorithms.qtl.operations.lgg.LGGGeneratorImpl; +import org.dllearner.core.AbstractCELA; +import org.dllearner.core.AbstractReasonerComponent; +import org.dllearner.core.ComponentAnn; +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.KnowledgeSource; +import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; +import org.dllearner.kb.OWLFile; +import org.dllearner.learningproblems.AxiomScore; +import org.dllearner.learningproblems.Heuristics; +import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.utilities.owl.DLLearnerDescriptionConvertVisitor; +import org.dllearner.utilities.owl.OWLAPIConverter; +import org.semanticweb.owlapi.io.ToStringRenderer; +import org.semanticweb.owlapi.util.SimpleShortFormProvider; +import org.springframework.beans.factory.annotation.Autowired; + +import uk.ac.manchester.cs.owl.owlapi.mansyntaxrenderer.ManchesterOWLSyntaxOWLObjectRendererImpl; + +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; +import com.jamonapi.Monitor; +import com.jamonapi.MonitorFactory; + +@ComponentAnn(name="query tree learner with noise (disjunctive)", shortName="qtl2dis", version=0.8) +public class QTL2Disjunctive extends AbstractCELA { + + + private static final Logger logger = Logger.getLogger(QTL2Disjunctive.class.getName()); + + private LGGGenerator<String> lggGenerator = new LGGGeneratorImpl<String>(); + + private Queue<EvaluatedQueryTree<String>> todoList; + private SortedSet<EvaluatedQueryTree<String>> solutions; + + private double currentlyBestScore = 0d; + + private List<QueryTree<String>> posExamples; + private List<QueryTree<String>> negExamples; + + private double coverageWeight = 0.6; + private double specifityWeight = 0.4; + + private QueryTreeCache treeCache; + + private PosNegLP lp; + + private Model model; + + private AbstractReasonerComponent reasoner; + + private volatile boolean stop; + private boolean isRunning; + + private Monitor subMon; + private Monitor lggMon; + + public QTL2Disjunctive() {} + + public QTL2Disjunctive(PosNegLP learningProblem, AbstractReasonerComponent reasoner) throws LearningProblemUnsupportedException{ + this.lp = learningProblem; + this.reasoner = reasoner; + + } + + public QTL2Disjunctive(PosNegLP lp, Model model) { + this.lp = lp; + this.model = model; + } + + public EvaluatedQueryTree<String> getBestSolution(){ + return solutions.first(); + } + + /* (non-Javadoc) + * @see org.dllearner.core.Component#init() + */ + @Override + public void init() throws ComponentInitException { + logger.info("Initializing..."); + treeCache = new QueryTreeCache(model); + + posExamples = new ArrayList<QueryTree<String>>(); + negExamples = new ArrayList<QueryTree<String>>(); + + //get the query trees + for (Individual ind : lp.getPositiveExamples()) { + posExamples.add(treeCache.getQueryTree(ind.getName())); + } + for (Individual ind : lp.getNegativeExamples()) { + negExamples.add(treeCache.getQueryTree(ind.getName())); + } + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#start() + */ + @Override + public void start() { + logger.info("Running..."); + stop = false; + isRunning = true; + long startTime = System.currentTimeMillis(); + currentlyBestScore = 0d; + + subMon = MonitorFactory.getTimeMonitor("subsumption-mon"); + lggMon = MonitorFactory.getTimeMonitor("lgg-mon"); + + + //outer loop: compute LGG, pick best solution and remove all covered positive and negative examples + List<EvaluatedQueryTree<String>> unionSolutions = new ArrayList<EvaluatedQueryTree<String>>(); + do { + //compute LGG + computeLGG(); + + //pick best solution computed so far + EvaluatedQueryTree<String> bestSolution = solutions.first(); + unionSolutions.add(bestSolution); + logger.info("#Uncovered pos. examples:" + bestSolution.getFalseNegatives().size()); + + //remove all covered examples + QueryTree<String> tree; + for (Iterator<QueryTree<String>> iterator = posExamples.iterator(); iterator.hasNext();) { + tree = iterator.next(); + if(tree.isSubsumedBy(bestSolution.getTree())){ + iterator.remove(); + } + } + for (Iterator<QueryTree<String>> iterator = negExamples.iterator(); iterator.hasNext();) { + tree = iterator.next(); + if(tree.isSubsumedBy(bestSolution.getTree())){ + iterator.remove(); + } + } + } while (!(stop || posExamples.isEmpty())); + + + } + + private void computeLGG(){ + currentlyBestScore = 0d; + initTodoList(posExamples, negExamples); + + long startTime = System.currentTimeMillis(); + EvaluatedQueryTree<String> currentElement; + do{ + logger.trace("TODO list size: " + todoList.size()); + //pick best element from todo list + currentElement = todoList.poll(); + //generate the LGG between the chosen tree and each uncovered positive example + for (QueryTree<String> example : currentElement.getFalseNegatives()) { + QueryTree<String> tree = currentElement.getTree(); + + //compute the LGG + lggMon.start(); + QueryTree<String> lgg = lggGenerator.getLGG(tree, example); + lggMon.stop(); + + //evaluate the LGG + EvaluatedQueryTree<String> solution = evaluate(lgg); + + if(solution.getScore() >= currentlyBestScore){ + //add to todo list, if not already contained in todo list or solution list + todo(solution); + if(solution.getScore() > currentlyBestScore){ + logger.info("Got better solution:" + currentlyBestScore); + } + currentlyBestScore = solution.getScore(); + } + + } + solutions.add(currentElement); +// todoList.remove(currentElement); + } while(!terminationCriteriaSatisfied()); + long endTime = System.currentTimeMillis(); + logger.info("Finished in " + (endTime-startTime) + "ms."); + EvaluatedDescription bestSolution = getCurrentlyBestEvaluatedDescription(); + ToStringRenderer.getInstance().setRenderer(new ManchesterOWLSyntaxOWLObjectRendererImpl()); + ToStringRenderer.getInstance().setShortFormProvider(new SimpleShortFormProvider()); + logger.info("Best solution:\n" + OWLAPIConverter.getOWLAPIDescription(bestSolution.getDescription()) + "\n(" + bestSolution.getAccuracy() + ")"); + + logger.trace("LGG time: " + lggMon.getTotal() + "ms"); + logger.trace("Avg. LGG time: " + lggMon.getAvg() + "ms"); + logger.trace("#LGG computations: " + lggMon.getHits()); + logger.trace("Subsumption test time: " + subMon.getTotal() + "ms"); + logger.trace("Avg. subsumption test time: " + subMon.getAvg() + "ms"); + logger.trace("#Subsumption tests: " + subMon.getHits()); + } + + /* (non-Javadoc) + * @see org.dllearner.core.StoppableLearningAlgorithm#stop() + */ + @Override + public void stop() { + stop = true; + } + + /* (non-Javadoc) + * @see org.dllearner.core.AbstractCELA#getCurrentlyBestDescription() + */ + @Override + public Description getCurrentlyBestDescription() { + return getCurrentlyBestEvaluatedDescription().getDescription(); + } + + /* (non-Javadoc) + * @see org.dllearner.core.AbstractCELA#getCurrentlyBestEvaluatedDescription() + */ + @Override + public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { + EvaluatedQueryTree<String> bestSolution = solutions.first(); + Description description = DLLearnerDescriptionConvertVisitor.getDLLearnerDescription( + bestSolution.getTree().asOWLClassExpression(LiteralNodeConversionStrategy.FACET_RESTRICTION)); + return new EvaluatedDescription(description, new AxiomScore(bestSolution.getScore())); + } + + /* (non-Javadoc) + * @see org.dllearner.core.StoppableLearningAlgorithm#isRunning() + */ + @Override + public boolean isRunning() { + return isRunning; + } + + @Autowired + public void setLearningProblem(PosNegLP learningProblem) { + this.lp = learningProblem; + } + + @Autowired + public void setReasoner(AbstractReasonerComponent reasoner){ + this.reasoner = reasoner; + model = ModelFactory.createDefaultModel(); + for (KnowledgeSource ks : reasoner.getSources()) { + if(ks instanceof OWLFile){ + try { + model.read(((OWLFile) ks).getURL().openStream(), null); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + /** + * @return the treeCache + */ + public QueryTreeCache getTreeCache() { + return treeCache; + } + + private EvaluatedQueryTree<String> evaluate(QueryTree<String> tree){ + //1. get a score for the coverage = recall oriented + //compute positive examples which are not covered by LGG + Collection<QueryTree<String>> uncoveredPositiveExamples = getUncoveredTrees(tree, posExamples); + //compute negative examples which are covered by LGG + Collection<QueryTree<String>> coveredNegativeExamples = getCoveredTrees(tree, negExamples); + //compute score + int coveredPositiveExamples = posExamples.size() - uncoveredPositiveExamples.size(); + double recall = coveredPositiveExamples / (double)posExamples.size(); + double precision = (coveredNegativeExamples.size() + coveredPositiveExamples == 0) + ? 0 + : coveredPositiveExamples / (double)(coveredPositiveExamples + coveredNegativeExamples.size()); + + double coverageScore = recall;//Heuristics.getFScore(recall, precision); + + //2. get a score for the specifity of the query, i.e. how many edges/nodes = precision oriented + int numberOfSpecificNodes = 0; + for (QueryTree<String> childNode : tree.getChildrenClosure()) { + if(!childNode.getUserObject().equals("?")){ + numberOfSpecificNodes++; + } + } + double specifityScore = Math.log(numberOfSpecificNodes); + + //3.compute the total score + double score = coverageWeight * coverageScore + specifityWeight * specifityScore; + + EvaluatedQueryTree<String> evaluatedTree = new EvaluatedQueryTree<String>(tree, uncoveredPositiveExamples, coveredNegativeExamples, score); + + return evaluatedTree; + } + + /** + * Return all trees from the given list {@code allTrees} which are not already subsumed by {@code tree}. + * @param tree + * @param allTrees + * @return + */ + private Collection<QueryTree<String>> getCoveredTrees(QueryTree<String> tree, List<QueryTree<String>> trees){ + Collection<QueryTree<String>> coveredTrees = new ArrayList<QueryTree<String>>(); + for (QueryTree<String> queryTree : trees) { + boolean subsumed = queryTree.isSubsumedBy(tree); + if(subsumed){ + coveredTrees.add(queryTree); + } + } + return coveredTrees; + } + + /** + * Return all trees from the given list {@code allTrees} which are not already subsumed by {@code tree}. + * @param tree + * @param allTrees + * @return + */ + private Collection<QueryTree<String>> getUncoveredTrees(QueryTree<String> tree, List<QueryTree<String>> allTrees){ + Collection<QueryTree<String>> uncoveredTrees = new ArrayList<QueryTree<String>>(); + for (QueryTree<String> queryTree : allTrees) { + boolean subsumed = queryTree.isSubsumedBy(tree); + if(!subsumed){ + uncoveredTrees.add(queryTree); + } + } + return uncoveredTrees; + } + + /** + * Initializes the todo list with all distinct trees contained in the given list {@code trees}. + * Firstly, distinct trees are computed and afterwards, for each tree a score is computed. + * @param trees + */ + private void initTodoList(List<QueryTree<String>> posExamples, List<QueryTree<String>> negExamples){ + todoList = new PriorityQueue<EvaluatedQueryTree<String>>(); + solutions = new TreeSet<EvaluatedQueryTree<String>>(); +// EvaluatedQueryTree<String> dummy = new EvaluatedQueryTree<String>(new QueryTreeImpl<String>((N)"TOP"), trees, 0d); +// todoList.add(dummy); + //compute distinct trees + Collection<QueryTree<String>> distinctTrees = new ArrayList<QueryTree<String>>(); + for (QueryTree<String> queryTree : posExamples) { + boolean distinct = true; + for (QueryTree<String> otherTree : distinctTrees) { + if(!queryTree.equals(otherTree)){ + if(queryTree.isSameTreeAs(otherTree)){ + distinct = false; + break; + } + } + } + if(distinct){ + distinctTrees.add(queryTree); + } + } + for (QueryTree<String> queryTree : distinctTrees) {//System.out.println(queryTree.getStringRepresentation()); + //compute positive examples which are not covered by LGG + Collection<QueryTree<String>> uncoveredPositiveExamples = getUncoveredTrees(queryTree, posExamples); + //compute negative examples which are covered by LGG + Collection<QueryTree<String>> coveredNegativeExamples = getCoveredTrees(queryTree, negExamples); + //compute score + int coveredPositiveExamples = posExamples.size() - uncoveredPositiveExamples.size(); + double recall = coveredPositiveExamples / (double)posExamples.size(); + double precision = (coveredNegativeExamples.size() + coveredPositiveExamples == 0) + ? 0 + : coveredPositiveExamples / (double)(coveredPositiveExamples + coveredNegativeExamples.size()); + + double score = Heuristics.getFScore(recall, precision); + todoList.add(new EvaluatedQueryTree<String>(queryTree, uncoveredPositiveExamples, coveredNegativeExamples, score)); + } + } + + private boolean sameTrees(QueryTree<String> tree1, QueryTree<String> tree2){ + return tree1.isSubsumedBy(tree2) && tree2.isSubsumedBy(tree1); + } + + private boolean terminationCriteriaSatisfied(){ + return stop || todoList.isEmpty() || posExamples.isEmpty(); + } + + /** + * Add tree to todo list if not already contained in that list or the solutions. + * @param solution + */ + private void todo(EvaluatedQueryTree<String> solution){ + //check if not already contained in todo list + for (EvaluatedQueryTree<String> evTree : todoList) { + if(sameTrees(solution.getTree(), evTree.getTree())){ + return; + } + } + //check if not already contained in solutions + for (EvaluatedQueryTree<String> evTree : solutions) { + if(sameTrees(solution.getTree(), evTree.getTree())){ + return; + } + } + todoList.add(solution); + } + + + +} Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/cache/QueryTreeCache.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/cache/QueryTreeCache.java 2014-04-23 10:47:59 UTC (rev 4251) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/cache/QueryTreeCache.java 2014-04-30 11:43:20 UTC (rev 4252) @@ -2,6 +2,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.Set; import org.dllearner.algorithms.qtl.QueryTreeFactory; import org.dllearner.algorithms.qtl.datastructures.QueryTree; @@ -17,12 +18,27 @@ private Map<Model, QueryTree<String>> cache; private QueryTreeFactory<String> factory; + private Model model; public QueryTreeCache(){ cache = new HashMap<Model, QueryTree<String>>(); factory = new QueryTreeFactoryImpl(); } + public QueryTreeCache(Model model){ + this.model = model; + cache = new HashMap<Model, QueryTree<String>>(); + factory = new QueryTreeFactoryImpl(); + } + + public QueryTree<String> getQueryTree(String root){ + QueryTree<String> tree = cache.get(model); + if(tree == null){ + tree = factory.getQueryTree(root, model); + } + return tree; + } + public QueryTree<String> getQueryTree(String root, Model model){ QueryTree<String> tree = cache.get(model); if(tree == null){ @@ -62,4 +78,8 @@ public void dispose(){ cache = null; } + + public void addAllowedNamespaces(Set<String> allowedNamespaces) { + factory.addAllowedNamespaces(allowedNamespaces); + } } Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/QueryTree.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/QueryTree.java 2014-04-23 10:47:59 UTC (rev 4251) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/QueryTree.java 2014-04-30 11:43:20 UTC (rev 4252) @@ -26,6 +26,8 @@ import java.util.Set; import org.dllearner.algorithms.qtl.datastructures.impl.QueryTreeImpl; +import org.dllearner.algorithms.qtl.datastructures.impl.QueryTreeImpl.LiteralNodeConversionStrategy; +import org.dllearner.algorithms.qtl.datastructures.impl.QueryTreeImpl.LiteralNodeSubsumptionStrategy; import org.semanticweb.owlapi.model.OWLClassExpression; import com.hp.hpl.jena.datatypes.RDFDatatype; @@ -148,5 +150,29 @@ RDFDatatype getDatatype(); Set<Literal> getLiterals(); + + /** + * @param edge + */ + void removeChildren(Object edge); + + /** + * @param stopIfChildIsResourceNode + * @return + */ + String getStringRepresentation(boolean stopIfChildIsResourceNode); + + /** + * @param literalNodeConversionStrategy + * @return + */ + OWLClassExpression asOWLClassExpression(LiteralNodeConversionStrategy literalNodeConversionStrategy); + + /** + * @param tree + * @param s + * @return + */ + boolean isSubsumedBy(QueryTree<N> tree, LiteralNodeSubsumptionStrategy s); } Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/impl/QueryTreeImpl.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/impl/QueryTreeImpl.java 2014-04-23 10:47:59 UTC (rev 4251) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/datastructures/impl/QueryTreeImpl.java 2014-04-30 11:43:20 UTC (rev 4252) @@ -19,8 +19,12 @@ */ package org.dllearner.algorithms.qtl.datastructures.impl; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; +import java.util.Calendar; import java.util.Collection; import java.util.Collections; import java.util.Comparator; @@ -36,20 +40,35 @@ import java.util.regex.Pattern; import javax.xml.bind.DatatypeConverter; +import javax.xml.transform.TransformerConfigurationException; import org.dllearner.algorithms.qtl.datastructures.NodeRenderer; import org.dllearner.algorithms.qtl.datastructures.QueryTree; +import org.dllearner.algorithms.qtl.datastructures.rendering.Edge; +import org.dllearner.algorithms.qtl.datastructures.rendering.Vertex; import org.dllearner.algorithms.qtl.filters.Filters; +import org.dllearner.utilities.PrefixCCMap; +import org.jgrapht.DirectedGraph; +import org.jgrapht.ext.EdgeNameProvider; +import org.jgrapht.ext.GraphMLExporter; +import org.jgrapht.ext.VertexNameProvider; +import org.jgrapht.graph.DefaultDirectedGraph; import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLClassExpression; import org.semanticweb.owlapi.model.OWLDataFactory; import org.semanticweb.owlapi.model.OWLDataProperty; +import org.semanticweb.owlapi.model.OWLDataRange; +import org.semanticweb.owlapi.model.OWLDatatype; +import org.semanticweb.owlapi.model.OWLFacetRestriction; import org.semanticweb.owlapi.model.OWLLiteral; import org.semanticweb.owlapi.model.OWLObjectProperty; import org.semanticweb.owlapi.vocab.OWL2Datatype; +import org.semanticweb.owlapi.vocab.OWLFacet; +import org.xml.sax.SAXException; import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl; +import com.google.common.collect.Sets; import com.hp.hpl.jena.datatypes.BaseDatatype; import com.hp.hpl.jena.datatypes.RDFDatatype; import com.hp.hpl.jena.datatypes.xsd.XSDDatatype; @@ -59,9 +78,14 @@ import com.hp.hpl.jena.query.QueryFactory; import com.hp.hpl.jena.query.Syntax; import com.hp.hpl.jena.rdf.model.Literal; +import com.hp.hpl.jena.sparql.core.TriplePath; import com.hp.hpl.jena.sparql.syntax.ElementGroup; +import com.hp.hpl.jena.sparql.syntax.ElementPathBlock; import com.hp.hpl.jena.sparql.syntax.ElementTriplesBlock; +import com.hp.hpl.jena.sparql.syntax.ElementVisitorBase; +import com.hp.hpl.jena.vocabulary.OWL; import com.hp.hpl.jena.vocabulary.RDF; +import com.hp.hpl.jena.vocabulary.RDFS; /** * @@ -70,10 +94,32 @@ */ public class QueryTreeImpl<N> implements QueryTree<N>{ - enum NodeType{ + public enum NodeType{ RESOURCE, LITERAL, BLANK, VARIABLE; } + public enum LiteralNodeSubsumptionStrategy { + DATATYPE, + INTERVAL, + ENUMERATION, + OFF + } + + public enum LiteralNodeConversionStrategy{ + /** + * Literals in form of an enumeration, e.g. {3, 4, 10} + */ + DATA_ONE_OF, + /** + * Literals as an interval on the datatype, e.g. [>= 5 <=10] + */ + FACET_RESTRICTION, + /** + * Literals as datatype, e.g. xsd:integer + */ + SOME_VALUES_FROM + } + private N userObject; private QueryTreeImpl<N> parent; @@ -97,7 +143,6 @@ private Set<Literal> literals = new HashSet<Literal>(); - public QueryTreeImpl(N userObject) { this.userObject = userObject; children = new ArrayList<QueryTreeImpl<N>>(); @@ -116,9 +161,40 @@ label += "Values: " + object.getLiterals(); } } + label += object.isResourceNode() + "," + object.isLiteralNode(); + return label; + } + }; + + } + + public QueryTreeImpl(N userObject, NodeType nodeType) { + this.userObject = userObject; + children = new ArrayList<QueryTreeImpl<N>>(); + child2EdgeMap = new HashMap<QueryTree<N>, Object>(); + edge2ChildrenMap = new HashMap<String, List<QueryTree<N>>>(); + toStringRenderer = new NodeRenderer<N>() { + public String render(QueryTree<N> object) { + String label = object.toString() + "(" + object.getId() + ")"; + if(object.isLiteralNode()){ +// if(object.getLiterals().size() == 1){ +// label += object.getLiterals().iterator().next(); +// } else if(object.getLiterals().size() > 1){ +// label += "Values: " + object.getLiterals(); +// } + if(!object.getLiterals().isEmpty()){ + label += "Values: " + object.getLiterals(); + } + } + label += object.isResourceNode() + "," + object.isLiteralNode(); return label; } }; + if(nodeType == NodeType.RESOURCE){ + isResourceNode = true; + } else if(nodeType == NodeType.LITERAL){ + isResourceNode = true; + } } public QueryTreeImpl(QueryTree<N> tree){ @@ -130,8 +206,10 @@ subTree.setId(child.getId()); subTree.setIsLiteralNode(child.isLiteralNode()); subTree.setIsResourceNode(child.isResourceNode()); + subTree.addLiterals(child.getLiterals()); addChild(subTree, tree.getEdge(child)); } + setIsResourceNode(tree.isResourceNode()); } public boolean sameType(QueryTree<N> tree){ @@ -279,6 +357,29 @@ child.parent = null; } } + + /** + * Removes all children connected by the given edge. + */ + public void removeChildren(Object edge) { + List<QueryTree<N>> children = edge2ChildrenMap.remove(edge); + if(children != null){ + this.children.removeAll(children); + } +// List<QueryTree<N>> list = edge2ChildrenMap.get("http://dl-learner.org/carcinogenesis#hasAtom"); +// List<QueryTree<N>> newList = new ArrayList<QueryTree<N>>(); +// for (int i = 0; i < Math.min(list.size(), 11); i++) { +// QueryTreeImpl<N> keep = (QueryTreeImpl<N>) list.get(i); +// newList.add(keep); +// } +// list.clear(); +// list.addAll(newList); +// this.children.clear(); +// this.children = new ArrayList<QueryTreeImpl<N>>(); +// this.children.addAll((Collection<? extends QueryTreeImpl<N>>) list); +// edge2ChildrenMap.clear(); +// edge2ChildrenMap.put("http://dl-learner.org/carcinogenesis#hasAtom", list); + } public Object getEdge(QueryTree<N> child) { @@ -342,13 +443,15 @@ @Override public boolean isSubsumedBy(QueryTree<N> tree) { -// if(!sameType(tree)){ -// return false; -// } +// System.out.println("++++++++++++++++++++++++++++"); +// System.out.println(tree + "-" + this.userObject); +// System.out.println(tree.isResourceNode() + "," + tree.isLiteralNode() + "---" + this.isResourceNode + "," + this.isLiteralNode); +// if(tree.getParent() != null && getParent() != null) +// System.out.println(tree.getParent().getEdge(tree) + "#" + getParent().getEdge(this)); +// System.out.println(tree.getUserObject().equals("?") || tree.getUserObject().equals(this.userObject)); if(!(tree.getUserObject().equals("?") || tree.getUserObject().equals(this.userObject))){ return false; } - Object edge; for(QueryTree<N> child : tree.getChildren()){ boolean isSubsumed = false; @@ -364,8 +467,112 @@ } } return true; +// return isSubsumedBy(tree, LiteralNodeSubsumptionStrategy.OFF); } + public boolean isSubsumedBy(QueryTree<N> tree, LiteralNodeSubsumptionStrategy strategy) { +// System.out.println("++++++++++++++++++++++++++++"); +// System.out.println(tree + "-" + this.userObject); +// System.out.println(tree.isResourceNode() + "," + tree.isLiteralNode() + "---" + this.isResourceNode + "," + this.isLiteralNode); +// if(tree.getParent() != null && getParent() != null) +// System.out.println(tree.getParent().getEdge(tree) + "#" + getParent().getEdge(this)); +// System.out.println(tree.getUserObject().equals("?") || tree.getUserObject().equals(this.userObject)); + + if(tree.isResourceNode() && this.isResourceNode){ + if(!(tree.getUserObject().equals("?") || tree.getUserObject().equals(this.userObject))){ + return false; + } + } else if(tree.isLiteralNode() && this.isLiteralNode){ + if(!tree.getUserObject().equals(this.userObject)){ + if(strategy == LiteralNodeSubsumptionStrategy.OFF){ + return tree.getUserObject().equals("?") || tree.getUserObject().equals(this.userObject); + } else { + return subsumes(tree.getLiterals(), this.getLiterals(), strategy); + } + } + } else if(!tree.isVarNode() && this.isVarNode()){ + return false; + } else if(tree.isResourceNode() && this.isLiteralNode || tree.isLiteralNode() && this.isResourceNode){//node type mismatch + return false; + } + Object edge; + for(QueryTree<N> child : tree.getChildren()){ + boolean isSubsumed = false; + edge = tree.getEdge(child); + for(QueryTree<N> child2 : this.getChildren(edge)){ + if(child2.isSubsumedBy(child, strategy)){ + isSubsumed = true; + break; + } + } + if(!isSubsumed){ + return false; + } + } + return true; + } + + private boolean subsumes(Set<Literal> subsumer, Set<Literal> subsumee, LiteralNodeSubsumptionStrategy strategy){ + if(strategy == LiteralNodeSubsumptionStrategy.DATATYPE){ + + } else if(strategy == LiteralNodeSubsumptionStrategy.ENUMERATION){ + return subsumer.containsAll(subsumee); + } else if(strategy == LiteralNodeSubsumptionStrategy.INTERVAL){ + //check if both datatypes are the same + RDFDatatype subsumerDatatype = getDatatype(subsumer); + RDFDatatype subsumeeDatatype = getDatatype(subsumee); + if(!subsumerDatatype.equals(subsumeeDatatype)){ + return false; + } + + //avoid boolean datatypes for interval check as there are only 2 possible values + if(subsumerDatatype.equals(XSDDatatype.XSDboolean)){ + return true; + } + + //check if subsumee interval is contained in subsumer interval + Literal subsumerMin = getMin(subsumer); + Literal subsumerMax = getMax(subsumer); + + Literal subsumeeMin = getMin(subsumee); + Literal subsumeeMax = getMax(subsumee); + + boolean leftMoreGeneral = isLessOrEqual(subsumerMin, subsumeeMin); + boolean rightMoreGeneral = isGreaterOrEqual(subsumerMax, subsumeeMax); + + if(!(leftMoreGeneral && rightMoreGeneral)){ +// System.out.println("[" + subsumeeMin + "," + subsumeeMax + "] not in interval " + "[" + subsumerMin + "," + subsumerMax + "]"); + return false; + } + } + return true; + } + + /** + * Returns the datatype of the literals. Throws exception if there are multiple datatypes. + * @param literals + */ + private RDFDatatype getDatatype(Set<Literal> literals){ + RDFDatatype datatype = literals.iterator().next().getDatatype(); + return datatype; + } + + /** + * Checks if all literals have the same datatype. + * @param literals + * @return + */ + private boolean sameDatatype(Set<Literal> literals){ + Iterator<Literal> iterator = literals.iterator(); + RDFDatatype datatype = iterator.next().getDatatype(); + while(iterator.hasNext()){ + if(!iterator.next().getDatatype().equals(datatype)){ + return false; + } + } + return true; + } + @Override public boolean isSubsumedBy(QueryTree<N> tree, boolean stopAfterError) { if(!(tree.getUserObject().equals("?") || tree.getUserObject().equals(this.userObject))){ @@ -515,6 +722,15 @@ } public String getStringRepresentation(){ + return getStringRepresentation(false); + } + + /** + * Prints the query tree and shows children of resources only if enabled. + * @param stopWhenLeafNode + * @return + */ + public String getStringRepresentation(boolean stopIfChildIsResourceNode){ int depth = getPathToRoot().size(); StringBuilder sb = new StringBuilder(); if(isRoot()){ @@ -524,17 +740,19 @@ ren = ren.replace("\n", "\n" + sb); sb.append(ren); sb.append("\n"); - for (QueryTree<N> child : getChildren()) { - for (int i = 0; i < depth; i++) { - sb.append("\t"); + if(isRoot() || !isResourceNode || (isResourceNo... [truncated message content] |
From: <lor...@us...> - 2014-04-23 10:48:03
|
Revision: 4251 http://sourceforge.net/p/dl-learner/code/4251 Author: lorenz_b Date: 2014-04-23 10:47:59 +0000 (Wed, 23 Apr 2014) Log Message: ----------- Made config parser UTF-8 compatible. Modified Paths: -------------- trunk/interfaces/pom.xml trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParser.java trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParserTokenManager.java trunk/interfaces/src/main/java/org/dllearner/confparser3/ParseException.java trunk/interfaces/src/main/java/org/dllearner/confparser3/SimpleCharStream.java trunk/interfaces/src/main/java/org/dllearner/confparser3/Token.java trunk/interfaces/src/main/java/org/dllearner/confparser3/TokenMgrError.java trunk/interfaces/src/main/java/org/dllearner/confparser3/conf3.jj trunk/interfaces/src/test/java/org/dllearner/confparser3/ParseTest.java Modified: trunk/interfaces/pom.xml =================================================================== --- trunk/interfaces/pom.xml 2014-03-21 19:21:47 UTC (rev 4250) +++ trunk/interfaces/pom.xml 2014-04-23 10:47:59 UTC (rev 4251) @@ -402,6 +402,20 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>javacc-maven-plugin</artifactId> + <version>2.6</version> + <executions> + <execution> + <id>javacc</id> + <goals> + <goal>javacc</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> <groupId>org.mortbay.jetty</groupId> @@ -612,5 +626,14 @@ </dependency> </dependencies> +<reporting> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>javacc-maven-plugin</artifactId> + <version>2.6</version> + </plugin> + </plugins> + </reporting> </project> Modified: trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java 2014-03-21 19:21:47 UTC (rev 4250) +++ trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java 2014-04-23 10:47:59 UTC (rev 4251) @@ -25,6 +25,7 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; +import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; @@ -116,6 +117,7 @@ import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.SubClassAxiom; +import org.dllearner.kb.LocalModelBasedSparqlEndpointKS; import org.dllearner.kb.OWLAPIOntology; import org.dllearner.kb.SparqlEndpointKS; import org.dllearner.kb.sparql.ConciseBoundedDescriptionGenerator; @@ -214,6 +216,7 @@ private SecureRandom random = new SecureRandom(); // enrichment parameters + private SparqlEndpointKS ks; private SparqlEndpoint se; private Entity resource; private boolean verbose; @@ -316,8 +319,76 @@ learnedOWLAxioms = new HashSet<OWLAxiom>(); learnedEvaluatedAxioms = new HashSet<EvaluatedAxiom>(); + + // instantiate SPARQL endpoint wrapper component + ks = new SparqlEndpointKS(se); + try { + ks.init(); + ks.setSupportsSPARQL_1_1(!iterativeMode); + } catch (ComponentInitException e) { + e.printStackTrace(); + } + } + public Enrichment(SparqlEndpointKS ks, Entity resource, double threshold, int nrOfAxiomsToLearn, + boolean useInference, boolean verbose, int chunksize, + int maxExecutionTimeInSeconds, boolean omitExistingAxioms) { + this.ks = ks; + this.resource = resource; + this.verbose = verbose; + this.threshold = threshold; + this.nrOfAxiomsToLearn = nrOfAxiomsToLearn; + this.useInference = useInference; + this.chunksize = chunksize; + this.maxExecutionTimeInSeconds = maxExecutionTimeInSeconds; + this.omitExistingAxioms = omitExistingAxioms; + + if(ks.isRemote()){ + try { + cacheDir = "cache" + File.separator + URLEncoder.encode(((SparqlEndpointKS)ks).getEndpoint().getURL().toString(), "UTF-8"); + } catch (UnsupportedEncodingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + cache = new ExtractionDBCache(cacheDir); + } + + + objectPropertyAlgorithms = new LinkedList<Class<? extends AxiomLearningAlgorithm>>(); + objectPropertyAlgorithms.add(DisjointObjectPropertyAxiomLearner.class); + objectPropertyAlgorithms.add(EquivalentObjectPropertyAxiomLearner.class); + objectPropertyAlgorithms.add(FunctionalObjectPropertyAxiomLearner.class); + objectPropertyAlgorithms.add(InverseFunctionalObjectPropertyAxiomLearner.class); + objectPropertyAlgorithms.add(ObjectPropertyDomainAxiomLearner.class); + objectPropertyAlgorithms.add(ObjectPropertyRangeAxiomLearner.class); + objectPropertyAlgorithms.add(SubObjectPropertyOfAxiomLearner.class); + objectPropertyAlgorithms.add(SymmetricObjectPropertyAxiomLearner.class); + objectPropertyAlgorithms.add(AsymmetricObjectPropertyAxiomLearner.class); + objectPropertyAlgorithms.add(TransitiveObjectPropertyAxiomLearner.class); + objectPropertyAlgorithms.add(InverseObjectPropertyAxiomLearner.class); + objectPropertyAlgorithms.add(ReflexiveObjectPropertyAxiomLearner.class); + objectPropertyAlgorithms.add(IrreflexiveObjectPropertyAxiomLearner.class); + + dataPropertyAlgorithms = new LinkedList<Class<? extends AxiomLearningAlgorithm>>(); + dataPropertyAlgorithms.add(DisjointDataPropertyAxiomLearner.class); + dataPropertyAlgorithms.add(EquivalentDataPropertyAxiomLearner.class); + dataPropertyAlgorithms.add(FunctionalDataPropertyAxiomLearner.class); + dataPropertyAlgorithms.add(DataPropertyDomainAxiomLearner.class); + dataPropertyAlgorithms.add(DataPropertyRangeAxiomLearner.class); + dataPropertyAlgorithms.add(SubDataPropertyOfAxiomLearner.class); + + classAlgorithms = new LinkedList<Class<? extends LearningAlgorithm>>(); +// classAlgorithms.add(DisjointClassesLearner.class); +// classAlgorithms.add(SimpleSubclassLearner.class); + classAlgorithms.add(CELOE.class); + + algorithmRuns = new LinkedList<AlgorithmRun>(); + + learnedOWLAxioms = new HashSet<OWLAxiom>(); + learnedEvaluatedAxioms = new HashSet<EvaluatedAxiom>(); + } + public void setAllowedNamespaces(List<String> allowedNamespaces) { this.allowedNamespaces = allowedNamespaces; } @@ -331,11 +402,6 @@ public void start() throws ComponentInitException, IllegalArgumentException, SecurityException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, LearningProblemUnsupportedException, MalformedURLException { - // instantiate SPARQL endpoint wrapper component - SparqlEndpointKS ks = new SparqlEndpointKS(se); - ks.init(); - ks.setSupportsSPARQL_1_1(!iterativeMode); - // common helper objects SPARQLTasks st = new SPARQLTasks(se); @@ -344,7 +410,7 @@ // ks.setSupportsSPARQL_1_1(supportsSPARQL_1_1); if(useInference){ - reasoner = new SPARQLReasoner(ks, cache); + reasoner = new SPARQLReasoner(ks, cacheDir); System.out.print("Precomputing subsumption hierarchy ... "); long startTime = System.currentTimeMillis(); reasoner.prepareSubsumptionHierarchy(); @@ -459,6 +525,7 @@ } private void filterByNamespaces(Model model){ + List<Statement> toRemove = new ArrayList<>(); if(allowedNamespaces != null && !allowedNamespaces.isEmpty()){ for (StmtIterator iterator = model.listStatements(); iterator.hasNext();) { Statement st = iterator.next(); @@ -485,10 +552,11 @@ } } if(!startsWithAllowedNamespace){ - iterator.remove(); + toRemove.add(st); } } } + model.remove(toRemove); } @SuppressWarnings("unchecked") @@ -549,7 +617,13 @@ } else { System.out.print("extracting fragment ... ");//com.hp.hpl.jena.shared.impl.JenaParameters.enableEagerLiteralValidation = true; startTime = System.currentTimeMillis(); - Model model = getFragmentMultithreaded(ks, Sets.union(posExamples, negExamples)); + Model model; + if(ks.isRemote()){ + model = getFragmentMultithreaded(ks, Sets.union(posExamples, negExamples)); + } else { + model = ((LocalModelBasedSparqlEndpointKS)ks).getModel(); + } + filter(model); filterByNamespaces(model); OWLEntityTypeAdder.addEntityTypes(model); @@ -1136,6 +1210,7 @@ System.exit(0); } + SparqlEndpointKS ks = null; // create SPARQL endpoint object (check that indeed a URL was given) URL endpoint = null; try { @@ -1144,13 +1219,33 @@ System.out.println("The specified endpoint appears not be a proper URL."); System.exit(0); } - URI graph = null; + //check if the URL is a file and if exists load it into a JENA model try { - graph = (URI) options.valueOf("graph"); - } catch(OptionException e) { - System.out.println("The specified graph appears not be a proper URL."); - System.exit(0); + File file = new File(endpoint.toURI()); + if(file.exists()){ + Model kbModel = ModelFactory.createDefaultModel(); + kbModel.read(new FileInputStream(file), null); + ks = new LocalModelBasedSparqlEndpointKS(kbModel); + } else { + URI graph = null; + try { + graph = (URI) options.valueOf("graph"); + } catch(OptionException e) { + System.out.println("The specified graph appears not be a proper URL."); + System.exit(0); + } + + LinkedList<String> defaultGraphURIs = new LinkedList<String>(); + if(graph != null) { + defaultGraphURIs.add(graph.toString()); + } + SparqlEndpoint se = new SparqlEndpoint(endpoint, defaultGraphURIs, new LinkedList<String>()); + ks = new SparqlEndpointKS(se); + } + } catch (URISyntaxException e2) { + e2.printStackTrace(); } + URI resourceURI = null; try { resourceURI = (URI) options.valueOf("resource"); @@ -1170,30 +1265,25 @@ }); } - - LinkedList<String> defaultGraphURIs = new LinkedList<String>(); - if(graph != null) { - defaultGraphURIs.add(graph.toString()); - } - SparqlEndpoint se = new SparqlEndpoint(endpoint, defaultGraphURIs, new LinkedList<String>()); - - // sanity check that endpoint/graph returns at least one triple - String query = "SELECT * WHERE {?s ?p ?o} LIMIT 1"; - SparqlQuery sq = new SparqlQuery(query, se); - try { - ResultSet q = sq.send(); - while (q.hasNext()) { - q.next(); + if(ks.isRemote()){ + // sanity check that endpoint/graph returns at least one triple + String query = "SELECT * WHERE {?s ?p ?o} LIMIT 1"; + SparqlQuery sq = new SparqlQuery(query, ks.getEndpoint()); + try { + ResultSet q = sq.send(); + while (q.hasNext()) { + q.next(); + } + } catch(QueryExceptionHTTP e) { + System.out.println("Endpoint not reachable (check spelling)."); + System.exit(0); } - } catch(QueryExceptionHTTP e) { - System.out.println("Endpoint not reachable (check spelling)."); - System.exit(0); } // map resource to correct type Entity resource = null; if(options.valueOf("resource") != null) { - resource = new SPARQLTasks(se).guessResourceType(resourceURI.toString(), true); + resource = new SPARQLTasks(((SparqlEndpointKS)ks).getEndpoint()).guessResourceType(resourceURI.toString(), true); if(resource == null) { throw new IllegalArgumentException("Could not determine the type (class, object property or data property) of input resource " + options.valueOf("resource")); } @@ -1229,7 +1319,7 @@ boolean processDataProperties = (Boolean) options.valueOf("dp"); boolean processClasses = (Boolean) options.valueOf("cls"); - Enrichment e = new Enrichment(se, resource, threshold, maxNrOfResults, useInference, false, chunksize, maxExecutionTimeInSeconds, omitExistingAxioms); + Enrichment e = new Enrichment(ks, resource, threshold, maxNrOfResults, useInference, false, chunksize, maxExecutionTimeInSeconds, omitExistingAxioms); e.setAllowedNamespaces(allowedNamespaces); e.setIterativeMode(iterativeMode); e.setProcessObjectProperties(processObjectProperties); @@ -1237,8 +1327,6 @@ e.setProcessClasses(processClasses); e.start(); - SparqlEndpointKS ks = new SparqlEndpointKS(se); - // print output in correct format if(options.has("f")) { List<AlgorithmRun> runs = e.getAlgorithmRuns(); Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParser.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParser.java 2014-03-21 19:21:47 UTC (rev 4250) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParser.java 2014-04-23 10:47:59 UTC (rev 4251) @@ -1,3 +1,4 @@ +/* ConfParser.java */ /* Generated By:JavaCC: Do not edit this line. ConfParser.java */ package org.dllearner.confparser3; @@ -4,6 +5,8 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; @@ -13,7 +16,6 @@ import org.dllearner.cli.ConfFileOption2; import org.dllearner.parser.KBParser; -import org.dllearner.utilities.datastructures.StringTuple; public class ConfParser implements ConfParserConstants { @@ -58,38 +60,37 @@ return confOptionsByBean.get(beanName); } - public static ConfParser parseFile(File filename) throws FileNotFoundException, ParseException { - ConfParser parser = new ConfParser(new FileInputStream(filename)); + public static ConfParser parseFile(File filename) throws FileNotFoundException, ParseException, UnsupportedEncodingException { + ConfParser parser = new ConfParser(new InputStreamReader(new FileInputStream(filename),"UTF-8")); parser.Start(); return parser; } - final public void Start() throws ParseException { - ConfFileOption2 confOption; + final public void Start() throws ParseException {ConfFileOption2 confOption; label_1: while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ID: + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ID:{ ; break; + } default: jj_la1[0] = jj_gen; break label_1; } confOption = ConfOption(); - if(confOption.getPropertyName() == null) { +if(confOption.getPropertyName() == null) { specialOptions.put(confOption.getBeanName(),confOption); } else { addConfOption(confOption); } } jj_consume_token(0); - PostProcessor pp = new PostProcessor(confOptions, specialOptions); +PostProcessor pp = new PostProcessor(confOptions, specialOptions); pp.applyAll(); } - final public ConfFileOption2 ConfOption() throws ParseException { - boolean containsSubOption=false; + final public ConfFileOption2 ConfOption() throws ParseException {boolean containsSubOption=false; String value="", value1="", value2="", tmp="", tmp2=""; Set<String> values = new HashSet<String>(); Map<String,String> tuples = new HashMap<String,String>(); @@ -105,47 +106,52 @@ Object val = null; Double d; beanName = Id(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMAND_END: + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case COMMAND_END:{ jj_consume_token(COMMAND_END); propertyName = Id(); - containsSubOption=true; +containsSubOption=true; break; + } default: jj_la1[1] = jj_gen; ; } jj_consume_token(13); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ID: + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ID:{ // two strings separated by a double colon // LOOKAHEAD(2) value1=Id() ":" value2=Id() { useColon = true; } // simple string propertyValue = Id(); - if(propertyValue.equals("true") || propertyValue.equals("false")) { +if(propertyValue.equals("true") || propertyValue.equals("false")) { val = Boolean.valueOf(propertyValue); propertyType = Boolean.class; } else { val = propertyValue; propertyType = String.class; isBeanRef = true; } break; - case STRING: + } + case STRING:{ propertyValue = String(); - val = propertyValue; propertyType = String.class; +val = propertyValue; propertyType = String.class; break; - case NUMBER: + } + case NUMBER:{ val = Integer(); - propertyValue = val.toString(); propertyType = Integer.class; +propertyValue = val.toString(); propertyType = Integer.class; break; - case DOUBLE: + } + case DOUBLE:{ val = Double(); - propertyValue = val.toString(); propertyType = Double.class; +propertyValue = val.toString(); propertyType = Double.class; break; + } default: jj_la1[2] = jj_gen; if (jj_2_5(2147483647)) { jj_consume_token(14); jj_consume_token(15); - val = new HashSet(); propertyType = Set.class; propertyValue = "{}"; +val = new HashSet(); propertyType = Set.class; propertyValue = "{}"; } else if (jj_2_6(4)) { jj_consume_token(14); label_2: @@ -156,20 +162,21 @@ break label_2; } tmp = String(); - values.add(tmp); propertyValue += "\u005c"" + tmp + "\u005c", "; +values.add(tmp); propertyValue += "\u005c"" + tmp + "\u005c", "; jj_consume_token(16); } tmp = String(); - values.add(tmp); propertyValue += "\u005c"" + tmp + "\u005c""; +values.add(tmp); propertyValue += "\u005c"" + tmp + "\u005c""; jj_consume_token(15); - propertyType = Set.class; propertyValue = "{"+ propertyValue + "}";; val = values; +propertyType = Set.class; propertyValue = "{"+ propertyValue + "}";; val = values; } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case 17: + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 17:{ jj_consume_token(17); - val = new HashSet(); propertyType = Set.class; propertyValue = "-"; isBeanCollection = true; +val = new HashSet(); propertyType = Set.class; propertyValue = "-"; isBeanCollection = true; break; - case 14: + } + case 14:{ jj_consume_token(14); label_3: while (true) { @@ -179,20 +186,21 @@ break label_3; } tmp = Id(); - values.add(tmp); propertyValue += tmp + ", "; +values.add(tmp); propertyValue += tmp + ", "; jj_consume_token(16); } tmp = Id(); - values.add(tmp); propertyValue += tmp; +values.add(tmp); propertyValue += tmp; jj_consume_token(15); - val = values; propertyType = Set.class; propertyValue = "{"+ propertyValue + "}"; isBeanCollection = true; +val = values; propertyType = Set.class; propertyValue = "{"+ propertyValue + "}"; isBeanCollection = true; break; + } default: jj_la1[3] = jj_gen; if (jj_2_7(2147483647)) { jj_consume_token(18); jj_consume_token(19); - val = new LinkedList(); propertyType = List.class; propertyValue = "[]"; +val = new LinkedList(); propertyType = List.class; propertyValue = "[]"; } else if (jj_2_8(2147483647)) { jj_consume_token(18); label_4: @@ -207,7 +215,7 @@ jj_consume_token(16); tmp2 = String(); jj_consume_token(21); - tuples.put(tmp,tmp2); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + tmp2 + "\u005c"), "; +tuples.put(tmp,tmp2); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + tmp2 + "\u005c"), "; jj_consume_token(16); } jj_consume_token(20); @@ -215,12 +223,12 @@ jj_consume_token(16); tmp2 = String(); jj_consume_token(21); - tuples.put(tmp,tmp2); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + tmp2 + "\u005c")"; +tuples.put(tmp,tmp2); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + tmp2 + "\u005c")"; jj_consume_token(19); - val = tuples; propertyType = List.class; propertyValue = "["+ propertyValue + "]"; +val = tuples; propertyType = List.class; propertyValue = "["+ propertyValue + "]"; } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case 18: + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case 18:{ jj_consume_token(18); label_5: while (true) { @@ -234,7 +242,7 @@ jj_consume_token(16); d = Double(); jj_consume_token(21); - tuplesD.put(tmp,d); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + d.toString() + "\u005c"), "; +tuplesD.put(tmp,d); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + d.toString() + "\u005c"), "; jj_consume_token(16); } jj_consume_token(20); @@ -242,10 +250,11 @@ jj_consume_token(16); d = Double(); jj_consume_token(21); - tuplesD.put(tmp,d); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + d.toString() + "\u005c")"; +tuplesD.put(tmp,d); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + d.toString() + "\u005c")"; jj_consume_token(19); - val = tuplesD; propertyType = List.class; propertyValue = "["+ propertyValue + "]"; +val = tuplesD; propertyType = List.class; propertyValue = "["+ propertyValue + "]"; break; + } default: jj_la1[4] = jj_gen; jj_consume_token(-1); @@ -255,7 +264,7 @@ } } } - option.setBeanRef(isBeanRef); +option.setBeanRef(isBeanRef); option.setBeanReferenceCollection(isBeanCollection); option.setBeanName(beanName); if(containsSubOption) { @@ -264,41 +273,42 @@ option.setPropertyType(propertyType); option.setPropertyValue(propertyValue); option.setValueObject(val); - {if (true) return option;} + {if ("" != null) return option;} throw new Error("Missing return statement in function"); } - final public String Individual() throws ParseException { - String name; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ID: + final public String Individual() throws ParseException {String name; + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ID:{ name = Id(); break; - case STRING: + } + case STRING:{ name = String(); break; + } default: jj_la1[5] = jj_gen; jj_consume_token(-1); throw new ParseException(); } - {if (true) return KBParser.getInternalURI(name);} +{if ("" != null) return KBParser.getInternalURI(name);} throw new Error("Missing return statement in function"); } - final public String ComplexId() throws ParseException { - Token t1,t2; + final public String ComplexId() throws ParseException {Token t1,t2; if (jj_2_9(2)) { t1 = jj_consume_token(ID); jj_consume_token(22); t2 = jj_consume_token(ID); - {if (true) return t1.image + ":" + t2.image;} +{if ("" != null) return t1.image + ":" + t2.image;} } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ID: + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { + case ID:{ t1 = jj_consume_token(ID); - {if (true) return t1.image;} +{if ("" != null) return t1.image;} break; + } default: jj_la1[6] = jj_gen; jj_consume_token(-1); @@ -308,102 +318,108 @@ throw new Error("Missing return statement in function"); } - final public String Id() throws ParseException { - Token t; + final public String Id() throws ParseException {Token t; t = jj_consume_token(ID); - {if (true) return t.image;} +{if ("" != null) return t.image;} throw new Error("Missing return statement in function"); } - final public Double Double() throws ParseException { - Token t; + final public Double Double() throws ParseException {Token t; t = jj_consume_token(DOUBLE); - {if (true) return new Double(t.image);} +{if ("" != null) return new Double(t.image);} throw new Error("Missing return statement in function"); } - final public Integer Integer() throws ParseException { - Token t; + final public Integer Integer() throws ParseException {Token t; t = jj_consume_token(NUMBER); - {if (true) return new Integer(t.image);} +{if ("" != null) return new Integer(t.image);} throw new Error("Missing return statement in function"); } - final public String String() throws ParseException { - Token t; + final public String String() throws ParseException {Token t; String s; t = jj_consume_token(STRING); - // enclosing "" are removed +// enclosing "" are removed s = t.image; s = s.substring(1, s.length() - 1); - {if (true) return s;} + {if ("" != null) return s;} throw new Error("Missing return statement in function"); } - private boolean jj_2_1(int xla) { + private boolean jj_2_1(int xla) + { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_1(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(0, xla); } } - private boolean jj_2_2(int xla) { + private boolean jj_2_2(int xla) + { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_2(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(1, xla); } } - private boolean jj_2_3(int xla) { + private boolean jj_2_3(int xla) + { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_3(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(2, xla); } } - private boolean jj_2_4(int xla) { + private boolean jj_2_4(int xla) + { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_4(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(3, xla); } } - private boolean jj_2_5(int xla) { + private boolean jj_2_5(int xla) + { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_5(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(4, xla); } } - private boolean jj_2_6(int xla) { + private boolean jj_2_6(int xla) + { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_6(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(5, xla); } } - private boolean jj_2_7(int xla) { + private boolean jj_2_7(int xla) + { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_7(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(6, xla); } } - private boolean jj_2_8(int xla) { + private boolean jj_2_8(int xla) + { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_8(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(7, xla); } } - private boolean jj_2_9(int xla) { + private boolean jj_2_9(int xla) + { jj_la = xla; jj_lastpos = jj_scanpos = token; try { return !jj_3_9(); } catch(LookaheadSuccess ls) { return true; } finally { jj_save(8, xla); } } - private boolean jj_3_3() { + private boolean jj_3_3() + { if (jj_scan_token(20)) return true; if (jj_3R_6()) return true; if (jj_scan_token(16)) return true; @@ -413,40 +429,47 @@ return false; } - private boolean jj_3R_7() { + private boolean jj_3R_7() + { if (jj_scan_token(ID)) return true; return false; } - private boolean jj_3_2() { + private boolean jj_3_2() + { if (jj_3R_7()) return true; if (jj_scan_token(16)) return true; return false; } - private boolean jj_3_5() { + private boolean jj_3_5() + { if (jj_scan_token(14)) return true; if (jj_scan_token(15)) return true; return false; } - private boolean jj_3_9() { + private boolean jj_3_9() + { if (jj_scan_token(ID)) return true; if (jj_scan_token(22)) return true; return false; } - private boolean jj_3R_8() { + private boolean jj_3R_8() + { if (jj_scan_token(DOUBLE)) return true; return false; } - private boolean jj_3R_6() { + private boolean jj_3R_6() + { if (jj_scan_token(STRING)) return true; return false; } - private boolean jj_3_4() { + private boolean jj_3_4() + { if (jj_scan_token(20)) return true; if (jj_3R_6()) return true; if (jj_scan_token(16)) return true; @@ -456,7 +479,8 @@ return false; } - private boolean jj_3_8() { + private boolean jj_3_8() + { if (jj_scan_token(18)) return true; if (jj_scan_token(20)) return true; if (jj_3R_6()) return true; @@ -465,7 +489,8 @@ return false; } - private boolean jj_3_6() { + private boolean jj_3_6() + { if (jj_scan_token(14)) return true; Token xsp; while (true) { @@ -477,13 +502,15 @@ return false; } - private boolean jj_3_1() { + private boolean jj_3_1() + { if (jj_3R_6()) return true; if (jj_scan_token(16)) return true; return false; } - private boolean jj_3_7() { + private boolean jj_3_7() + { if (jj_scan_token(18)) return true; if (jj_scan_token(19)) return true; return false; @@ -608,6 +635,7 @@ throw generateParseException(); } + @SuppressWarnings("serial") static private final class LookaheadSuccess extends java.lang.Error { } final private LookaheadSuccess jj_ls = new LookaheadSuccess(); private boolean jj_scan_token(int kind) { @@ -651,7 +679,7 @@ return t; } - private int jj_ntk() { + private int jj_ntk_f() { if ((jj_nt=token.next) == null) return (jj_ntk = (token.next=token_source.getNextToken()).kind); else Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParserTokenManager.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParserTokenManager.java 2014-03-21 19:21:47 UTC (rev 4250) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParserTokenManager.java 2014-04-23 10:47:59 UTC (rev 4251) @@ -1,3 +1,4 @@ +/* ConfParserTokenManager.java */ /* Generated By:JavaCC: Do not edit this line. ConfParserTokenManager.java */ package org.dllearner.confparser3; import java.io.File; @@ -14,23 +15,20 @@ import org.dllearner.utilities.datastructures.StringTuple; /** Token Manager. */ -public class ConfParserTokenManager implements ConfParserConstants -{ +@SuppressWarnings("unused")public class ConfParserTokenManager implements ConfParserConstants { /** Debug output. */ public java.io.PrintStream debugStream = System.out; /** Set debug output. */ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } -private final int jjStopStringLiteralDfa_0(int pos, long active0) -{ +private final int jjStopStringLiteralDfa_0(int pos, long active0){ switch (pos) { default : return -1; } } -private final int jjStartNfa_0(int pos, long active0) -{ +private final int jjStartNfa_0(int pos, long active0){ return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); } private int jjStopAtPos(int pos, int kind) @@ -39,8 +37,7 @@ jjmatchedPos = pos; return pos + 1; } -private int jjMoveStringLiteralDfa0_0() -{ +private int jjMoveStringLiteralDfa0_0(){ switch(curChar) { case 40: @@ -70,6 +67,9 @@ } } static final long[] jjbitVec0 = { + 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +static final long[] jjbitVec2 = { 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL }; private int jjMoveNfa_0(int startState, int curPos) @@ -95,18 +95,18 @@ { if (kind > 10) kind = 10; - jjCheckNAddStates(0, 2); + { jjCheckNAddStates(0, 2); } } else if (curChar == 48) { if (kind > 10) kind = 10; - jjCheckNAdd(27); + { jjCheckNAdd(27); } } else if (curChar == 47) - jjAddStates(3, 5); + { jjAddStates(3, 5); } else if (curChar == 34) - jjCheckNAddTwoStates(3, 4); + { jjCheckNAddTwoStates(3, 4); } break; case 1: if ((0x3ff000000000000L & l) == 0L) @@ -117,11 +117,11 @@ break; case 2: if (curChar == 34) - jjCheckNAddTwoStates(3, 4); + { jjCheckNAddTwoStates(3, 4); } break; case 3: if ((0xfffffffbffffffffL & l) != 0L) - jjCheckNAddTwoStates(3, 4); + { jjCheckNAddTwoStates(3, 4); } break; case 4: if (curChar == 34 && kind > 12) @@ -129,15 +129,15 @@ break; case 5: if (curChar == 47) - jjAddStates(3, 5); + { jjAddStates(3, 5); } break; case 6: if (curChar == 47) - jjCheckNAddStates(6, 8); + { jjCheckNAddStates(6, 8); } break; case 7: if ((0xffffffffffffdbffL & l) != 0L) - jjCheckNAddStates(6, 8); + { jjCheckNAddStates(6, 8); } break; case 8: if ((0x2400L & l) != 0L && kind > 5) @@ -153,23 +153,23 @@ break; case 11: if (curChar == 42) - jjCheckNAddTwoStates(12, 13); + { jjCheckNAddTwoStates(12, 13); } break; case 12: if ((0xfffffbffffffffffL & l) != 0L) - jjCheckNAddTwoStates(12, 13); + { jjCheckNAddTwoStates(12, 13); } break; case 13: if (curChar == 42) - jjCheckNAddStates(9, 11); + { jjCheckNAddStates(9, 11); } break; case 14: if ((0xffff7bffffffffffL & l) != 0L) - jjCheckNAddTwoStates(15, 13); + { jjCheckNAddTwoStates(15, 13); } break; case 15: if ((0xfffffbffffffffffL & l) != 0L) - jjCheckNAddTwoStates(15, 13); + { jjCheckNAddTwoStates(15, 13); } break; case 16: if (curChar == 47 && kind > 6) @@ -181,23 +181,23 @@ break; case 18: if (curChar == 42) - jjCheckNAddTwoStates(19, 20); + { jjCheckNAddTwoStates(19, 20); } break; case 19: if ((0xfffffbffffffffffL & l) != 0L) - jjCheckNAddTwoStates(19, 20); + { jjCheckNAddTwoStates(19, 20); } break; case 20: if (curChar == 42) - jjCheckNAddStates(12, 14); + { jjCheckNAddStates(12, 14); } break; case 21: if ((0xffff7bffffffffffL & l) != 0L) - jjCheckNAddTwoStates(22, 20); + { jjCheckNAddTwoStates(22, 20); } break; case 22: if ((0xfffffbffffffffffL & l) != 0L) - jjCheckNAddTwoStates(22, 20); + { jjCheckNAddTwoStates(22, 20); } break; case 23: if (curChar == 47 && kind > 7) @@ -208,39 +208,39 @@ break; if (kind > 10) kind = 10; - jjCheckNAddStates(0, 2); + { jjCheckNAddStates(0, 2); } break; case 25: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 10) kind = 10; - jjCheckNAdd(25); + { jjCheckNAdd(25); } break; case 26: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(26, 27); + { jjCheckNAddTwoStates(26, 27); } break; case 27: if (curChar != 46) break; if (kind > 11) kind = 11; - jjCheckNAdd(28); + { jjCheckNAdd(28); } break; case 28: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 11) kind = 11; - jjCheckNAdd(28); + { jjCheckNAdd(28); } break; case 29: if (curChar != 48) break; if (kind > 10) kind = 10; - jjCheckNAdd(27); + { jjCheckNAdd(27); } break; default : break; } @@ -258,35 +258,35 @@ break; if (kind > 9) kind = 9; - jjCheckNAdd(1); + { jjCheckNAdd(1); } break; case 1: if ((0x7fffffe87fffffeL & l) == 0L) break; if (kind > 9) kind = 9; - jjCheckNAdd(1); + { jjCheckNAdd(1); } break; case 3: if ((0xffffffffefffffffL & l) != 0L) - jjAddStates(15, 16); + { jjAddStates(15, 16); } break; case 7: - jjAddStates(6, 8); + { jjAddStates(6, 8); } break; case 12: - jjCheckNAddTwoStates(12, 13); + { jjCheckNAddTwoStates(12, 13); } break; case 14: case 15: - jjCheckNAddTwoStates(15, 13); + { jjCheckNAddTwoStates(15, 13); } break; case 19: - jjCheckNAddTwoStates(19, 20); + { jjCheckNAddTwoStates(19, 20); } break; case 21: case 22: - jjCheckNAddTwoStates(22, 20); + { jjCheckNAddTwoStates(22, 20); } break; default : break; } @@ -294,6 +294,9 @@ } else { + int hiByte = (curChar >> 8); + int i1 = hiByte >> 6; + long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); do @@ -301,32 +304,32 @@ switch(jjstateSet[--i]) { case 3: - if ((jjbitVec0[i2] & l2) != 0L) - jjAddStates(15, 16); + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjAddStates(15, 16); } break; case 7: - if ((jjbitVec0[i2] & l2) != 0L) - jjAddStates(6, 8); + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjAddStates(6, 8); } break; case 12: - if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddTwoStates(12, 13); + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddTwoStates(12, 13); } break; case 14: case 15: - if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddTwoStates(15, 13); + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddTwoStates(15, 13); } break; case 19: - if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddTwoStates(19, 20); + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddTwoStates(19, 20); } break; case 21: case 22: - if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddTwoStates(22, 20); + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) + { jjCheckNAddTwoStates(22, 20); } break; - default : break; + default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break; } } while(i != startsAt); } @@ -347,71 +350,23 @@ 25, 26, 27, 6, 17, 18, 7, 8, 10, 13, 14, 16, 20, 21, 23, 3, 4, }; +private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) +{ + switch(hiByte) + { + case 0: + return ((jjbitVec2[i2] & l2) != 0L); + default : + if ((jjbitVec0[i1] & l1) != 0L) + return true; + return false; + } +} /** Token literal values. */ public static final String[] jjstrLiteralImages = { "", null, null, null, null, null, null, null, "\56", null, null, null, null, "\75", "\173", "\175", "\54", "\55", "\133", "\135", "\50", "\51", "\72", }; - -/** Lexer state names. */ -public static final String[] lexStateNames = { - "DEFAULT", -}; -static final long[] jjtoToken = { - 0x7fff01L, -}; -static final long[] jjtoSkip = { - 0xfeL, -}; -protected SimpleCharStream input_stream; -private final int[] jjrounds = new int[30]; -private final int[] jjstateSet = new int[60]; -protected char curChar; -/** Constructor. */ -public ConfParserTokenManager(SimpleCharStream stream){ - if (SimpleCharStream.staticFlag) - throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - input_stream = stream; -} - -/** Constructor. */ -public ConfParserTokenManager(SimpleCharStream stream, int lexState){ - this(stream); - SwitchTo(lexState); -} - -/** Reinitialise parser. */ -public void ReInit(SimpleCharStream stream) -{ - jjmatchedPos = jjnewStateCnt = 0; - curLexState = defaultLexState; - input_stream = stream; - ReInitRounds(); -} -private void ReInitRounds() -{ - int i; - jjround = 0x80000001; - for (i = 30; i-- > 0;) - jjrounds[i] = 0x80000000; -} - -/** Reinitialise parser. */ -public void ReInit(SimpleCharStream stream, int lexState) -{ - ReInit(stream); - SwitchTo(lexState); -} - -/** Switch to specified lex state. */ -public void SwitchTo(int lexState) -{ - if (lexState >= 1 || lexState < 0) - throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - else - curLexState = lexState; -} - protected Token jjFillToken() { final Token t; @@ -459,6 +414,7 @@ catch(java.io.IOException e) { jjmatchedKind = 0; + jjmatchedPos = -1; matchedToken = jjFillToken(); return matchedToken; } @@ -535,4 +491,69 @@ } while (start++ != end); } + /** Constructor. */ + public ConfParserTokenManager(SimpleCharStream stream){ + + if (SimpleCharStream.staticFlag) + throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); + + input_stream = stream; + } + + /** Constructor. */ + public ConfParserTokenManager (SimpleCharStream stream, int lexState){ + ReInit(stream); + SwitchTo(lexState); + } + + /** Reinitialise parser. */ + public void ReInit(SimpleCharStream stream) + { + jjmatchedPos = jjnewStateCnt = 0; + curLexState = defaultLexState; + input_stream = stream; + ReInitRounds(); + } + + private void ReInitRounds() + { + int i; + jjround = 0x80000001; + for (i = 30; i-- > 0;) + jjrounds[i] = 0x80000000; + } + + /** Reinitialise parser. */ + public void ReInit(SimpleCharStream stream, int lexState) + { + ReInit(stream); + SwitchTo(lexState); + } + + /** Switch to specified lex state. */ + public void SwitchTo(int lexState) + { + if (lexState >= 1 || lexState < 0) + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); + else + curLexState = lexState; + } + +/** Lexer state names. */ +public static final String[] lexStateNames = { + "DEFAULT", +}; +static final long[] jjtoToken = { + 0x7fff01L, +}; +static final long[] jjtoSkip = { + 0xfeL, +}; + protected SimpleCharStream input_stream; + + private final int[] jjrounds = new int[30]; + private final int[] jjstateSet = new int[2 * 30]; + + + protected char curChar; } Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/ParseException.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/ParseException.java 2014-03-21 19:21:47 UTC (rev 4250) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/ParseException.java 2014-04-23 10:47:59 UTC (rev 4251) @@ -1,4 +1,4 @@ -/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */ +/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 6.0 */ /* JavaCCOptions:KEEP_LINE_COL=null */ package org.dllearner.confparser3; @@ -184,4 +184,4 @@ } } -/* JavaCC - OriginalChecksum=44a252ba2c41282348d0b2fcf86420df (do not edit this line) */ +/* JavaCC - OriginalChecksum=72d8badf88dbc09bae77f8c82b715143 (do not edit this line) */ Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/SimpleCharStream.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/SimpleCharStream.java 2014-03-21 19:21:47 UTC (rev 4250) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/SimpleCharStream.java 2014-04-23 10:47:59 UTC (rev 4251) @@ -1,4 +1,4 @@ -/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */ +/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 6.0 */ /* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ package org.dllearner.confparser3; @@ -31,9 +31,10 @@ protected int maxNextCharInd = 0; protected int inBuf = 0; protected int tabSize = 8; + protected boolean trackLineColumn = true; - protected void setTabSize(int i) { tabSize = i; } - protected int getTabSize(int i) { return tabSize; } + public void setTabSize(int i) { tabSize = i; } + public int getTabSize() { return tabSize; } protected void ExpandBuff(boolean wrapAround) @@ -467,5 +468,7 @@ column = bufcolumn[j]; } + boolean getTrackLineColumn() { return trackLineColumn; } + void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; } } -/* JavaCC - OriginalChecksum=9533267d690297b19b8deefd4143bb73 (do not edit this line) */ +/* JavaCC - OriginalChecksum=e6b5e4f4223db89b882e22f7e6893bd9 (do not edit this line) */ Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/Token.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/Token.java 2014-03-21 19:21:47 UTC (rev 4250) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/Token.java 2014-04-23 10:47:59 UTC (rev 4251) @@ -1,4 +1,4 @@ -/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */ +/* Generated By:JavaCC: Do not edit this line. Token.java Version 6.0 */ /* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ package org.dllearner.confparser3; @@ -128,4 +128,4 @@ } } -/* JavaCC - OriginalChecksum=f5f1c260daaacf6ad7943faea399abd0 (do not edit this line) */ +/* JavaCC - OriginalChecksum=b46f40b47c1ab727d843a023759aeb18 (do not edit this line) */ Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/TokenMgrError.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/TokenMgrError.java 2014-03-21 19:21:47 UTC (rev 4250) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/TokenMgrError.java 2014-04-23 10:47:59 UTC (rev 4251) @@ -1,4 +1,4 @@ -/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */ +/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 6.0 */ /* JavaCCOptions: */ package org.dllearner.confparser3; @@ -144,4 +144,4 @@ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); } } -/* JavaCC - OriginalChecksum=cfdfdc87d92964d81aa3da705fa4b09a (do not edit this line) */ +/* JavaCC - OriginalChecksum=52462882bed940bf33866ca9696c8f85 (do not edit this line) */ Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/conf3.jj =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/conf3.jj 2014-03-21 19:21:47 UTC (rev 4250) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/conf3.jj 2014-04-23 10:47:59 UTC (rev 4251) @@ -26,6 +26,7 @@ options { JDK_VERSION = "1.6"; STATIC = false; + UNICODE_INPUT=true; } PARSER_BEGIN(ConfParser) @@ -33,7 +34,9 @@ import java.io.File; import java.io.FileInputStream; +import java.io.InputStreamReader; import java.io.FileNotFoundException; +import java.io.UnsupportedEncodingException; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; @@ -88,8 +91,8 @@ return confOptionsByBean.get(beanName); } - public static ConfParser parseFile(File filename) throws FileNotFoundException, ParseException { - ConfParser parser = new ConfParser(new FileInputStream(filename)); + public static ConfParser parseFile(File filename) throws FileNotFoundException, ParseException, UnsupportedEncodingException { + ConfParser parser = new ConfParser(new InputStreamReader(new FileInputStream(filename),"UTF-8")); parser.Start(); return parser; } Modified: trunk/interfaces/src/test/java/org/dllearner/confparser3/ParseTest.java =================================================================== --- trunk/interfaces/src/test/java/org/dllearner/confparser3/ParseTest.java 2014-03-21 19:21:47 UTC (rev 4250) +++ trunk/interfaces/src/test/java/org/dllearner/confparser3/ParseTest.java 2014-04-23 10:47:59 UTC (rev 4251) @@ -21,6 +21,7 @@ import java.io.File; import java.io.FileNotFoundException; +import java.io.UnsupportedEncodingException; import org.dllearner.cli.ConfFileOption2; import org.junit.Test; @@ -34,7 +35,7 @@ public class ParseTest { @Test - public void test() throws FileNotFoundException, ParseException { + public void test() throws FileNotFoundException, ParseException, UnsupportedEncodingException { ConfParser parser = ConfParser.parseFile(new File("../examples/family/father.conf")); for(ConfFileOption2 option : parser.getConfOptions()) { System.out.print(option.getBeanName() + "." + option.getPropertyName() + " = " + option.getValue().toString()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <far...@us...> - 2014-03-21 19:21:56
|
Revision: 4250 http://sourceforge.net/p/dl-learner/code/4250 Author: farshadbadie Date: 2014-03-21 19:21:47 +0000 (Fri, 21 Mar 2014) Log Message: ----------- All FuzzyDL issues fixed. Modified Paths: -------------- trunk/test/fuzzydll/fuzzy_trains.conf Added Paths: ----------- trunk/README-FuzzyDL trunk/test/fuzzydll/EvKnowledge/EvKnowledge.owl trunk/test/fuzzydll/EvKnowledge/EvKnowledge.owl.owl trunk/test/fuzzydll/EvKnowledge/EvKnowledge.owl.pprj trunk/test/fuzzydll/EvKnowledge/EvKnowledge.owl.repository trunk/test/fuzzydll/EvKnowledge/EvKnowledge.pprj trunk/test/fuzzydll/EvKnowledge/People.owl trunk/test/fuzzydll/EvKnowledge/People.pprj trunk/test/fuzzydll/EvKnowledge/catalog-v001.xml trunk/test/fuzzydll/EvKnowledge/gurobi.txt trunk/test/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt Added: trunk/README-FuzzyDL =================================================================== --- trunk/README-FuzzyDL (rev 0) +++ trunk/README-FuzzyDL 2014-03-21 19:21:47 UTC (rev 4250) @@ -0,0 +1,67 @@ +Instructions: +============= + +Instruction of first installation of Fuzzy DL + + 1. Download from http://gaia.isti.cnr.it/~straccia/software/fuzzyDL/fuzzyDL.html + + 2. Unzip the folder + + 3. the "FuzzyDL" folder is the main folder + + 4. Locating the SolverLinux dynamic libraries at |/usr/lib|, |lib| or |/usr/local/lib| directories, + 4.1. But you can add the path of the binary file to the library path by modifying the variable |LD_LIBRARY_PATH|. + For instance, if the libraries are in the same directory as the binary file, you can write in a terminal: export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH + + 5. Must be ready for the execution as follow + 5.a. java -jar FuzzyDL.jar filename + 5.b. To read in the file. Some parameters are taken from the CONFIG file + 5.c. To select the semantics, change the 'solver' parameter in the CONFIG file z (for Zadeh) / l (for Luaksiewicz)/ c (for Classical) + + 6. Alternatively, leave the dynamic libraries in solverLinux and define: + export LD_LIBRARY_PATH=$HOME/Linux/FuzzyDL/solverLinux + +---------------------------------------------------------------------------- + +Instruction of first installation of Gurobi Optimizer + +1. To Register and download from +http://pages.gurobi.com/DownloadRegistration.html?/download/gurobi-optimizer + +Note: Maybe it only works with an older release like 5.0.2. Still needs to be verified. + +2. Choose a destination directory. Actually, /opt is used for installation. + +3. To copy the Gurobi distribution to that directory and extract the contents. + Extraction will create a sub-directory gurobi560/linux64 . Also, The <installdir> would be /opt/gurobi560/linux64. + +4. In order to allow executable files to be found when needed, you have to modify a few environment variables: + • GUROBI_HOME should point to the <installdir>. + • PATH should be extended to include <installdir>/bin. + • LD_LIBRARY_PATH should be extended to include <installdir>/lib. + +5. In the case of using bash shell, need to add the following lines to the .bashrc files as follow: + • export GUROBI_HOME="/opt/gurobi560/linux64" + • export PATH="${PATH}:${GUROBI_HOME}/bin" + • export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib" + +6. If LD_LIBRARY_PATH is not already set, you would use the following instead: + export LD_LIBRARY_PATH="${GUROBI_HOME}/lib" (for Eclipse projects, this path has to be added to the environment variables). + +7. Ready to proceed to Obtain and Install the Gurobi License. +7.1. see the Licenses page: http://www.gurobi.com/de/download/licenses/current + +7.2. Free Academic tab -> Accept Agreement -> Request License -> clicking on the License ID +7.3. Run the grbgetkey command like: grbgetkey 253e22f3-... + +7.4. In order to save the license key, recommended to accept the default location (hitting Enter) + +8. When you run the Gurobi Optimizer, it will look for the gurobi.lic key file in /opt/gurobi and /opt/gurobi560. + +9. If you choose to put the license key file in a non-default location, you should add a line like the following to you .bashrc file + (For setting the environment variable) + + export GRB_LICENSE_FILE=/usr/home/jones/gurobi.lic + + + Added: trunk/test/fuzzydll/EvKnowledge/EvKnowledge.owl =================================================================== --- trunk/test/fuzzydll/EvKnowledge/EvKnowledge.owl (rev 0) +++ trunk/test/fuzzydll/EvKnowledge/EvKnowledge.owl 2014-03-21 19:21:47 UTC (rev 4250) @@ -0,0 +1,4239 @@ +<?xml version="1.0"?> +<rdf:RDF + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:ace_lexicon="http://attempto.ifi.uzh.ch/ace_lexicon#" + xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#" + xmlns:foaf="http://xmlns.com/foaf/0.1/" + xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns="http://example.com/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:swrl="http://www.w3.org/2003/11/swrl#" + xmlns:swrlb="http://www.w3.org/2003/11/swrlb#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xml:base="http://example.com/"> + <owl:Ontology rdf:about="http://www.example.com/EvKnowledge.owl"/> + <rdfs:Datatype rdf:about="http://xmlns.com/foaf/0.1/"/> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#Rectangle"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#Load"/> + </rdfs:subClassOf> + <ace_lexicon:CN_sg rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >Rectangle</ace_lexicon:CN_sg> + <ace_lexicon:CN_pl rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >Rectangles</ace_lexicon:CN_pl> + </owl:Class> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#UnsuccessfulUser"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#User"/> + </rdfs:subClassOf> + <ace_lexicon:CN_pl rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >UnsuccessfulUsers</ace_lexicon:CN_pl> + <ace_lexicon:CN_sg rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >UnsuccessfulUser</ace_lexicon:CN_sg> + </owl:Class> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#SuccessfulUser"> + <ace_lexicon:CN_sg rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >SuccessfulUser</ace_lexicon:CN_sg> + <ace_lexicon:CN_pl rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >SuccessfulUsers</ace_lexicon:CN_pl> + <rdfs:subClassOf> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#User"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#RShoulder"> + <ace_lexicon:CN_sg rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >RShoulder</ace_lexicon:CN_sg> + <ace_lexicon:CN_pl rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >RShoulders</ace_lexicon:CN_pl> + <rdfs:subClassOf> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#Load"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#Triangle"> + <ace_lexicon:CN_pl rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >Triangles</ace_lexicon:CN_pl> + <ace_lexicon:CN_sg rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >Triangle</ace_lexicon:CN_sg> + <rdfs:subClassOf> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#Load"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#MediumSuccessfulUser"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#User"/> + </rdfs:subClassOf> + <ace_lexicon:CN_pl rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >MediumSuccessfulUsers</ace_lexicon:CN_pl> + <ace_lexicon:CN_sg rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >MediumSuccessfulUser</ace_lexicon:CN_sg> + </owl:Class> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#LShoulder"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#Load"/> + </rdfs:subClassOf> + <ace_lexicon:CN_sg rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >LShoulder</ace_lexicon:CN_sg> + <ace_lexicon:CN_pl rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >LShoulders</ace_lexicon:CN_pl> + </owl:Class> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#Load"> + <ace_lexicon:CN_pl rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >Loads</ace_lexicon:CN_pl> + <ace_lexicon:CN_sg rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >Load</ace_lexicon:CN_sg> + </owl:Class> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#User"> + <ace_lexicon:CN_sg rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >User</ace_lexicon:CN_sg> + <ace_lexicon:CN_pl rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >Users</ace_lexicon:CN_pl> + </owl:Class> + <owl:Class rdf:about="http://www.example.com/EvKnowledge.owl#Train"> + <ace_lexicon:CN_pl rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >Trains</ace_lexicon:CN_pl> + <ace_lexicon:CN_sg rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >Train</ace_lexicon:CN_sg> + </owl:Class> + <owl:ObjectProperty rdf:about="http://example.com/objectProperty_1"/> + <rdf:Description rdf:about="http://example.org/Ev#Success82"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</DegreeStudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER83</foaf:name> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.62</ExamPerformanceGoal> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</ExamPerformanceAll> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.32</DegreeRepitition> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.315</StudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success237"> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.83</ExamPerformanceGoal> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.4</ExamPerformanceAll> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.36</DegreeRepitition> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.66</StudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER238</foaf:name> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.56</DegreeStudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success119"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.46</DegreeStudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.61</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.32</ExamPerformanceAll> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.81</ExamPerformanceGoal> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER120</foaf:name> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.325</StudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success145"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.76</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.46</StudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER146</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.2</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.95</ExamPerformanceAll> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.65</ExamPerformanceGoal> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success96"> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.77</ExamPerformanceAll> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.25</DegreeRepitition> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.295</StudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER97</foaf:name> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.19</ExamPerformanceGoal> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.73</DegreeStudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success256"> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.75</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.61</ExamPerformanceAll> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.26</ExamPerformanceGoal> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER257</foaf:name> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.5</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.81</DegreeStudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success32"> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.256</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.76</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER33</foaf:name> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.16</ExamPerformanceGoal> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.7</DegreeStudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success105"> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.25</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER106</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.3</DegreeRepitition> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.56</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.67</ExamPerformanceGoal> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</StudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success247"> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER248</foaf:name> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.58</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</ExamPerformanceAll> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</ExamPerformanceGoal> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.31</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.58</StudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success76"> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER77</foaf:name> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.265</StudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.06</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.75</ExamPerformanceAll> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.57</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</ExamPerformanceGoal> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success12"> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.34</ExamPerformanceGoal> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</StudyTime> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.78</ExamPerformanceAll> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.52</DegreeStudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER13</foaf:name> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success131"> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER132</foaf:name> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.4</StudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.67</ExamPerformanceGoal> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.26</ExamPerformanceAll> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.18</DegreeRepitition> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.26</DegreeStudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success227"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.06</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.58</StudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER228</foaf:name> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.31</ExamPerformanceGoal> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</ExamPerformanceAll> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.348</DegreeRepitition> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success187"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.61</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.57</ExamPerformanceGoal> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.69</DegreeRepitition> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.44</StudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER188</foaf:name> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success255"> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</ExamPerformanceAll> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.71</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.77</ExamPerformanceGoal> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.82</DegreeRepitition> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.54</StudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER256</foaf:name> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success197"> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.72</ExamPerformanceAll> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.2</DegreeRepitition> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.07</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.73</StudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER198</foaf:name> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.26</ExamPerformanceGoal> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success42"> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.6</ExamPerformanceGoal> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.14</StudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.49</DegreeRepitition> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.55</DegreeStudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER43</foaf:name> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success146"> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.24</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER147</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.243</DegreeRepitition> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.35</ExamPerformanceGoal> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.365</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.19</DegreeStudyTime> + </rdf:Description> + <owl:AnnotationProperty rdf:about="http://example.com/DegreeRepitition"/> + <rdf:Description rdf:about="http://example.org/Ev#Success217"> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.87</ExamPerformanceAll> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.31</DegreeRepitition> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER218</foaf:name> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.58</ExamPerformanceGoal> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.31</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.6</StudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success62"> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.79</DegreeRepitition> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER63</foaf:name> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.3</ExamPerformanceAll> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.51</ExamPerformanceGoal> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.15</StudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.78</DegreeStudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success22"> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER23</foaf:name> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</StudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.65</ExamPerformanceGoal> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.31</DegreeStudyTime> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.27</DegreeRepitition> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success236"> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER237</foaf:name> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.55</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.523</StudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.6</ExamPerformanceAll> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.41</DegreeRepitition> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.22</ExamPerformanceGoal> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success81"> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.25</DegreeRepitition> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.295</StudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.12</ExamPerformanceAll> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER82</foaf:name> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.67</ExamPerformanceGoal> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.26</DegreeStudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success144"> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.48</ExamPerformanceGoal> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER145</foaf:name> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.42</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.87</DegreeStudyTime> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.21</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.56</ExamPerformanceAll> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + </rdf:Description> + <owl:AnnotationProperty rdf:about="http://example.com/StudyTime"/> + <rdf:Description rdf:about="http://example.org/Ev#Success95"> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.86</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.255</StudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.15</ExamPerformanceGoal> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER96</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.305</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.62</ExamPerformanceAll> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success257"> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.66</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.76</DegreeStudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER258</foaf:name> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.87</ExamPerformanceAll> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.9</DegreeRepitition> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.74</ExamPerformanceGoal> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success246"> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.62</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.39</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.66</ExamPerformanceGoal> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER247</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.67</DegreeRepitition> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success106"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.6</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.26</StudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.59</ExamPerformanceGoal> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.28</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER107</foaf:name> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success11"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.51</DegreeStudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.41</ExamPerformanceAll> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.3</ExamPerformanceGoal> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.06</StudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER12</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.06</DegreeRepitition> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success75"> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</ExamPerformanceGoal> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.5</DegreeStudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER76</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.18</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.4</ExamPerformanceAll> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.255</StudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success130"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.02</DegreeStudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER131</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.05</DegreeRepitition> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.06</ExamPerformanceAll> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.34</ExamPerformanceGoal> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.39</StudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success159"> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.32</DegreeRepitition> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.31</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER160</foaf:name> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.54</ExamPerformanceGoal> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.79</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.475</StudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success226"> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.475</DegreeRepitition> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.23</ExamPerformanceAll> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.59</ExamPerformanceGoal> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER227</foaf:name> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.13</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.71</StudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success31"> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER32</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.295</DegreeRepitition> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.75</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.24</ExamPerformanceGoal> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.15</StudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.65</ExamPerformanceAll> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success186"> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.01</ExamPerformanceAll> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.82</DegreeRepitition> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.495</StudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER187</foaf:name> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.67</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.93</ExamPerformanceGoal> + </rdf:Description> + <owl:AnnotationProperty rdf:about="http://example.com/DegreeStudyTime"/> + <rdf:Description rdf:about="http://example.org/Ev#Success41"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.6</DegreeStudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.2</ExamPerformanceAll> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.49</DegreeRepitition> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER42</foaf:name> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.2</StudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.78</ExamPerformanceGoal> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success196"> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</ExamPerformanceGoal> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.19</DegreeRepitition> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.19</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.68</StudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER197</foaf:name> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.48</ExamPerformanceAll> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success21"> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.18</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.37</DegreeStudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER22</foaf:name> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.66</ExamPerformanceGoal> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.12</ExamPerformanceAll> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.3</DegreeRepitition> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success61"> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.77</DegreeRepitition> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER62</foaf:name> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.56</ExamPerformanceGoal> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.06</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.72</DegreeStudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.19</ExamPerformanceAll> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success216"> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.52</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.32</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.3</ExamPerformanceGoal> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.5</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER217</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.288</DegreeRepitition> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success171"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.62</DegreeStudyTime> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.38</DegreeRepitition> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.49</ExamPerformanceGoal> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER172</foaf:name> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.33</ExamPerformanceAll> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.43</StudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success44"> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.115</StudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.27</ExamPerformanceAll> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.04</ExamPerformanceGoal> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.35</DegreeRepitition> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER45</foaf:name> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.65</DegreeStudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success84"> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.7</ExamPerformanceAll> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</DegreeRepitition> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER85</foaf:name> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.25</ExamPerformanceGoal> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.27</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</DegreeStudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success117"> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.8</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER118</foaf:name> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.315</StudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.7</ExamPerformanceGoal> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.28</DegreeStudyTime> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.69</DegreeRepitition> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success235"> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.35</DegreeRepitition> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.58</StudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER236</foaf:name> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.3</ExamPerformanceGoal> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.51</DegreeStudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.27</ExamPerformanceAll> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success107"> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER108</foaf:name> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.255</DegreeRepitition> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.305</StudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.54</ExamPerformanceGoal> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.63</DegreeStudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.4</ExamPerformanceAll> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success249"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.45</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.72</StudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER250</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.6</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.79</ExamPerformanceAll> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.45</ExamPerformanceGoal> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success94"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.89</DegreeStudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.8</ExamPerformanceGoal> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.32</DegreeRepitition> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.323</StudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.32</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER95</foaf:name> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success158"> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER159</foaf:name> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.18</ExamPerformanceAll> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.465</StudyTime> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.258</DegreeRepitition> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.59</ExamPerformanceGoal> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.73</DegreeStudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success30"> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.245</DegreeRepitition> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.31</ExamPerformanceAll> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.12</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.75</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.59</ExamPerformanceGoal> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER31</foaf:name> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success253"> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.61</StudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER254</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.78</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.92</ExamPerformanceAll> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.69</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.58</ExamPerformanceGoal> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success74"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.69</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.78</ExamPerformanceGoal> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.28</StudyTime> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.33</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER75</foaf:name> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.16</DegreeRepitition> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success229"> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.69</ExamPerformanceGoal> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.49</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.7</ExamPerformanceAll> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.99</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.07</DegreeStudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER230</foaf:name> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success10"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.55</DegreeStudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER11</foaf:name> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.81</ExamPerformanceGoal> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.3</ExamPerformanceAll> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.18</DegreeRepitition> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.18</StudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success185"> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.78</ExamPerformanceAll> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER186</foaf:name> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.21</ExamPerformanceGoal> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.34</DegreeStudyTime> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.64</DegreeRepitition> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.49</StudyTime> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success8"> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER9</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.14</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.72</ExamPerformanceAll> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.2</StudyTime> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.35</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.25</ExamPerformanceGoal> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success24"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.35</DegreeStudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER25</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</DegreeRepitition> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.06</StudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.25</ExamPerformanceGoal> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.76</ExamPerformanceAll> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success64"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.76</DegreeStudyTime> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER65</foaf:name> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.58</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.8</ExamPerformanceAll> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.24</StudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.28</ExamPerformanceGoal> + </rdf:Description> + <owl:AnnotationProperty rdf:about="http://example.com/ExamPerformanceGoal"/> + <rdf:Description rdf:about="http://example.org/Ev#Success215"> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.6</StudyTime> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER216</foaf:name> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.39</DegreeStudyTime> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.251</DegreeRepitition> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</ExamPerformanceAll> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.3</ExamPerformanceGoal> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success199"> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.34</DegreeStudyTime> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</DegreeRepitition> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER200</foaf:name> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.55</StudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</ExamPerformanceGoal> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.3</ExamPerformanceAll> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success148"> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.345</StudyTime> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.299</DegreeRepitition> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.1</DegreeStudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.13</ExamPerformanceGoal> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.64</ExamPerformanceAll> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER149</foaf:name> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success83"> + <DegreeStudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.15</DegreeStudyTime> + <StudyTime rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.25</StudyTime> + <ExamPerformanceGoal rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.26</ExamPerformanceGoal> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.0</KnowledgeLevel> + <ExamPerformanceAll rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.48</ExamPerformanceAll> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.29</DegreeRepitition> + <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string" + >USER84</foaf:name> + </rdf:Description> + <rdf:Description rdf:about="http://example.org/Ev#Success43"> + <DegreeRepitition rdf:datatype="http://www.w3.org/2001/XMLSchema#float" + >0.33</DegreeRepitition> + <KnowledgeLevel rdf:datatype="http://www.w3.org/2001/XMLSchem... [truncated message content] |
From: <far...@us...> - 2014-03-04 12:34:35
|
Revision: 4249 http://sourceforge.net/p/dl-learner/code/4249 Author: farshadbadie Date: 2014-03-04 12:34:31 +0000 (Tue, 04 Mar 2014) Log Message: ----------- figure Modified Paths: -------------- trunk/test/fuzzydll/EvKnowledge/EvKnowledge-figure.pdf Modified: trunk/test/fuzzydll/EvKnowledge/EvKnowledge-figure.pdf =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <far...@us...> - 2014-03-03 18:26:51
|
Revision: 4248 http://sourceforge.net/p/dl-learner/code/4248 Author: farshadbadie Date: 2014-03-03 18:26:49 +0000 (Mon, 03 Mar 2014) Log Message: ----------- figure Added Paths: ----------- trunk/test/fuzzydll/EvKnowledge/EvKnowledge-figure.pdf Added: trunk/test/fuzzydll/EvKnowledge/EvKnowledge-figure.pdf =================================================================== (Binary files differ) Index: trunk/test/fuzzydll/EvKnowledge/EvKnowledge-figure.pdf =================================================================== --- trunk/test/fuzzydll/EvKnowledge/EvKnowledge-figure.pdf 2014-03-03 18:26:17 UTC (rev 4247) +++ trunk/test/fuzzydll/EvKnowledge/EvKnowledge-figure.pdf 2014-03-03 18:26:49 UTC (rev 4248) Property changes on: trunk/test/fuzzydll/EvKnowledge/EvKnowledge-figure.pdf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <far...@us...> - 2014-03-03 18:26:23
|
Revision: 4247 http://sourceforge.net/p/dl-learner/code/4247 Author: farshadbadie Date: 2014-03-03 18:26:17 +0000 (Mon, 03 Mar 2014) Log Message: ----------- EvKnowledge.fuzzy Modified Paths: -------------- trunk/test/fuzzydll/EvKnowledge/EvKnowledge.txt Modified: trunk/test/fuzzydll/EvKnowledge/EvKnowledge.txt =================================================================== --- trunk/test/fuzzydll/EvKnowledge/EvKnowledge.txt 2014-03-03 12:34:45 UTC (rev 4246) +++ trunk/test/fuzzydll/EvKnowledge/EvKnowledge.txt 2014-03-03 18:26:17 UTC (rev 4247) @@ -1,75 +1,105 @@ -- Train has changed to EvKnowledge +Fuzzy_Train example is considered as EvKnowledge +- Train has changed to school - Car has changed to User - Lengh has changed to Success +- Knowledge has changed to Knowledge - Short has changed to Unsuccessful - Long has changed to Successful -- Load is still Load . And can have several shapes + + + +We need fuzzy annotation properties for properties like + +<!-- http://www.example.com/EvKnowledge.owl#fuzzySuccessfulUser --> +<!-- http://www.example.com/EvKnowledge.owl#fuzzyMediumSuccessUser --> +<!-- http://www.example.com/EvKnowledge.owl#fuzzyUnSuccessfulUser --> +<!-- http://www.example.com/EvKnowledge.owl#hasUser --> +<!-- http://www.example.com/EvKnowledge.owl#hasKnowledge --> +<!-- http://www.example.com/EvKnowledge.owl#isInFrontOf --> ??? +<!-- http://www.example.com/EvKnowledge.owl#hasUserSuccess --> +<!-- http://www.example.com/EvKnowledge.owl#User --> +<!-- http://www.example.com/EvKnowledge.owl#Knowledge --> +<!-- http://www.example.com/EvKnowledge.owl#SuccessfulUser --> +<!-- http://www.example.com/EvKnowledge.owl#MediumSuccessfulUser --> +<!-- http://www.example.com/EvKnowledge.owl#Rectangle --> +<!-- http://www.example.com/EvKnowledge.owl#UnSuccessfulUser --> +<!-- http://www.example.com/EvKnowledge.owl#School --> +<!-- http://www.example.com/EvKnowledge.owl#Triangle --> +<!-- http://www.w3.org/2002/07/owl#Thing --> + +And Annotation properties like: +<!-- http://www.example.com/EvKnowledge.owl#User120 --> + + + + + (define-fuzzy-concept fuzzySuccessfulUser right-shoulder(0.2, 0.4, 0.7, 1.0) ) (define-fuzzy-concept fuzzyUnsuccessfulUser left-shoulder(1.0, 0.7, 0.4, 0.2) ) (define-fuzzy-concept fuzzyMediumSuccessfulUser trapezoidal(-50.0, 50.0, 0.4, 0.2, 0.7, 1.0) ) (functional isInFrontOf) (functional hasUserSuccess) -(domain hasLoad User ) +(domain hasKnowledge User ) (domain isInFrontOf (or User EvKnowledge ) ) (domain hasUser EvKnowledge ) (range hasUser User ) (range isInFrontOf User ) -(range hasLoad Load ) +(range hasKnowledge Knowledge ) (domain hasUserSuccess User ) (range hasUserSuccess *real* 0 1 ) -(instance load63a Rectangle 1.0) -(instance load21a Triangle 1.0) +(instance Knowledge63a Rectangle 1.0) +(instance Knowledge21a Triangle 1.0) (instance User72 User 1.0) (instance User22 User 1.0) (instance User13 User 1.0) -(instance load72c Triangle 1.0) -(instance load63b Triangle 1.0) +(instance Knowledge72c Triangle 1.0) +(instance Knowledge63b Triangle 1.0) (instance User61 User 1.0) (instance User21 User 1.0) (instance User62 User 1.0) -(instance load71b Rectangle 1.0) +(instance Knowledge71b Rectangle 1.0) (instance User63 User 1.0) -(instance load72b Rectangle 1.0) -(instance load11a Rectangle 1.0) +(instance Knowledge72b Rectangle 1.0) +(instance Knowledge11a Rectangle 1.0) (instance User11 User 1.0) (instance User12 User 1.0) (instance User7 EvKnowledge 1.0) -(instance load61a Triangle 0.4) -(instance load11c Triangle 1.0) -(instance load62a Rectangle 1.0) -(instance load11b Rectangle 1.0) -(instance load71a Triangle 1.0) -(instance load22a Rectangle 0.8) +(instance Knowledge61a Triangle 0.4) +(instance Knowledge11c Triangle 1.0) +(instance Knowledge62a Rectangle 1.0) +(instance Knowledge11b Rectangle 1.0) +(instance Knowledge71a Triangle 1.0) +(instance Knowledge22a Rectangle 0.8) (instance User71 User 1.0) (instance west6 EvKnowledge 1.0) -(instance load22a Triangle 0.2) -(instance load12a Rectangle 1.0) -(instance load61a Rectangle 0.6) +(instance Knowledge22a Triangle 0.2) +(instance Knowledge12a Rectangle 1.0) +(instance Knowledge61a Rectangle 0.6) (instance east1 EvKnowledge 1.0) -(instance load72a Rectangle 1.0) +(instance Knowledge72a Rectangle 1.0) (related west6 User61 isInFrontOf 1.0) -(related car63 load63a hasLoad 1.0) +(related car63 Knowledge63a hasKnowledge 1.0) (related west6 User63 hasUser 1.0) (related east1 User13 hasUser 1.0) (related east2 User21 hasUser 1.0) -(related User72 load72b hasLoad 1.0) +(related User72 Knowledge72b hasKnowledge 1.0) (related east1 User11 hasUser 1.0) -(related User61 load61a hasLoad 0.1) +(related User61 Knowledge61a hasKnowledge 0.1) (related west7 User72 hasUser 1.0) -(related User62 load62a hasLoad 1.0) -(related User11 load11a hasLoad 1.0) +(related User62 Knowledge62a hasKnowledge 1.0) +(related User11 Knowledge11a hasKnowledge 1.0) (related west6 User61 hasUser 1.0) -(related User71 load71a hasLoad 1.0) +(related User71 Knowledge71a hasKnowledge 1.0) (related west7 User71 isInFrontOf 1.0) -(related User11 load11c hasLoad 1.0) +(related User11 Knowledge11c hasKnowledge 1.0) (related west7 User71 hasUser 1.0) (related east2 User22 hasUser 1.0) (related User21 User22 isInFrontOf 1.0) -(related User63 load63b hasLoad 1.0) +(related User63 Knowledge63b hasKnowledge 1.0) (related west6 User62 hasUser 1.0) (related west6 User62 hasUser 1.0) (related west7 User70 hasUser 1.0) @@ -83,11 +113,11 @@ (related east1 User11 isInFrontOf 1.0) (related User12 User13 isInFrontOf 1.0) (related User61 User62 isInFrontOf 1.0) -(related User12 load12a hasLoad 1.0) +(related User12 Knowledge12a hasKnowledge 1.0) (related User11 User12 isInFrontOf 1.0) (related east1 User12 hasUser 1.0) -(related User72 load72c hasLoad 1.0) -(related User22 load22a hasLoad 1.0) +(related User72 Knowledge72c hasKnowledge 1.0) +(related User22 Knowledge22a hasKnowledge 1.0) (related east2 User21 isInFrontOf 1.0) (related east2 User221 isInFrontOf 1.0) (related east2 User215 isInFrontOf 1.0) @@ -100,11 +130,11 @@ (related east1 User191 isInFrontOf 1.0) (related east1 User199 isInFrontOf 1.0) (related User71 User72 isInFrontOf 1.0) -(related User71 load71b hasLoad 1.0) -(related User21 load21a hasLoad 1.0) +(related User71 Knowledge71b hasKnowledge 1.0) +(related User21 Knowledge21a hasKnowledge 1.0) (related User62 User63 isInFrontOf 1.0) -(related User11 load11b hasLoad 1.0) -(related User72 load72a hasLoad 1.0) +(related User11 Knowledge11b hasKnowledge 1.0) +(related User72 Knowledge72a hasKnowledge 1.0) (instance User197 (= hasUserSuccessVeryLow) 1.0 ) (instance User208 (= hasUserSuccessMiddle) 1.0 ) @@ -121,9 +151,9 @@ (instance User17 (= hasUserSuccessVeryLow) 1.0 ) (instance User13 (= hasUserSuccessLow) 1.0 ) -(disjoint User Load ) +(disjoint User Knowledge ) (disjoint User EvKnowledge ) -(disjoint Load EvKnowledge ) +(disjoint Knowledge EvKnowledge ) (define-concept SuccessfulUser (and User (some hasUserSuccess fuzzySuccessfulUser))) (define-concept UnsuccessfulUser (and User (some hasUserSuccess fuzzyUnsuccessfulUser))) (define-concept MediumSuccessUser (and User (some hasUserSuccess fuzzyMediumSuccessUser))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <far...@us...> - 2014-03-03 12:34:49
|
Revision: 4246 http://sourceforge.net/p/dl-learner/code/4246 Author: farshadbadie Date: 2014-03-03 12:34:45 +0000 (Mon, 03 Mar 2014) Log Message: ----------- EvKnowledge.conf Modified Paths: -------------- trunk/test/fuzzydll/EvKnowledge/EvKnowledge.conf Modified: trunk/test/fuzzydll/EvKnowledge/EvKnowledge.conf =================================================================== --- trunk/test/fuzzydll/EvKnowledge/EvKnowledge.conf 2014-02-27 14:12:42 UTC (rev 4245) +++ trunk/test/fuzzydll/EvKnowledge/EvKnowledge.conf 2014-03-03 12:34:45 UTC (rev 4246) @@ -1,29 +1,35 @@ /** - * SUCCESSFUL USER Example + * SUCCESSFUL USER Fuzzy Example * * possible solution: * User AND EXISTS hasSTG.VeryLow AND hasSCG.VeryLow AND hasSTR.VeryLow AND hasLPR.High AND hasPEG.High AND hasUNS.HIGH * - * Copyright (C) 2007, Jens Lehmann + * 2014, Farshad Badie */ // declare some prefixes to use as abbreviations -prefixes = [ ("ex","http://example.com/EvKnowledge#") ] +prefixes = [ ("ex","http://example.com/EvKnowledge.owl#") ] // knowledge source definition ks.type = "OWL File" ks.fileName = "EvKnowledge.owl" // reasoner -reasoner.type = "fast instance checker" +reasoner.type = "Fuzzy OWL API Reasoner" reasoner.sources = { ks } // learning problem -lp.type = "posNegStandard" +problem.type = "fuzzyPosNeg" lp.positiveExamples = { "ex:", "ex:USER49", "ex:USER167" } lp.negativeExamples = { "ex:heinz", "ex:USER118", "ex:USER149" } +problem.fuzzyEx = [("ex:USER49",Successful),("ex:USER54",Successful),("ex:USER39",Unsuccessful),("ex:USER45",Unsuccessful)] +problem.reasoner = reasoner -// create learning algorithm to run -alg1.type = "celoe" -alg2.type = "pceloe" +// Learning algorithm +algorithm.type = "Fuzzy CELOE" +algorithm.reasoner = reasoner + + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <far...@us...> - 2014-02-27 14:12:49
|
Revision: 4245 http://sourceforge.net/p/dl-learner/code/4245 Author: farshadbadie Date: 2014-02-27 14:12:42 +0000 (Thu, 27 Feb 2014) Log Message: ----------- fuzzytrain Added Paths: ----------- trunk/test/fuzzydll/fuzzytrains.owl Added: trunk/test/fuzzydll/fuzzytrains.owl =================================================================== --- trunk/test/fuzzydll/fuzzytrains.owl (rev 0) +++ trunk/test/fuzzydll/fuzzytrains.owl 2014-02-27 14:12:42 UTC (rev 4245) @@ -0,0 +1,1136 @@ +<?xml version="1.0"?> + + +<!DOCTYPE rdf:RDF [ + <!ENTITY owl "http://www.w3.org/2002/07/owl#" > + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > + <!ENTITY ace_lexicon "http://attempto.ifi.uzh.ch/ace_lexicon#" > + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > +]> + + +<rdf:RDF xmlns="http://www.example.com/fuzzyTrains.owl#" + xml:base="http://www.example.com/fuzzyTrains.owl" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:ace_lexicon="http://attempto.ifi.uzh.ch/ace_lexicon#"> + <owl:Ontology rdf:about="http://www.example.com/fuzzyTrains.owl"> + <rdfs:comment xml:lang="en">Fuzzy adaptation of Michalsky's trains problem [1] +Original idea from [2] + +Developed by Josue Iglesias (josue at grpss.ssr.upm.es) + +[1] http://www.mli.gmu.edu/papers/79-80/80-05.pdf +[2] http://users.iit.demokritos.gr/~konstant/dload/Pubs/fuzz10.pdf</rdfs:comment> + </owl:Ontology> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Annotation properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://attempto.ifi.uzh.ch/ace_lexicon#CN_pl --> + + <owl:AnnotationProperty rdf:about="&ace_lexicon;CN_pl"/> + + + + <!-- http://attempto.ifi.uzh.ch/ace_lexicon#CN_sg --> + + <owl:AnnotationProperty rdf:about="&ace_lexicon;CN_sg"/> + + + + <!-- http://attempto.ifi.uzh.ch/ace_lexicon#PN_sg --> + + <owl:AnnotationProperty rdf:about="&ace_lexicon;PN_sg"/> + + + + <!-- http://attempto.ifi.uzh.ch/ace_lexicon#TV_pl --> + + <owl:AnnotationProperty rdf:about="&ace_lexicon;TV_pl"/> + + + + <!-- http://attempto.ifi.uzh.ch/ace_lexicon#TV_sg --> + + <owl:AnnotationProperty rdf:about="&ace_lexicon;TV_sg"/> + + + + <!-- http://attempto.ifi.uzh.ch/ace_lexicon#TV_vbg --> + + <owl:AnnotationProperty rdf:about="&ace_lexicon;TV_vbg"/> + + + + <!-- http://www.example.com/fuzzyTrains.owl#fuzzyLabel --> + + <owl:AnnotationProperty rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyLabel"/> + + + + <!-- http://www.w3.org/2000/01/rdf-schema#comment --> + + <owl:AnnotationProperty rdf:about="&rdfs;comment"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Datatypes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#noFuzzyLongCar --> + + <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#noFuzzyLongCar"> + <owl:equivalentClass> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">40.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </owl:equivalentClass> + </rdfs:Datatype> + + + + <!-- http://www.example.com/fuzzyTrains.owl#noFuzzyMediumLengthCar --> + + <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#noFuzzyMediumLengthCar"> + <owl:equivalentClass> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">15.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxExclusive rdf:datatype="&xsd;double">40.0</xsd:maxExclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </owl:equivalentClass> + </rdfs:Datatype> + + + + <!-- http://www.example.com/fuzzyTrains.owl#noFuzzyShortCar --> + + <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#noFuzzyShortCar"> + <owl:equivalentClass> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxExclusive rdf:datatype="&xsd;double">15.0</xsd:maxExclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </owl:equivalentClass> + </rdfs:Datatype> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Object Properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#hasCar --> + + <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasCar"> + <ace_lexicon:TV_vbg>hasCared</ace_lexicon:TV_vbg> + <ace_lexicon:TV_sg>hasCars</ace_lexicon:TV_sg> + <ace_lexicon:TV_pl>hasCar</ace_lexicon:TV_pl> + <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:ObjectProperty> + + + + <!-- http://www.example.com/fuzzyTrains.owl#hasLoad --> + + <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasLoad"> + <ace_lexicon:TV_sg>hasLoads</ace_lexicon:TV_sg> + <ace_lexicon:TV_vbg>hasLoaded</ace_lexicon:TV_vbg> + <ace_lexicon:TV_pl>hasLoad</ace_lexicon:TV_pl> + <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + </owl:ObjectProperty> + + + + <!-- http://www.example.com/fuzzyTrains.owl#isInFrontOf --> + + <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#isInFrontOf"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> + <ace_lexicon:TV_vbg>isInFrontOfed</ace_lexicon:TV_vbg> + <ace_lexicon:TV_pl>isInFrontOf</ace_lexicon:TV_pl> + <ace_lexicon:TV_sg>isInFrontOfs</ace_lexicon:TV_sg> + <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + </owl:ObjectProperty> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Data properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#hasCarLength --> + + <owl:DatatypeProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasCarLength"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> + <ace_lexicon:TV_pl>hasCarLength</ace_lexicon:TV_pl> + <ace_lexicon:TV_sg>hasCarLengths</ace_lexicon:TV_sg> + <ace_lexicon:TV_vbg>hasCarLengthed</ace_lexicon:TV_vbg> + <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:range> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </rdfs:range> + </owl:DatatypeProperty> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Classes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#Car --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Car"> + <rdfs:subClassOf rdf:resource="&owl;Thing"/> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <ace_lexicon:CN_pl>Cars</ace_lexicon:CN_pl> + <ace_lexicon:CN_sg>Car</ace_lexicon:CN_sg> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Load --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Load"> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <ace_lexicon:CN_pl>Loads</ace_lexicon:CN_pl> + <ace_lexicon:CN_sg>Load</ace_lexicon:CN_sg> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#LongCar --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#LongCar"> + <owl:equivalentClass> + <owl:Restriction> + <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> + <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#noFuzzyLongCar"/> + </owl:Restriction> + </owl:equivalentClass> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <ace_lexicon:CN_sg>LongCar</ace_lexicon:CN_sg> + <ace_lexicon:CN_pl>LongCars</ace_lexicon:CN_pl> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#MediumLenghtCar --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#MediumLenghtCar"> + <owl:equivalentClass> + <owl:Restriction> + <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> + <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#noFuzzyMediumLengthCar"/> + </owl:Restriction> + </owl:equivalentClass> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <ace_lexicon:CN_sg>MediumLenghtCar</ace_lexicon:CN_sg> + <ace_lexicon:CN_pl>MediumLenghtCars</ace_lexicon:CN_pl> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Rectangle --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Rectangle"> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:CN_sg>Rectangle</ace_lexicon:CN_sg> + <ace_lexicon:CN_pl>Rectangles</ace_lexicon:CN_pl> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#ShortCar --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#ShortCar"> + <owl:equivalentClass> + <owl:Restriction> + <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> + <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#noFuzzyShortCar"/> + </owl:Restriction> + </owl:equivalentClass> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <ace_lexicon:CN_sg>ShortCar</ace_lexicon:CN_sg> + <ace_lexicon:CN_pl>ShortCars</ace_lexicon:CN_pl> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Train --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Train"> + <ace_lexicon:CN_sg>Train</ace_lexicon:CN_sg> + <ace_lexicon:CN_pl>Trains</ace_lexicon:CN_pl> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Triangle --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Triangle"> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + <ace_lexicon:CN_sg>Triangle</ace_lexicon:CN_sg> + <ace_lexicon:CN_pl>Triangles</ace_lexicon:CN_pl> + </owl:Class> + + + + <!-- http://www.w3.org/2002/07/owl#Thing --> + + <owl:Class rdf:about="&owl;Thing"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Individuals + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#car01 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car01"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">9.0</hasCarLength> + <ace_lexicon:PN_sg>car01</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car02"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load011"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load012"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car02 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car02"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">16.0</hasCarLength> + <ace_lexicon:PN_sg>car02</ace_lexicon:PN_sg> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load021"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load022"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car11 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car11"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">49.0</hasCarLength> + <ace_lexicon:PN_sg>car11</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car12"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11b"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11c"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car12 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car12"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">25.0</hasCarLength> + <ace_lexicon:PN_sg>car12</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car13"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load12a"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car13 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car13"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">13.0</hasCarLength> + <ace_lexicon:PN_sg>car13</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car21 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car21"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">47.0</hasCarLength> + <ace_lexicon:PN_sg>car21</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car22"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load12a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load21a"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car22 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car22"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">7.0</hasCarLength> + <ace_lexicon:PN_sg>car22</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car31 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car31"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">41.0</hasCarLength> + <ace_lexicon:PN_sg>car31</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car32"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load311"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car32 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car32"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">50.0</hasCarLength> + <ace_lexicon:PN_sg>car32</ace_lexicon:PN_sg> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load321"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load322"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car41 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car41"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">50.0</hasCarLength> + <ace_lexicon:PN_sg>car41</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car42"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load411"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car42 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car42"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">6.0</hasCarLength> + <ace_lexicon:PN_sg>car42</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car43"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load421"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car43 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car43"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">5.0</hasCarLength> + <ace_lexicon:PN_sg>car43</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car51 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car51"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">41.0</hasCarLength> + <ace_lexicon:PN_sg>car51</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car52"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load511"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load512"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load513"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car52 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car52"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">34.0</hasCarLength> + <ace_lexicon:PN_sg>car52</ace_lexicon:PN_sg> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load521"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car61 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car61"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">45.0</hasCarLength> + <ace_lexicon:PN_sg>car61</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car62"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car62 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car62"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">8.0</hasCarLength> + <ace_lexicon:PN_sg>car62</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car63"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load62a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load62b"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car63 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car63"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">25.0</hasCarLength> + <ace_lexicon:PN_sg>car63</ace_lexicon:PN_sg> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load63a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load63b"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car71 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car71"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">7.0</hasCarLength> + <ace_lexicon:PN_sg>car71</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car72"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load71a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load71b"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car72 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car72"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">6.0</hasCarLength> + <ace_lexicon:PN_sg>car72</ace_lexicon:PN_sg> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72b"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72c"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car81 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car81"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">21.0</hasCarLength> + <ace_lexicon:PN_sg>car81</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car82"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car82 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car82"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">6.0</hasCarLength> + <ace_lexicon:PN_sg>car82</ace_lexicon:PN_sg> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load821"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car91 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car91"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">31.0</hasCarLength> + <ace_lexicon:PN_sg>car91</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car92"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load911"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car92 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car92"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">48.0</hasCarLength> + <ace_lexicon:PN_sg>car92</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car93"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load921"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car93 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car93"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">10.0</hasCarLength> + <ace_lexicon:PN_sg>car93</ace_lexicon:PN_sg> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load931"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#east1 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east1"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <ace_lexicon:PN_sg>east1</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car11"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car11"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car12"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car13"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#east2 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east2"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <ace_lexicon:PN_sg>east2</ace_lexicon:PN_sg> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car21"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car21"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car22"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#east3 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east3"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <ace_lexicon:PN_sg>east3</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car31"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car31"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car32"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#east4 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east4"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <ace_lexicon:PN_sg>east4</ace_lexicon:PN_sg> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car41"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car41"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car42"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car43"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#east5 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east5"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <ace_lexicon:PN_sg>east5</ace_lexicon:PN_sg> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car51"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car51"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car52"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load011 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load011"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load011</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load012 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load012"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load012</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load021 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load021"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load021</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load022 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load022"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load022</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load11a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load11a</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load11b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load11b</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load11c --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11c"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load11c</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load12a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load12a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load12a</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load21a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load21a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load21a</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load21b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load21b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load21b</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load311 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load311"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load311</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load321 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load321"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load321</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load322 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load322"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load322</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load411 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load411"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load411</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load421 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load421"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load421</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load511 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load511"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load511</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load512 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load512"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load512</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load513 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load513"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load513</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load521 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load521"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load521</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load62a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load62a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load62a</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load62b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load62b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load62b</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load63a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load63a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load63a</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load63b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load63b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load63b</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load71a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load71a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load71a</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load71b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load71b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load71b</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load72a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load72a</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load72b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load72b</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load72c --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72c"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load72c</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load821 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load821"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load821</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load911 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load911"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load911</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load921 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load921"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <ace_lexicon:PN_sg>load921</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load931 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load931"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <ace_lexicon:PN_sg>load931</ace_lexicon:PN_sg> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#west0 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west0"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <ace_lexicon:PN_sg>west0</ace_lexicon:PN_sg> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car01"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car01"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car02"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#west6 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west6"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <ace_lexicon:PN_sg>west6</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car61"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car61"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car62"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car63"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#west7 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west7"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <ace_lexicon:PN_sg>west7</ace_lexicon:PN_sg> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car71"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car71"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car72"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#west8 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west8"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <ace_lexicon:PN_sg>west8</ace_lexicon:PN_sg> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car81"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car81"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car82"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#west9 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west9"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <ace_lexicon:PN_sg>west9</ace_lexicon:PN_sg> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car91"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car91"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car92"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car93"/> + </owl:NamedIndividual> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // General axioms + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + <rdf:Description> + <rdf:type rdf:resource="&owl;AllDisjointClasses"/> + <owl:members rdf:parseType="Collection"> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#LongCar"/> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#MediumLenghtCar"/> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#ShortCar"/> + </owl:members> + </rdf:Description> +</rdf:RDF> + + + +<!-- Generated by the OWL API (version 3.4.2) http://owlapi.sourceforge.net --> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <far...@us...> - 2014-02-25 14:51:51
|
Revision: 4244 http://sourceforge.net/p/dl-learner/code/4244 Author: farshadbadie Date: 2014-02-25 14:51:46 +0000 (Tue, 25 Feb 2014) Log Message: ----------- crossvalidation Modified Paths: -------------- trunk/test/fuzzydll/fuzzy_trains.conf Added Paths: ----------- trunk/test/fuzzydll/cross-validation/ trunk/test/fuzzydll/cross-validation/fuzzyTrains_v5.0.owl trunk/test/fuzzydll/cross-validation/fuzzy_trains.conf Added: trunk/test/fuzzydll/cross-validation/fuzzyTrains_v5.0.owl =================================================================== --- trunk/test/fuzzydll/cross-validation/fuzzyTrains_v5.0.owl (rev 0) +++ trunk/test/fuzzydll/cross-validation/fuzzyTrains_v5.0.owl 2014-02-25 14:51:46 UTC (rev 4244) @@ -0,0 +1,712 @@ +<?xml version="1.0"?> + + +<!DOCTYPE rdf:RDF [ + <!ENTITY owl "http://www.w3.org/2002/07/owl#" > + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > +]> + + +<rdf:RDF xmlns="http://www.example.com/fuzzyTrains.owl#" + xml:base="http://www.example.com/fuzzyTrains.owl" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <owl:Ontology rdf:about="http://www.example.com/fuzzyTrains.owl"> + <rdfs:comment xml:lang="en">Fuzzy adaptation of Michalsky's trains problem [1] +Original idea from [2] + +Developed by Josue Iglesias (josue at grpss.ssr.upm.es) + +[1] http://www.mli.gmu.edu/papers/79-80/80-05.pdf +[2] http://users.iit.demokritos.gr/~konstant/dload/Pubs/fuzz10.pdf.</rdfs:comment> + <rdfs:comment xml:lang="en">v3.0: +no fuzzy version: +- no fuzzy data types (stated by fuzzy annotations) +- no use of other fuzzy annotations + +solutions: +- east: +"1: isInFrontOf only (LongCar and hasLoad some Triangle) (pred. acc.: 100,00%, F-measure: 100,00%)" +- west: +"1: hasCar some (ShortCar and hasLoad some Rectangle) (pred. acc.: 100,00%, F-measure: 100,00%)" + +v3.2: += v3.0 ++ car61 hasLoad load61a (Triangle) + +v3.21: += v3.2 ++ car61 hasLoad load61a (Triangle) 0.1 + +v3.3 += v3.21 ++ fuzzy dataTypes for hasLength ++ car11 length 39 (in the "fuzzy" part between MediumCar and LongCar + +v4.0 += v3.3 ++ car61 type Car 0.3 (this has no effect!!!??) + +v5.0 += v4.0 ++ load22a type Rectangle [0.2] ++ car22 hasLoad load22a [0.1] ++ car22 length 14 ++ car61 length 41 ++ load61a type Triangle [0.4]</rdfs:comment> + </owl:Ontology> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Annotation properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + <owl:AnnotationProperty rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyLabel"/> + <owl:AnnotationProperty rdf:about="&rdfs;comment"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Datatypes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#fuzzyLongCar --> + + <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyLongCar"> + <owl:equivalentClass> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">-150.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </owl:equivalentClass> + <fuzzyLabel><fuzzyOwl2 fuzzyType="datatype"> +<Datatype type="rightshoulder" a="35" b="45" /> +</fuzzyOwl2></fuzzyLabel> + </rdfs:Datatype> + + + + <!-- http://www.example.com/fuzzyTrains.owl#fuzzyMediumLengthCar --> + + <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyMediumLengthCar"> + <owl:equivalentClass> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">-100.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxInclusive rdf:datatype="&xsd;double">100.0</xsd:maxInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </owl:equivalentClass> + <fuzzyLabel><fuzzyOwl2 fuzzyType="datatype"> +<Datatype type="trapezoidal" a="10" b="20" c="35" d="45" /> +</fuzzyOwl2></fuzzyLabel> + </rdfs:Datatype> + + + + <!-- http://www.example.com/fuzzyTrains.owl#fuzzyShortCar --> + + <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyShortCar"> + <owl:equivalentClass> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxInclusive rdf:datatype="&xsd;double">150.0</xsd:maxInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </owl:equivalentClass> + <fuzzyLabel><fuzzyOwl2 fuzzyType="datatype"> +<Datatype type="leftshoulder" a="10" b="20" /> +</fuzzyOwl2></fuzzyLabel> + </rdfs:Datatype> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Object Properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#hasCar --> + + <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasCar"> + <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:ObjectProperty> + + + + <!-- http://www.example.com/fuzzyTrains.owl#hasLoad --> + + <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasLoad"> + <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + </owl:ObjectProperty> + + + + <!-- http://www.example.com/fuzzyTrains.owl#isInFrontOf --> + + <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#isInFrontOf"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> + <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + </owl:ObjectProperty> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Data properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#hasCarLength --> + + <owl:DatatypeProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasCarLength"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> + <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:range> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">-1000.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxInclusive rdf:datatype="&xsd;double">1000.0</xsd:maxInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </rdfs:range> + </owl:DatatypeProperty> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Classes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#Car --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Car"> + <rdfs:subClassOf rdf:resource="&owl;Thing"/> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Load --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Load"> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#LongCar --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#LongCar"> + <owl:equivalentClass> + <owl:Restriction> + <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> + <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#fuzzyLongCar"/> + </owl:Restriction> + </owl:equivalentClass> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#MediumLenghtCar --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#MediumLenghtCar"> + <owl:equivalentClass> + <owl:Restriction> + <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> + <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#fuzzyMediumLengthCar"/> + </owl:Restriction> + </owl:equivalentClass> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Rectangle --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Rectangle"> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#ShortCar --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#ShortCar"> + <owl:equivalentClass> + <owl:Restriction> + <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> + <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#fuzzyShortCar"/> + </owl:Restriction> + </owl:equivalentClass> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Train --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Train"/> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Triangle --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Triangle"> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + </owl:Class> + + + + <!-- http://www.w3.org/2002/07/owl#Thing --> + + <owl:Class rdf:about="&owl;Thing"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Individuals + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#car11 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car11"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">39</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car12"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11b"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11c"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car12 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car12"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">25</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car13"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load12a"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car13 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car13"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">9</hasCarLength> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car21 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car21"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">47</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car22"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load21a"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car22 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car22"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">14</hasCarLength> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load22a"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car61 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car61"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">41</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car62"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load61a"/> + </owl:NamedIndividual> + <owl:Axiom> + <fuzzyLabel><fuzzyOwl2 fuzzyType="axiom"> +<Degree value="1.0" /> +</fuzzyOwl2></fuzzyLabel> + <owl:annotatedTarget rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <owl:annotatedSource rdf:resource="http://www.example.com/fuzzyTrains.owl#car61"/> + <owl:annotatedProperty rdf:resource="&rdf;type"/> + </owl:Axiom> + <owl:Axiom> + <fuzzyLabel><fuzzyOwl2 fuzzyType="axiom"> +<Degree value="0.1" /> +</fuzzyOwl2></fuzzyLabel> + <owl:annotatedSource rdf:resource="http://www.example.com/fuzzyTrains.owl#car61"/> + <owl:annotatedProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasLoad"/> + <owl:annotatedTarget rdf:resource="http://www.example.com/fuzzyTrains.owl#load61a"/> + </owl:Axiom> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car62 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car62"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">8</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car63"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load62a"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car63 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car63"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">25</hasCarLength> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load63a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load63b"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car71 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car71"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">7</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car72"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load71a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load71b"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car72 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car72"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">6</hasCarLength> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72b"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72c"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#east1 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east1"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car11"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car11"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car12"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car13"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#east2 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east2"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car21"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car21"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car22"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load11a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load11b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load11c --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11c"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load12a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load12a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load21a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load21a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load22a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load22a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + <owl:Axiom> + <fuzzyLabel><fuzzyOwl2 fuzzyType="axiom"> +<Degree value="0.2" /> +</fuzzyOwl2></fuzzyLabel> + <owl:annotatedTarget rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <owl:annotatedSource rdf:resource="http://www.example.com/fuzzyTrains.owl#load22a"/> + <owl:annotatedProperty rdf:resource="&rdf;type"/> + </owl:Axiom> + <owl:Axiom> + <fuzzyLabel><fuzzyOwl2 fuzzyType="axiom"> +<Degree value="0.8" /> +</fuzzyOwl2></fuzzyLabel> + <owl:annotatedTarget rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <owl:annotatedSource rdf:resource="http://www.example.com/fuzzyTrains.owl#load22a"/> + <owl:annotatedProperty rdf:resource="&rdf;type"/> + </owl:Axiom> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load61a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load61a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + <owl:Axiom> + <fuzzyLabel><fuzzyOwl2 fuzzyType="axiom"> +<Degree value="0.6" /> +</fuzzyOwl2></fuzzyLabel> + <owl:annotatedTarget rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + <owl:annotatedSource rdf:resource="http://www.example.com/fuzzyTrains.owl#load61a"/> + <owl:annotatedProperty rdf:resource="&rdf;type"/> + </owl:Axiom> + <owl:Axiom> + <fuzzyLabel><fuzzyOwl2 fuzzyType="axiom"> +<Degree value="0.4" /> +</fuzzyOwl2></fuzzyLabel> + <owl:annotatedTarget rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + <owl:annotatedSource rdf:resource="http://www.example.com/fuzzyTrains.owl#load61a"/> + <owl:annotatedProperty rdf:resource="&rdf;type"/> + </owl:Axiom> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load62a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load62a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load63a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load63a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load63b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load63b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load71a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load71a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load71b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load71b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load72a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load72b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load72c --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72c"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#west6 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west6"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car61"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car61"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car62"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car63"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#west7 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west7"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car71"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car71"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car72"/> + </owl:NamedIndividual> +</rdf:RDF> + + + +<!-- Generated by the OWL API (version 3.1.0.20069) http://owlapi.sourceforge.net --> + Added: trunk/test/fuzzydll/cross-validation/fuzzy_trains.conf =================================================================== --- trunk/test/fuzzydll/cross-validation/fuzzy_trains.conf (rev 0) +++ trunk/test/fuzzydll/cross-validation/fuzzy_trains.conf 2014-02-25 14:51:46 UTC (rev 4244) @@ -0,0 +1,22 @@ + +// declare some prefixes to use as abbreviations +prefixes = [ ("ex","http://www.example.com/fuzzyTrains.owl#") ] + +// knowledge source definition +ks.type = "OWL File" +ks.fileName = "fuzzyTrains_v5.0.owl" + +// reasoner +reasoner.type = "Fuzzy OWL API Reasoner" +reasoner.sources = { ks } + +// learning problem +problem.type = "fuzzyPosNeg" +problem.positiveExamples = {"ex:east1", "ex:east2" } +problem.negativeExamples = {"ex:west8", "ex:west9" } +problem.fuzzyEx = [("ex:east1",1.0),("ex:east2",1.0),("ex:west6",0.0),("ex:west7",0.0)] +problem.reasoner = reasoner + +// algorithm +algorithm.type = "Fuzzy CELOE" +algorithm.reasoner = reasoner Modified: trunk/test/fuzzydll/fuzzy_trains.conf =================================================================== --- trunk/test/fuzzydll/fuzzy_trains.conf 2014-02-25 12:43:04 UTC (rev 4243) +++ trunk/test/fuzzydll/fuzzy_trains.conf 2014-02-25 14:51:46 UTC (rev 4244) @@ -12,11 +12,11 @@ // learning problem problem.type = "fuzzyPosNeg" -problem.positiveExamples = { } -problem.negativeExamples = { } -problem.fuzzyEx = [("ex:east1",0.7),("ex:east2",0.5),("ex:west8",0.3),("ex:west9",0.1)] +problem.positiveExamples = {"ex:east1", "ex:east2" } +problem.negativeExamples = {"ex:west8", "ex:west9" } +problem.fuzzyEx = [("ex:east1",1.0),("ex:east2",1.0),("ex:west6",0.0),("ex:west7",0.0)] problem.reasoner = reasoner // algorithm algorithm.type = "Fuzzy CELOE" -algorithm.reasoner = reasoner \ No newline at end of file +algorithm.reasoner = reasoner This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2014-02-25 12:43:08
|
Revision: 4243 http://sourceforge.net/p/dl-learner/code/4243 Author: lorenz_b Date: 2014-02-25 12:43:04 +0000 (Tue, 25 Feb 2014) Log Message: ----------- Fixed bug. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java 2014-02-25 12:08:21 UTC (rev 4242) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java 2014-02-25 12:43:04 UTC (rev 4243) @@ -105,8 +105,6 @@ // all descriptions in the search tree plus those which were too weak (for fast redundancy check) private TreeSet<Description> descriptions; - private EvaluatedDescriptionSet bestEvaluatedDescriptions; - // if true, then each solution is evaluated exactly instead of approximately // private boolean exactBestDescriptionEvaluation = false; private boolean singleSuggestionMode; @@ -174,7 +172,7 @@ private int maxClassDescriptionTests = 0; - private int maxExecutionTimeInSeconds = 200; + private int maxExecutionTimeInSeconds = 60; private boolean terminateOnNoiseReached = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ki...@us...> - 2014-02-25 12:08:26
|
Revision: 4242 http://sourceforge.net/p/dl-learner/code/4242 Author: kirdie Date: 2014-02-25 12:08:21 +0000 (Tue, 25 Feb 2014) Log Message: ----------- added quoting in index and others stuff i forgot. Modified Paths: -------------- trunk/components-core/pom.xml trunk/components-core/src/main/java/org/dllearner/core/AbstractAxiomLearningAlgorithm.java trunk/components-ext/pom.xml trunk/components-ext/src/main/java/org/dllearner/common/index/Index.java trunk/components-ext/src/main/java/org/dllearner/common/index/MappingBasedIndex.java Modified: trunk/components-core/pom.xml =================================================================== --- trunk/components-core/pom.xml 2014-02-25 12:01:14 UTC (rev 4241) +++ trunk/components-core/pom.xml 2014-02-25 12:08:21 UTC (rev 4242) @@ -20,6 +20,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.3</version> <configuration> <!-- Uncomment this when the junits are independent of a runtime directory --> <!--<includes> --> @@ -58,7 +59,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> - <version>2.8</version> + <version>2.9</version> <configuration> <show>public</show> <nohelp>true</nohelp> Modified: trunk/components-core/src/main/java/org/dllearner/core/AbstractAxiomLearningAlgorithm.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/AbstractAxiomLearningAlgorithm.java 2014-02-25 12:01:14 UTC (rev 4241) +++ trunk/components-core/src/main/java/org/dllearner/core/AbstractAxiomLearningAlgorithm.java 2014-02-25 12:08:21 UTC (rev 4242) @@ -563,12 +563,10 @@ if(values == null){ try { values = (T) value.getClass().newInstance(); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); + values.add(value); } - values.add(value); + catch (InstantiationException e) {e.printStackTrace();return;} + catch (IllegalAccessException e) {e.printStackTrace();return;} } values.add(value); } Modified: trunk/components-ext/pom.xml =================================================================== --- trunk/components-ext/pom.xml 2014-02-25 12:01:14 UTC (rev 4241) +++ trunk/components-ext/pom.xml 2014-02-25 12:08:21 UTC (rev 4242) @@ -133,6 +133,36 @@ </dependencies> <build> <plugins> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.9</version> + <configuration> + <show>public</show> + <nohelp>true</nohelp> + <destDir>doc/javadoc</destDir> + <doctitle>DL-Learner Javadoc</doctitle> + <author>true</author> + <nodeprecated>false</nodeprecated> + <nodeprecatedlist>false</nodeprecatedlist> + <noindex>false</noindex> + <nonavbar>false</nonavbar> + <notree>false</notree> + <overview>src/etc/overview.html</overview> + <source>1.6</source> + <sourcepath>src/main/java</sourcepath> + <splitindex>true</splitindex> + <stylesheetfile>src/etc/javadoc.css</stylesheetfile> + <use>true</use> + <version>true</version> + <linksource>true</linksource> + <bottom><img style='float:right' src='http://sflogo.sourceforge.net/sflogo.php?group_id=203619&type=1' width='88' height='31' border='0' alt='SourceForge.net Logo' /> DL-Learner is licenced under the terms of the GNU General Public License.<br />Copyright &#169; 2007-2011 Jens Lehmann</bottom> + <encoding>ISO-8859-1</encoding> + <windowtitle>DL-Learner Javadoc</windowtitle> + </configuration> + </plugin> + <!-- <plugin> <groupId>org.codehaus.mojo</groupId> @@ -151,6 +181,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.3</version> <configuration> <excludes> <exclude>org/dllearner/algorithm/tbsl/*</exclude> @@ -161,7 +192,7 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> - <version>1.2</version> + <version>1.2.1</version> <executions> <execution> Modified: trunk/components-ext/src/main/java/org/dllearner/common/index/Index.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/common/index/Index.java 2014-02-25 12:01:14 UTC (rev 4241) +++ trunk/components-ext/src/main/java/org/dllearner/common/index/Index.java 2014-02-25 12:08:21 UTC (rev 4242) @@ -5,9 +5,11 @@ public abstract class Index { static final int DEFAULT_LIMIT = 10; - + + String enquote(String s) {if(!s.startsWith("(")) s='('+s+')'; return s;} + public List<String> getResources(String queryString) {return getResources(queryString,DEFAULT_LIMIT);} - public List<String> getResources(String queryString, int limit) {return getResources(queryString,DEFAULT_LIMIT,0);} + public List<String> getResources(String queryString, int limit) {return getResources(enquote(queryString),DEFAULT_LIMIT,0);} abstract public List<String> getResources(String queryString, int limit, int offset); public IndexResultSet getResourcesWithScores(String queryString) {return getResourcesWithScores(queryString,DEFAULT_LIMIT);} Modified: trunk/components-ext/src/main/java/org/dllearner/common/index/MappingBasedIndex.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/common/index/MappingBasedIndex.java 2014-02-25 12:01:14 UTC (rev 4241) +++ trunk/components-ext/src/main/java/org/dllearner/common/index/MappingBasedIndex.java 2014-02-25 12:08:21 UTC (rev 4242) @@ -5,6 +5,8 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -12,101 +14,43 @@ import java.util.Map.Entry; public class MappingBasedIndex { - - private Map<String, List<String>> classUri2TokensMap = new HashMap<String, List<String>>(); - private Map<String, List<String>> resourceUri2TokensMap = new HashMap<String, List<String>>(); - private Map<String, List<String>> datatypePropertyUri2TokensMap = new HashMap<String, List<String>>(); - private Map<String, List<String>> objectPropertyUri2TokensMap = new HashMap<String, List<String>>(); - - public MappingBasedIndex(String classMappingsFile, String resourceMappingsFile, - String dataPropertyMappingsFile, String objectPropertyMappingsFile) { - BufferedReader br = null; - String line = null; - try { - //load class mappings - if(classMappingsFile != null){ - br = new BufferedReader(new FileReader(new File(classMappingsFile))); - while((line = br.readLine()) != null){ - int split = line.indexOf("|"); - //get the URI - String uri = line.substring(0, split); - //get the list of tokens - List<String> tokens = new ArrayList<String>(); - String tokenString = line.substring(split + 1); - String[] tokenArray = tokenString.split(","); - for(String token : tokenArray){ - tokens.add(token.trim()); - } - - classUri2TokensMap.put(uri, tokens); - } + + private final Map<String, List<String>> classUri2TokensMap; + private final Map<String, List<String>> resourceUri2TokensMap; + private final Map<String, List<String>> datatypePropertyUri2TokensMap; + private final Map<String, List<String>> objectPropertyUri2TokensMap; + + Map<String,List<String>> uriToTokens(InputStream mapping) throws IOException + { + Map<String, List<String>> uriToTokens = new HashMap<>(); + try(BufferedReader in = new BufferedReader(new InputStreamReader(mapping))) + { + String line = null; + while((line = in.readLine()) != null) + { + int split = line.indexOf("|"); + //get the URI + String uri = line.substring(0, split); + //get the list of tokens + List<String> tokens = new ArrayList<String>(); + String tokenString = line.substring(split + 1); + String[] tokenArray = tokenString.split(","); + for(String token : tokenArray){tokens.add(token.trim());} + uriToTokens.put(uri, tokens); } - - //load resource mappings - if(resourceMappingsFile != null){ - br = new BufferedReader(new FileReader(new File(resourceMappingsFile))); - while((line = br.readLine()) != null){ - int split = line.indexOf("|"); - //get the URI - String uri = line.substring(0, split); - //get the list of tokens - List<String> tokens = new ArrayList<String>(); - String tokenString = line.substring(split + 1); - String[] tokenArray = tokenString.split(","); - for(String token : tokenArray){ - tokens.add(token.trim()); - } - - resourceUri2TokensMap.put(uri, tokens); - } - } - - //load object property mappings - if(objectPropertyMappingsFile != null){ - br = new BufferedReader(new FileReader(new File(objectPropertyMappingsFile))); - while((line = br.readLine()) != null){ - int split = line.indexOf("|"); - //get the URI - String uri = line.substring(0, split); - //get the list of tokens - List<String> tokens = new ArrayList<String>(); - String tokenString = line.substring(split + 1); - String[] tokenArray = tokenString.split(","); - for(String token : tokenArray){ - tokens.add(token.trim()); - } - - objectPropertyUri2TokensMap.put(uri, tokens); - } - } - - //load datatype property mappings - if(dataPropertyMappingsFile != null){ - br = new BufferedReader(new FileReader(new File(dataPropertyMappingsFile))); - while((line = br.readLine()) != null){ - int split = line.indexOf("|"); - //get the URI - String uri = line.substring(0, split); - //get the list of tokens - List<String> tokens = new ArrayList<String>(); - String tokenString = line.substring(split + 1); - String[] tokenArray = tokenString.split(","); - for(String token : tokenArray){ - tokens.add(token.trim()); - } - - datatypePropertyUri2TokensMap.put(uri, tokens); - } - } - - - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } + return uriToTokens; + } } - + + public MappingBasedIndex(InputStream classMappingsFile, InputStream resourceMappingsFile, + InputStream dataPropertyMappingsFile, InputStream objectPropertyMappingsFile) throws IOException + { + classUri2TokensMap=uriToTokens(classMappingsFile); + resourceUri2TokensMap=uriToTokens(resourceMappingsFile); + datatypePropertyUri2TokensMap=uriToTokens(dataPropertyMappingsFile); + objectPropertyUri2TokensMap=uriToTokens(objectPropertyMappingsFile); + } + public List<String> getClasses(String token){ List<String> uris = new ArrayList<String>(); for(Entry<String, List<String>> entry : classUri2TokensMap.entrySet()){ @@ -116,8 +60,8 @@ } return uris; } - - public List<String> getResources(String token){ + + public List<String> getResourceAsStreams(String token){ List<String> uris = new ArrayList<String>(); for(Entry<String, List<String>> entry : resourceUri2TokensMap.entrySet()){ if(entry.getValue().contains(token)){ @@ -126,7 +70,7 @@ } return uris; } - + public List<String> getObjectProperties(String token){ List<String> uris = new ArrayList<String>(); for(Entry<String, List<String>> entry : objectPropertyUri2TokensMap.entrySet()){ @@ -136,7 +80,7 @@ } return uris; } - + public List<String> getDatatypeProperties(String token){ List<String> uris = new ArrayList<String>(); for(Entry<String, List<String>> entry : datatypePropertyUri2TokensMap.entrySet()){ @@ -146,14 +90,14 @@ } return uris; } - + public List<String> getProperties(String token){ List<String> uris = new ArrayList<String>(); uris.addAll(getObjectProperties(token)); uris.addAll(getDatatypeProperties(token)); return uris; } - + public IndexResultSet getClassesWithScores(String token){ IndexResultSet rs = new IndexResultSet(); for(String uri : getClasses(token)){ @@ -161,15 +105,15 @@ } return rs; } - - public IndexResultSet getResourcesWithScores(String token){ + + public IndexResultSet getResourceAsStreamsWithScores(String token){ IndexResultSet rs = new IndexResultSet(); - for(String uri : getResources(token)){ + for(String uri : getResourceAsStreams(token)){ rs.addItem(new IndexResultItem(uri, token, 1f)); } return rs; } - + public IndexResultSet getObjectPropertiesWithScores(String token){ IndexResultSet rs = new IndexResultSet(); for(String uri : getObjectProperties(token)){ @@ -177,7 +121,7 @@ } return rs; } - + public IndexResultSet getDatatypePropertiesWithScores(String token){ IndexResultSet rs = new IndexResultSet(); for(String uri : getDatatypeProperties(token)){ @@ -185,7 +129,7 @@ } return rs; } - + public IndexResultSet getPropertiesWithScores(String token){ IndexResultSet rs = new IndexResultSet(); for(String uri : getProperties(token)){ @@ -193,7 +137,7 @@ } return rs; } - + public Boolean isDataProperty(String uri){ if(datatypePropertyUri2TokensMap.containsKey(uri)) { return true; @@ -202,9 +146,9 @@ } return null; } - - public static void main(String[] args) { - MappingBasedIndex index = new MappingBasedIndex(MappingBasedIndex.class.getClassLoader().getResource("tbsl/oxford_class_mappings.txt").getPath(), null, null, null); + + public static void main(String[] args) throws IOException { + MappingBasedIndex index = new MappingBasedIndex(MappingBasedIndex.class.getClassLoader().getResourceAsStream("tbsl/oxford_class_mappings.txt"),null, null, null); System.out.println(index.getClasses("flat")); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2014-02-25 12:01:18
|
Revision: 4241 http://sourceforge.net/p/dl-learner/code/4241 Author: jenslehmann Date: 2014-02-25 12:01:14 +0000 (Tue, 25 Feb 2014) Log Message: ----------- some fixes; added accuracy method for class learning problem Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java trunk/components-core/src/main/java/org/dllearner/learningproblems/ClassLearningProblem.java trunk/examples/family/father_oe.conf Added Paths: ----------- trunk/test/thanh/ Removed Paths: ------------- trunk/examples/thanh/ Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2014-02-25 11:30:53 UTC (rev 4240) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2014-02-25 12:01:14 UTC (rev 4241) @@ -593,7 +593,7 @@ // System.out.println("refining: " + node); int horizExp = node.getHorizontalExpansion(); TreeSet<Description> refinements = (TreeSet<Description>) operator.refine(node.getDescription(), horizExp+1); - System.out.println(refinements); +// System.out.println(refinements); node.incHorizontalExpansion(); node.setRefinementCount(refinements.size()); nodes.add(node); Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/ClassLearningProblem.java 2014-02-25 11:30:53 UTC (rev 4240) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/ClassLearningProblem.java 2014-02-25 12:01:14 UTC (rev 4241) @@ -924,4 +924,12 @@ public void setCheckConsistency(boolean checkConsistency) { this.checkConsistency = checkConsistency; } + + public String getAccuracyMethod() { + return accuracyMethod; + } + + public void setAccuracyMethod(String accuracyMethod) { + this.accuracyMethod = accuracyMethod; + } } Modified: trunk/examples/family/father_oe.conf =================================================================== --- trunk/examples/family/father_oe.conf 2014-02-25 11:30:53 UTC (rev 4240) +++ trunk/examples/family/father_oe.conf 2014-02-25 12:01:14 UTC (rev 4241) @@ -12,6 +12,7 @@ // learning problem lp.type = "clp" lp.classToDescribe = "ex:father" +lp.accuracyMethod = "fmeasure" // create learning algorithm to run alg.type = "celoe" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2014-02-25 11:30:59
|
Revision: 4240 http://sourceforge.net/p/dl-learner/code/4240 Author: jenslehmann Date: 2014-02-25 11:30:53 +0000 (Tue, 25 Feb 2014) Log Message: ----------- cleanup Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java trunk/components-core/src/main/java/org/dllearner/core/ReasonerOld.java trunk/components-core/src/main/java/org/dllearner/core/SchemaReasoner.java trunk/components-core/src/main/java/org/dllearner/core/config/ClassExpressionPropertyEditor.java trunk/components-core/src/main/java/org/dllearner/core/config/ObjectPropertyEditor.java trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigMappings.java trunk/components-core/src/main/java/org/dllearner/core/owl/ClassHierarchy.java trunk/components-core/src/main/java/org/dllearner/kb/KBFile.java trunk/components-core/src/main/java/org/dllearner/kb/OWLAPIOntology.java trunk/components-core/src/main/java/org/dllearner/kb/SparqlEndpointKS.java trunk/components-core/src/main/java/org/dllearner/kb/aquisitors/RDFBlankNode.java trunk/components-core/src/main/java/org/dllearner/kb/aquisitors/SparqlTupleAquisitorImproved.java trunk/components-core/src/main/java/org/dllearner/kb/repository/bioportal/BioPortalRepository.java trunk/components-core/src/main/java/org/dllearner/kb/repository/tones/TONESRepository.java trunk/components-core/src/main/java/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java trunk/components-core/src/main/java/org/dllearner/kb/sparql/SparqlKnowledgeSource.java trunk/components-core/src/main/java/org/dllearner/kb/sparql/SymmetricConciseBoundedDescriptionGeneratorImpl.java trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/ABoxQueryGenerator.java trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/ClassIndexer.java trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/JenaToOwlapiConverter.java trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/SchemaIndexer.java trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/TBoxQueryGenerator.java trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java trunk/components-core/src/main/java/org/dllearner/learningproblems/PosNegLPStrict.java trunk/components-core/src/main/java/org/dllearner/parser/KBParser.java trunk/components-core/src/main/java/org/dllearner/parser/KBParserTokenManager.java trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserTokenManager.java trunk/components-core/src/main/java/org/dllearner/reasoning/DIGConverter.java trunk/components-core/src/main/java/org/dllearner/reasoning/DIGHTTPConnector.java trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java trunk/components-core/src/main/java/org/dllearner/reasoning/FastRetrieval.java trunk/components-core/src/main/java/org/dllearner/reasoning/FastRetrievalReasoner.java trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java trunk/components-core/src/main/java/org/dllearner/refinementoperators/ELDown.java trunk/components-core/src/main/java/org/dllearner/refinementoperators/ELDown2.java trunk/components-core/src/main/java/org/dllearner/refinementoperators/PsiDown.java trunk/components-core/src/main/java/org/dllearner/refinementoperators/PsiUp.java trunk/components-core/src/main/java/org/dllearner/refinementoperators/RefinementOperator.java trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown2008.java trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDown.java trunk/components-core/src/main/java/org/dllearner/utilities/FuzzyOwl2.java trunk/components-core/src/main/java/org/dllearner/utilities/FuzzyOwl2toFuzzyDL.java trunk/components-core/src/main/java/org/dllearner/utilities/Helper.java trunk/components-core/src/main/java/org/dllearner/utilities/components/ComponentCombo.java trunk/components-core/src/main/java/org/dllearner/utilities/components/ReasonerComponentFactory.java trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/Datastructures.java trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/DescriptionSubsumptionTree.java trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/MapToStringTupleListConverter.java trunk/components-core/src/main/java/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java trunk/components-core/src/main/java/org/dllearner/utilities/examples/ExampleDataCollector.java trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnConfiguration.java trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnOWLFileConfiguration.java trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnSPARQLConfiguration.java trunk/components-core/src/main/java/org/dllearner/utilities/learn/UsedEntitiesDetection.java trunk/components-core/src/main/java/org/dllearner/utilities/owl/AxiomComparator.java trunk/components-core/src/main/java/org/dllearner/utilities/owl/ConceptComparator.java trunk/components-core/src/main/java/org/dllearner/utilities/owl/ConceptTransformation.java trunk/components-core/src/main/java/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java trunk/components-core/src/main/java/org/dllearner/utilities/owl/ManchesterOWLSyntaxParser.java trunk/components-core/src/main/java/org/dllearner/utilities/owl/OWLAxiomToSPARQLConverter.java trunk/components-core/src/main/java/org/dllearner/utilities/owl/SimpleOntologyToByteConverter.java trunk/components-core/src/test/java/org/dllearner/algorithms/isle/FixDBpediaOntology.java trunk/components-core/src/test/java/org/dllearner/algorithms/pattern/OWLAxiomRenamerTest.java trunk/components-core/src/test/java/org/dllearner/algorithms/pattern/OWLPatternDetectionTest.java trunk/components-core/src/test/java/org/dllearner/core/AnnComponentManagerTest.java trunk/components-core/src/test/java/org/dllearner/kb/OWLAPIOntologyTest.java trunk/components-core/src/test/java/org/dllearner/kb/sparql/SparqlKnowledgeSourceTest.java trunk/components-core/src/test/java/org/dllearner/test/ClassCastExceptionTest.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains_noFuzzyIndividuals.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java trunk/components-core/src/test/java/org/dllearner/test/SworeTest.java trunk/components-core/src/test/java/org/dllearner/test/TestOneQueryForMusicRecommender.java trunk/components-core/src/test/java/org/dllearner/test/TripleTypeTest.java trunk/components-core/src/test/java/org/dllearner/test/junit/ClassExpressionTests.java trunk/components-core/src/test/java/org/dllearner/test/junit/ComponentTests.java trunk/components-core/src/test/java/org/dllearner/test/junit/ConfigOptionTest.java trunk/components-core/src/test/java/org/dllearner/test/junit/ELDescriptionTreeTests.java trunk/components-core/src/test/java/org/dllearner/test/junit/HeuristicTests.java trunk/components-core/src/test/java/org/dllearner/test/junit/LearningProblemTest.java trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java trunk/components-core/src/test/java/org/dllearner/test/junit/PropertyLearningTest.java trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java trunk/components-core/src/test/java/org/dllearner/test/junit/RefinementOperatorTests.java trunk/components-core/src/test/java/org/dllearner/test/junit/SimulationTests.java trunk/components-core/src/test/java/org/dllearner/test/junit/SomeOnlyReasonerTest.java trunk/components-core/src/test/java/org/dllearner/utilities/owl/OntologyToByteConverterTest.java Modified: trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -24,7 +24,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -37,30 +36,12 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; -import java.util.Map.Entry; import org.apache.log4j.Logger; -import org.dllearner.algorithms.DisjointClassesLearner; -import org.dllearner.algorithms.SimpleSubclassLearner; -import org.dllearner.algorithms.celoe.CELOE; -import org.dllearner.algorithms.properties.DataPropertyDomainAxiomLearner; -import org.dllearner.algorithms.properties.DataPropertyRangeAxiomLearner; -import org.dllearner.algorithms.properties.DisjointDataPropertyAxiomLearner; -import org.dllearner.algorithms.properties.DisjointObjectPropertyAxiomLearner; -import org.dllearner.algorithms.properties.EquivalentDataPropertyAxiomLearner; -import org.dllearner.algorithms.properties.EquivalentObjectPropertyAxiomLearner; -import org.dllearner.algorithms.properties.FunctionalDataPropertyAxiomLearner; -import org.dllearner.algorithms.properties.FunctionalObjectPropertyAxiomLearner; -import org.dllearner.algorithms.properties.InverseFunctionalObjectPropertyAxiomLearner; -import org.dllearner.algorithms.properties.ObjectPropertyDomainAxiomLearner; -import org.dllearner.algorithms.properties.ObjectPropertyRangeAxiomLearner; -import org.dllearner.algorithms.properties.SubDataPropertyOfAxiomLearner; -import org.dllearner.algorithms.properties.SubObjectPropertyOfAxiomLearner; -import org.dllearner.algorithms.properties.SymmetricObjectPropertyAxiomLearner; -import org.dllearner.algorithms.properties.TransitiveObjectPropertyAxiomLearner; import org.dllearner.core.options.ConfigEntry; import org.dllearner.core.options.ConfigOption; import org.dllearner.core.options.InvalidConfigOptionValueException; Modified: trunk/components-core/src/main/java/org/dllearner/core/ReasonerOld.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/ReasonerOld.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/core/ReasonerOld.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -23,17 +23,17 @@ import java.util.Set; import java.util.SortedSet; +import org.dllearner.core.owl.ClassHierarchy; import org.dllearner.core.owl.Constant; import org.dllearner.core.owl.DataRange; import org.dllearner.core.owl.DatatypeProperty; import org.dllearner.core.owl.DatatypePropertyHierarchy; +import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Entity; +import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectPropertyHierarchy; -import org.dllearner.core.owl.ClassHierarchy; import org.dllearner.reasoning.ReasonerType; import org.dllearner.utilities.datastructures.SortedSetTuple; Modified: trunk/components-core/src/main/java/org/dllearner/core/SchemaReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/SchemaReasoner.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/core/SchemaReasoner.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -23,11 +23,11 @@ import java.util.SortedSet; import java.util.TreeSet; +import org.dllearner.core.owl.ClassHierarchy; import org.dllearner.core.owl.DataRange; import org.dllearner.core.owl.DatatypeProperty; import org.dllearner.core.owl.DatatypePropertyHierarchy; import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.ClassHierarchy; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectPropertyHierarchy; Modified: trunk/components-core/src/main/java/org/dllearner/core/config/ClassExpressionPropertyEditor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/config/ClassExpressionPropertyEditor.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/core/config/ClassExpressionPropertyEditor.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -9,8 +9,6 @@ import org.dllearner.core.owl.Description; import org.dllearner.parser.ManchesterSyntaxParser; import org.dllearner.parser.ParseException; -import org.dllearner.utilities.owl.ManchesterOWLSyntaxParser; -import org.semanticweb.owlapi.expression.ParserException; public class ClassExpressionPropertyEditor implements PropertyEditor { Modified: trunk/components-core/src/main/java/org/dllearner/core/config/ObjectPropertyEditor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/config/ObjectPropertyEditor.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/core/config/ObjectPropertyEditor.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -19,12 +19,14 @@ package org.dllearner.core.config; -import org.dllearner.core.owl.ObjectProperty; - -import java.awt.*; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Rectangle; import java.beans.PropertyChangeListener; import java.beans.PropertyEditor; +import org.dllearner.core.owl.ObjectProperty; + /** * Created by IntelliJ IDEA. * User: Chris Modified: trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigMappings.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigMappings.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigMappings.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -24,8 +24,8 @@ import java.util.TreeSet; import org.dllearner.core.options.fuzzydll.FuzzyExample; +import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.fuzzydll.FuzzyIndividual; import org.dllearner.utilities.owl.ConceptComparator; Modified: trunk/components-core/src/main/java/org/dllearner/core/owl/ClassHierarchy.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/ClassHierarchy.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/ClassHierarchy.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -20,11 +20,11 @@ package org.dllearner.core.owl; import java.util.HashSet; +import java.util.Map.Entry; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; -import java.util.Map.Entry; import org.apache.log4j.Logger; import org.dllearner.utilities.owl.ConceptComparator; Modified: trunk/components-core/src/main/java/org/dllearner/kb/KBFile.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/KBFile.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/KBFile.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -27,9 +27,9 @@ import java.util.LinkedList; import org.apache.log4j.Logger; +import org.dllearner.core.AbstractKnowledgeSource; import org.dllearner.core.ComponentAnn; import org.dllearner.core.ComponentInitException; -import org.dllearner.core.AbstractKnowledgeSource; import org.dllearner.core.config.ConfigOption; import org.dllearner.core.options.URLConfigOption; import org.dllearner.core.owl.KB; Modified: trunk/components-core/src/main/java/org/dllearner/kb/OWLAPIOntology.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/OWLAPIOntology.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/OWLAPIOntology.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -30,7 +30,10 @@ import org.dllearner.core.owl.KB; import org.dllearner.utilities.owl.OntologyToByteConverter; import org.dllearner.utilities.owl.SimpleOntologyToByteConverter; -import org.semanticweb.owlapi.model.*; +import org.semanticweb.owlapi.model.IRI; +import org.semanticweb.owlapi.model.OWLOntology; +import org.semanticweb.owlapi.model.OWLOntologyCreationException; +import org.semanticweb.owlapi.model.OWLOntologyManager; /** * This class provides a wrapper around a single OWL Ontology. However, due to threading issues it is not safe Modified: trunk/components-core/src/main/java/org/dllearner/kb/SparqlEndpointKS.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/SparqlEndpointKS.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/SparqlEndpointKS.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -25,7 +25,6 @@ import java.util.List; import java.util.concurrent.TimeUnit; -import org.aksw.jena_sparql_api.cache.core.QueryExecutionFactoryCacheEx; import org.aksw.jena_sparql_api.cache.extra.CacheCoreEx; import org.aksw.jena_sparql_api.cache.extra.CacheCoreH2; import org.aksw.jena_sparql_api.cache.extra.CacheEx; Modified: trunk/components-core/src/main/java/org/dllearner/kb/aquisitors/RDFBlankNode.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/aquisitors/RDFBlankNode.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/aquisitors/RDFBlankNode.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -20,7 +20,11 @@ package org.dllearner.kb.aquisitors; import com.hp.hpl.jena.graph.Node; -import com.hp.hpl.jena.rdf.model.*; +import com.hp.hpl.jena.rdf.model.Literal; +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.RDFNode; +import com.hp.hpl.jena.rdf.model.RDFVisitor; +import com.hp.hpl.jena.rdf.model.Resource; /** * This class is used to save disambiguated information for a blankNode in an RDF Modified: trunk/components-core/src/main/java/org/dllearner/kb/aquisitors/SparqlTupleAquisitorImproved.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/aquisitors/SparqlTupleAquisitorImproved.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/aquisitors/SparqlTupleAquisitorImproved.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -25,15 +25,14 @@ import java.util.SortedSet; import java.util.TreeSet; -import com.hp.hpl.jena.query.QuerySolution; import org.apache.log4j.Logger; import org.dllearner.kb.sparql.SPARQLTasks; import org.dllearner.kb.sparql.SparqlQueryMaker; import org.dllearner.utilities.datastructures.RDFNodeTuple; +import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSetFormatter; import com.hp.hpl.jena.rdf.model.RDFNode; -import com.hp.hpl.jena.sparql.core.ResultBinding; import com.hp.hpl.jena.sparql.resultset.ResultSetRewindable; /** Modified: trunk/components-core/src/main/java/org/dllearner/kb/repository/bioportal/BioPortalRepository.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/repository/bioportal/BioPortalRepository.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/repository/bioportal/BioPortalRepository.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -12,9 +12,6 @@ import org.apache.log4j.Logger; import org.dllearner.kb.repository.OntologyRepository; import org.dllearner.kb.repository.OntologyRepositoryEntry; -import org.semanticweb.owlapi.apibinding.OWLManager; -import org.semanticweb.owlapi.model.IRI; -import org.semanticweb.owlapi.model.OWLOntology; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.KXml2Driver; Modified: trunk/components-core/src/main/java/org/dllearner/kb/repository/tones/TONESRepository.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/repository/tones/TONESRepository.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/repository/tones/TONESRepository.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -13,7 +13,6 @@ import org.apache.log4j.Logger; import org.dllearner.kb.repository.OntologyRepository; import org.dllearner.kb.repository.OntologyRepositoryEntry; -import org.dllearner.kb.repository.bioportal.BioPortalRepository; import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLOntologyIRIMapper; import org.semanticweb.owlapi.util.OntologyIRIShortFormProvider; Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -23,8 +23,8 @@ import org.apache.log4j.Logger; import org.dllearner.algorithms.gp.ADC; +import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ComponentManager; -import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.owl.Constant; import org.dllearner.core.owl.DatatypeExactCardinalityRestriction; import org.dllearner.core.owl.DatatypeMaxCardinalityRestriction; Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/SparqlKnowledgeSource.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/SparqlKnowledgeSource.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/SparqlKnowledgeSource.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -65,10 +65,10 @@ import org.dllearner.utilities.owl.SimpleOntologyToByteConverter; import org.dllearner.utilities.statistics.SimpleClock; import org.semanticweb.owlapi.model.OWLOntology; +import org.semanticweb.owlapi.model.OWLOntologyManager; import com.jamonapi.Monitor; import com.jamonapi.MonitorFactory; -import org.semanticweb.owlapi.model.OWLOntologyManager; /** * Represents the SPARQL Endpoint Component. Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/SymmetricConciseBoundedDescriptionGeneratorImpl.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/SymmetricConciseBoundedDescriptionGeneratorImpl.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/SymmetricConciseBoundedDescriptionGeneratorImpl.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -3,13 +3,10 @@ import java.io.UnsupportedEncodingException; import java.sql.SQLException; import java.util.List; -import java.util.Set; import org.apache.log4j.Level; import org.apache.log4j.Logger; -import com.hp.hpl.jena.query.Query; -import com.hp.hpl.jena.query.QueryFactory; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP; Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/ABoxQueryGenerator.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/ABoxQueryGenerator.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/ABoxQueryGenerator.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -3,11 +3,8 @@ */ package org.dllearner.kb.sparql.simple; -import java.util.*; +import java.util.Set; -import com.hp.hpl.jena.ontology.Individual; -import com.hp.hpl.jena.ontology.OntModel; -import com.hp.hpl.jena.util.iterator.ExtendedIterator; import com.jamonapi.Monitor; import com.jamonapi.MonitorFactory; Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/ClassIndexer.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/ClassIndexer.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/ClassIndexer.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -21,6 +21,16 @@ package org.dllearner.kb.sparql.simple; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.hp.hpl.jena.ontology.OntClass; import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.ontology.OntModelSpec; @@ -28,13 +38,8 @@ import com.hp.hpl.jena.util.iterator.ExtendedIterator; import com.jamonapi.Monitor; import com.jamonapi.MonitorFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import javax.naming.ldap.ExtendedRequest; -import java.util.*; - /** * Indexes an Ontology * skips complex classes per default, this does not affect the hierarchy outcome Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/JenaToOwlapiConverter.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/JenaToOwlapiConverter.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/JenaToOwlapiConverter.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -3,7 +3,6 @@ import java.io.StringReader; import java.io.StringWriter; -import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.io.ReaderDocumentSource; import org.semanticweb.owlapi.model.OWLOntology; import org.semanticweb.owlapi.model.OWLOntologyCreationException; Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/SchemaIndexer.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/SchemaIndexer.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/SchemaIndexer.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -1,20 +1,16 @@ package org.dllearner.kb.sparql.simple; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; import java.util.HashSet; import java.util.List; import java.util.Set; -import com.jamonapi.Monitor; -import com.jamonapi.MonitorFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.rdf.model.ModelFactory; +import com.jamonapi.Monitor; +import com.jamonapi.MonitorFactory; public class SchemaIndexer { private static Logger log = LoggerFactory.getLogger(SchemaIndexer.class); Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/TBoxQueryGenerator.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/TBoxQueryGenerator.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/simple/TBoxQueryGenerator.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -3,9 +3,7 @@ */ package org.dllearner.kb.sparql.simple; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Set; import com.hp.hpl.jena.ontology.OntModel; Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -42,7 +42,6 @@ import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.fuzzydll.FuzzyIndividual; -import org.dllearner.utilities.Helper; /** * @author Jens Lehmann Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/PosNegLPStrict.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/PosNegLPStrict.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/PosNegLPStrict.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -19,7 +19,6 @@ package org.dllearner.learningproblems; -import java.util.Collection; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -29,9 +28,7 @@ import org.dllearner.core.ComponentInitException; import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.config.ConfigOption; -import org.dllearner.core.options.BooleanConfigOption; import org.dllearner.core.options.ConfigEntry; -import org.dllearner.core.options.DoubleConfigOption; import org.dllearner.core.options.InvalidConfigOptionValueException; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; Modified: trunk/components-core/src/main/java/org/dllearner/parser/KBParser.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/KBParser.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/parser/KBParser.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -20,9 +20,47 @@ /* Generated By:JavaCC: Do not edit this line. KBParser.java */ package org.dllearner.parser; -import org.dllearner.core.owl.*; -import java.io.*; -import java.net.URL; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.StringReader; +import java.net.URL; + +import org.dllearner.core.owl.BooleanValueRestriction; +import org.dllearner.core.owl.ClassAssertionAxiom; +import org.dllearner.core.owl.DataRange; +import org.dllearner.core.owl.DatatypeProperty; +import org.dllearner.core.owl.DatatypePropertyDomainAxiom; +import org.dllearner.core.owl.DatatypePropertyRangeAxiom; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.EquivalentClassesAxiom; +import org.dllearner.core.owl.FunctionalObjectPropertyAxiom; +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.Intersection; +import org.dllearner.core.owl.InverseObjectPropertyAxiom; +import org.dllearner.core.owl.KB; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.Negation; +import org.dllearner.core.owl.Nothing; +import org.dllearner.core.owl.OWL2Datatype; +import org.dllearner.core.owl.ObjectAllRestriction; +import org.dllearner.core.owl.ObjectMaxCardinalityRestriction; +import org.dllearner.core.owl.ObjectMinCardinalityRestriction; +import org.dllearner.core.owl.ObjectProperty; +import org.dllearner.core.owl.ObjectPropertyAssertion; +import org.dllearner.core.owl.ObjectPropertyDomainAxiom; +import org.dllearner.core.owl.ObjectPropertyRangeAxiom; +import org.dllearner.core.owl.ObjectSomeRestriction; +import org.dllearner.core.owl.ObjectValueRestriction; +import org.dllearner.core.owl.PropertyAxiom; +import org.dllearner.core.owl.StringValueRestriction; +import org.dllearner.core.owl.SubClassAxiom; +import org.dllearner.core.owl.SubObjectPropertyAxiom; +import org.dllearner.core.owl.SymmetricObjectPropertyAxiom; +import org.dllearner.core.owl.Thing; +import org.dllearner.core.owl.TransitiveObjectPropertyAxiom; +import org.dllearner.core.owl.Union; @SuppressWarnings("all") public class KBParser implements KBParserConstants { Modified: trunk/components-core/src/main/java/org/dllearner/parser/KBParserTokenManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/KBParserTokenManager.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/parser/KBParserTokenManager.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -19,9 +19,6 @@ /* Generated By:JavaCC: Do not edit this line. KBParserTokenManager.java */ package org.dllearner.parser; -import org.dllearner.core.owl.*; -import java.io.*; -import java.net.URL; /** Token Manager. */ @SuppressWarnings("all") Modified: trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -1,10 +1,25 @@ /* Generated By:JavaCC: Do not edit this line. ManchesterSyntaxParser.java */ package org.dllearner.parser; -import org.dllearner.core.owl.*; -import java.io.*; -import java.net.URL; +import java.io.StringReader; +import org.dllearner.core.owl.DatatypeProperty; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.Intersection; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.Negation; +import org.dllearner.core.owl.Nothing; +import org.dllearner.core.owl.ObjectAllRestriction; +import org.dllearner.core.owl.ObjectMaxCardinalityRestriction; +import org.dllearner.core.owl.ObjectMinCardinalityRestriction; +import org.dllearner.core.owl.ObjectProperty; +import org.dllearner.core.owl.ObjectSomeRestriction; +import org.dllearner.core.owl.ObjectValueRestriction; +import org.dllearner.core.owl.StringValueRestriction; +import org.dllearner.core.owl.Thing; +import org.dllearner.core.owl.Union; + public class ManchesterSyntaxParser implements ManchesterSyntaxParserConstants { public static Description parseClassExpression(String classExpression) throws ParseException { Modified: trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserTokenManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserTokenManager.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserTokenManager.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -1,8 +1,5 @@ /* Generated By:JavaCC: Do not edit this line. ManchesterSyntaxParserTokenManager.java */ package org.dllearner.parser; -import org.dllearner.core.owl.*; -import java.io.*; -import java.net.URL; /** Token Manager. */ public class ManchesterSyntaxParserTokenManager implements ManchesterSyntaxParserConstants Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/DIGConverter.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/DIGConverter.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/DIGConverter.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -22,30 +22,30 @@ import java.net.URI; import java.util.Set; -import org.dllearner.core.owl.ObjectAllRestriction; -import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Axiom; -import org.dllearner.core.owl.Nothing; +import org.dllearner.core.owl.ClassAssertionAxiom; import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.ClassAssertionAxiom; import org.dllearner.core.owl.EquivalentClassesAxiom; -import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.FunctionalObjectPropertyAxiom; -import org.dllearner.core.owl.SubClassAxiom; import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.Intersection; import org.dllearner.core.owl.KB; -import org.dllearner.core.owl.Intersection; -import org.dllearner.core.owl.Union; +import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Negation; +import org.dllearner.core.owl.Nothing; +import org.dllearner.core.owl.ObjectAllRestriction; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectPropertyAssertion; import org.dllearner.core.owl.ObjectPropertyExpression; import org.dllearner.core.owl.ObjectPropertyInverse; import org.dllearner.core.owl.ObjectQuantorRestriction; +import org.dllearner.core.owl.ObjectSomeRestriction; +import org.dllearner.core.owl.SubClassAxiom; import org.dllearner.core.owl.SubObjectPropertyAxiom; import org.dllearner.core.owl.SymmetricObjectPropertyAxiom; import org.dllearner.core.owl.Thing; import org.dllearner.core.owl.TransitiveObjectPropertyAxiom; +import org.dllearner.core.owl.Union; /** * Methods for converting internal representation to DIG and Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/DIGHTTPConnector.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/DIGHTTPConnector.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/DIGHTTPConnector.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -36,11 +36,11 @@ import org.kr.dl.dig.v1_1.GetIdentifierDocument; import org.kr.dl.dig.v1_1.IdRespType; import org.kr.dl.dig.v1_1.IdentifierDocument; +import org.kr.dl.dig.v1_1.KbDocument.Kb; import org.kr.dl.dig.v1_1.NewKBDocument; import org.kr.dl.dig.v1_1.ReleaseKBDocument; import org.kr.dl.dig.v1_1.ResponseDocument; import org.kr.dl.dig.v1_1.ResponsesDocument; -import org.kr.dl.dig.v1_1.KbDocument.Kb; /** * Methods for sending messages to a DIG-capable reasoner and receiving answers Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -20,19 +20,18 @@ package org.dllearner.reasoning; import java.io.File; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.Arrays; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; import org.apache.log4j.Logger; -import org.dllearner.core.AbstractKnowledgeSource; import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ComponentAnn; import org.dllearner.core.ComponentInitException; Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/FastRetrieval.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/FastRetrieval.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/FastRetrieval.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -23,16 +23,16 @@ import java.util.SortedSet; import java.util.TreeSet; -import org.dllearner.core.owl.ObjectAllRestriction; -import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.Nothing; import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.FlatABox; import org.dllearner.core.owl.Intersection; -import org.dllearner.core.owl.Union; +import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Negation; +import org.dllearner.core.owl.Nothing; +import org.dllearner.core.owl.ObjectAllRestriction; +import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.Thing; +import org.dllearner.core.owl.Union; import org.dllearner.utilities.Helper; import org.dllearner.utilities.datastructures.SortedSetTuple; Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/FastRetrievalReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/FastRetrievalReasoner.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/FastRetrievalReasoner.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -25,7 +25,6 @@ import java.util.SortedSet; import java.util.TreeSet; -import org.dllearner.core.AbstractKnowledgeSource; import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ComponentInitException; import org.dllearner.core.KnowledgeSource; Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -20,7 +20,6 @@ package org.dllearner.reasoning.fuzzydll; import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringWriter; @@ -71,7 +70,6 @@ import com.clarkparsia.pellet.owlapiv3.PelletReasoner; import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory; -import edu.stanford.nlp.io.StringOutputStream; import fuzzydl.AllInstancesQuery; import fuzzydl.Concept; import fuzzydl.ConfigReader; Modified: trunk/components-core/src/main/java/org/dllearner/refinementoperators/ELDown.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/refinementoperators/ELDown.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/refinementoperators/ELDown.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -22,8 +22,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; import java.util.Map; import java.util.Set; import java.util.SortedSet; @@ -36,12 +34,12 @@ import org.dllearner.algorithms.el.ELDescriptionTree; import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ComponentInitException; +import org.dllearner.core.owl.ClassHierarchy; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Intersection; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectPropertyHierarchy; -import org.dllearner.core.owl.ClassHierarchy; import org.dllearner.core.owl.Thing; /** Modified: trunk/components-core/src/main/java/org/dllearner/refinementoperators/ELDown2.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/refinementoperators/ELDown2.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/refinementoperators/ELDown2.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -19,7 +19,6 @@ package org.dllearner.refinementoperators; -import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; @@ -29,7 +28,6 @@ import java.util.Map; import java.util.Set; import java.util.SortedSet; -import java.util.Stack; import java.util.TreeMap; import java.util.TreeSet; @@ -43,14 +41,13 @@ import org.dllearner.algorithms.el.TreeAndRoleSetComparator; import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ComponentInitException; +import org.dllearner.core.owl.ClassHierarchy; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Intersection; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectPropertyHierarchy; -import org.dllearner.core.owl.ClassHierarchy; import org.dllearner.core.owl.Thing; -import org.dllearner.utilities.Helper; //import com.jamonapi.Monitor; //import com.jamonapi.MonitorFactory; Modified: trunk/components-core/src/main/java/org/dllearner/refinementoperators/PsiDown.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/refinementoperators/PsiDown.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/refinementoperators/PsiDown.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -28,17 +28,17 @@ import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ComponentInitException; -import org.dllearner.core.owl.ObjectAllRestriction; -import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.Nothing; import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.Intersection; -import org.dllearner.core.owl.Union; +import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Negation; +import org.dllearner.core.owl.Nothing; +import org.dllearner.core.owl.ObjectAllRestriction; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectQuantorRestriction; +import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.Thing; +import org.dllearner.core.owl.Union; import org.dllearner.learningproblems.PosNegLP; import org.dllearner.utilities.owl.ConceptComparator; Modified: trunk/components-core/src/main/java/org/dllearner/refinementoperators/PsiUp.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/refinementoperators/PsiUp.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/refinementoperators/PsiUp.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -28,17 +28,17 @@ import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ComponentInitException; -import org.dllearner.core.owl.ObjectAllRestriction; -import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.Nothing; import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.Intersection; -import org.dllearner.core.owl.Union; +import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Negation; +import org.dllearner.core.owl.Nothing; +import org.dllearner.core.owl.ObjectAllRestriction; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectQuantorRestriction; +import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.Thing; +import org.dllearner.core.owl.Union; import org.dllearner.learningproblems.PosNegLP; import org.dllearner.utilities.owl.ConceptComparator; Modified: trunk/components-core/src/main/java/org/dllearner/refinementoperators/RefinementOperator.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/refinementoperators/RefinementOperator.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/refinementoperators/RefinementOperator.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -19,7 +19,6 @@ package org.dllearner.refinementoperators; -import java.util.List; import java.util.Set; import org.dllearner.core.Component; Modified: trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown2008.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown2008.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown2008.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -27,11 +27,11 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; -import java.util.Map.Entry; import org.apache.log4j.Logger; import org.dllearner.core.AbstractReasonerComponent; Modified: trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDown.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDown.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDown.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -33,18 +33,18 @@ import org.dllearner.core.ComponentInitException; import org.dllearner.core.owl.BooleanValueRestriction; import org.dllearner.core.owl.DatatypeProperty; -import org.dllearner.core.owl.ObjectAllRestriction; -import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.Nothing; import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.Intersection; -import org.dllearner.core.owl.Union; +import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Negation; +import org.dllearner.core.owl.Nothing; +import org.dllearner.core.owl.ObjectAllRestriction; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectPropertyExpression; import org.dllearner.core.owl.ObjectQuantorRestriction; +import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.Thing; +import org.dllearner.core.owl.Union; import org.dllearner.core.owl.ValueRestriction; import org.dllearner.utilities.owl.ConceptComparator; import org.dllearner.utilities.owl.ConceptTransformation; Modified: trunk/components-core/src/main/java/org/dllearner/utilities/FuzzyOwl2.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/FuzzyOwl2.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/utilities/FuzzyOwl2.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -2,7 +2,6 @@ import java.io.File; import java.io.FileOutputStream; -import java.io.OutputStream; import java.io.PrintStream; import java.util.ArrayList; import java.util.HashSet; Modified: trunk/components-core/src/main/java/org/dllearner/utilities/FuzzyOwl2toFuzzyDL.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/FuzzyOwl2toFuzzyDL.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/utilities/FuzzyOwl2toFuzzyDL.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -1,14 +1,53 @@ package org.dllearner.utilities; -import java.util.*; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import org.semanticweb.owlapi.model.ClassExpressionType; +import org.semanticweb.owlapi.model.DataRangeType; +import org.semanticweb.owlapi.model.OWLClass; +import org.semanticweb.owlapi.model.OWLClassExpression; +import org.semanticweb.owlapi.model.OWLDataIntersectionOf; +import org.semanticweb.owlapi.model.OWLDataOneOf; +import org.semanticweb.owlapi.model.OWLDataProperty; +import org.semanticweb.owlapi.model.OWLDataPropertyExpression; +import org.semanticweb.owlapi.model.OWLDataRange; +import org.semanticweb.owlapi.model.OWLDatatype; +import org.semanticweb.owlapi.model.OWLDatatypeRestriction; +import org.semanticweb.owlapi.model.OWLEntity; +import org.semanticweb.owlapi.model.OWLFacetRestriction; +import org.semanticweb.owlapi.model.OWLIndividual; +import org.semanticweb.owlapi.model.OWLLiteral; +import org.semanticweb.owlapi.model.OWLObjectProperty; +import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; +import org.semanticweb.owlapi.vocab.OWLFacet; + import fuzzydl.Concept; -import fuzzyowl2.*; +import fuzzyowl2.ChoquetConcept; +import fuzzyowl2.FuzzyLogic; +import fuzzyowl2.FuzzyNominalConcept; +import fuzzyowl2.LeftShoulderFunction; +import fuzzyowl2.LinearFunction; +import fuzzyowl2.LinearModifier; +import fuzzyowl2.ModifiedConcept; +import fuzzyowl2.ModifiedFunction; +import fuzzyowl2.ModifiedProperty; +import fuzzyowl2.OwaConcept; +import fuzzyowl2.QowaConcept; +import fuzzyowl2.QuasiSugenoConcept; +import fuzzyowl2.RightShoulderFunction; +import fuzzyowl2.SugenoConcept; +import fuzzyowl2.TrapezoidalFunction; +import fuzzyowl2.TriangularFunction; +import fuzzyowl2.TriangularModifier; +import fuzzyowl2.WeightedConcept; +import fuzzyowl2.WeightedMaxConcept; +import fuzzyowl2.WeightedMinConcept; +import fuzzyowl2.WeightedSumConcept; -import org.semanticweb.owlapi.model.*; -import org.semanticweb.owlapi.vocab.*; - /** * Class translating from OWL 2 into fuzzyDL syntax. * Modified: trunk/components-core/src/main/java/org/dllearner/utilities/Helper.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/Helper.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/utilities/Helper.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -24,22 +24,22 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; -import java.util.Map.Entry; import org.apache.log4j.Logger; +import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ReasoningMethodUnsupportedException; -import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.owl.AssertionalAxiom; -import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.ClassAssertionAxiom; import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.ClassAssertionAxiom; import org.dllearner.core.owl.FlatABox; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.KB; +import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Negation; import org.dllearner.core.owl.ObjectCardinalityRestriction; import org.dllearner.core.owl.ObjectProperty; Modified: trunk/components-core/src/main/java/org/dllearner/utilities/components/ComponentCombo.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/components/ComponentCombo.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/utilities/components/ComponentCombo.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -24,13 +24,13 @@ import java.util.Set; import org.dllearner.algorithms.ocel.OCEL; +import org.dllearner.core.AbstractCELA; +import org.dllearner.core.AbstractKnowledgeSource; +import org.dllearner.core.AbstractLearningProblem; +import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; -import org.dllearner.core.AbstractKnowledgeSource; -import org.dllearner.core.AbstractCELA; -import org.dllearner.core.AbstractLearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; -import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.kb.OWLFile; import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.reasoning.FastInstanceChecker; Modified: trunk/components-core/src/main/java/org/dllearner/utilities/components/ReasonerComponentFactory.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/components/ReasonerComponentFactory.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/utilities/components/ReasonerComponentFactory.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -23,9 +23,9 @@ import java.net.MalformedURLException; import java.net.URL; +import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; -import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.kb.OWLFile; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.OWLAPIReasoner; Modified: trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/Datastructures.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/Datastructures.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/Datastructures.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -25,8 +25,8 @@ import java.util.Set; import java.util.TreeSet; +import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.ObjectProperty; /** Modified: trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/DescriptionSubsumptionTree.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/DescriptionSubsumptionTree.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/DescriptionSubsumptionTree.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -28,8 +28,8 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; +import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.EvaluatedDescription; -import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.owl.Description; import org.dllearner.learningproblems.EvaluatedDescriptionPosNeg; Modified: trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/MapToStringTupleListConverter.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/MapToStringTupleListConverter.java 2014-02-21 12:13:47 UTC (rev 4239) +++ trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/MapToStringTupleListConverter.java 2014-02-25 11:30:53 UTC (rev 4240) @@ -1,13 +1,12 @@ package org.dllearner.utilities.datastructures; -import org.dllearner.utilities.datastructures.StringTuple; -import org.springframework.core.convert.converter.Converter; - import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; +import org.springframework.core.convert.converter.Converter; + /** * Created by IntelliJ IDEA. * User: Chris Modified: trunk/components-core/src/main/java/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java ========... [truncated message content] |
From: <lor...@us...> - 2014-02-21 12:13:51
|
Revision: 4239 http://sourceforge.net/p/dl-learner/code/4239 Author: lorenz_b Date: 2014-02-21 12:13:47 +0000 (Fri, 21 Feb 2014) Log Message: ----------- Fixed another problem in DBpedia ontology. Modified Paths: -------------- trunk/components-core/src/test/resources/org/dllearner/algorithms/isle/dbpedia_3.9.owl Modified: trunk/components-core/src/test/resources/org/dllearner/algorithms/isle/dbpedia_3.9.owl =================================================================== --- trunk/components-core/src/test/resources/org/dllearner/algorithms/isle/dbpedia_3.9.owl 2014-02-20 14:56:46 UTC (rev 4238) +++ trunk/components-core/src/test/resources/org/dllearner/algorithms/isle/dbpedia_3.9.owl 2014-02-21 12:13:47 UTC (rev 4239) @@ -15,7 +15,9 @@ xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <owl:Ontology rdf:about="http://dbpedia.org/ontology/"/> + <owl:Ontology rdf:about="http://dbpedia.org/ontology/"> + <owl:versionInfo xml:lang="en">Version 3.8</owl:versionInfo> + </owl:Ontology> @@ -24464,7 +24466,6 @@ <rdfs:label xml:lang="fr">année</rdfs:label> <rdfs:label xml:lang="it">anno</rdfs:label> <rdfs:label xml:lang="nl">jaar</rdfs:label> - <rdfs:domain rdf:resource="http://dbpedia.org/ontology/Sales"/> <rdfs:range rdf:resource="&xsd;gYear"/> </owl:DatatypeProperty> @@ -33378,20 +33379,6 @@ <!-- http://xmlns.com/foaf/0.1/Person --> <owl:Class rdf:about="http://xmlns.com/foaf/0.1/Person"/> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Annotations - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - <rdf:Description rdf:about="http://dbpedia.org/ontology/"> - <owl:versionInfo xml:lang="en">Version 3.8</owl:versionInfo> - </rdf:Description> </rdf:RDF> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2014-02-20 14:56:49
|
Revision: 4238 http://sourceforge.net/p/dl-learner/code/4238 Author: lorenz_b Date: 2014-02-20 14:56:46 +0000 (Thu, 20 Feb 2014) Log Message: ----------- Fixed bug in QTL. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/NBR.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/PostLGG.java trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/NBR.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/NBR.java 2014-02-20 14:08:02 UTC (rev 4237) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/NBR.java 2014-02-20 14:56:46 UTC (rev 4238) @@ -282,7 +282,13 @@ determiningNodeIds = getDeterminingNodeIds(lgg, negTrees); logger.debug("Computing next question..."); postLGG = getFilteredTree(lgg); - PostLGG<N> postGen = new PostLGG<N>((SPARQLEndpointEx) endpoint); + PostLGG<N> postGen; + if(endpoint != null){ + postGen = new PostLGG<N>((SPARQLEndpointEx) endpoint); + } else { + postGen = new PostLGG<N>(); + } + postGen.simplifyTree(postLGG, negTrees); if(logger.isDebugEnabled()){ String treeString; @@ -418,7 +424,7 @@ private SortedSet<String> getAllResources(String query){ SortedSet<String> resources = new TreeSet<String>(); - query = "SELECT DISTINCT " + query.substring(7) + " LIMIT 1000"; + query = query + " LIMIT 1000"; ResultSet rs; if(selectCache == null){ Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/PostLGG.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/PostLGG.java 2014-02-20 14:08:02 UTC (rev 4237) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/PostLGG.java 2014-02-20 14:56:46 UTC (rev 4238) @@ -36,14 +36,24 @@ this.endpoint = endpoint; } + public PostLGG(){ + + } + public void simplifyTree(QueryTree<N> tree, List<QueryTree<N>> negTrees){ if(tree.getChildren().isEmpty()){ return; } - System.out.println(tree.getStringRepresentation()); + if(logger.isDebugEnabled()){ + String s; + if(endpoint != null){ + s = TreeHelper.getAbbreviatedTreeRepresentation(tree, endpoint.getBaseURI(), endpoint.getPrefixes()); + } else { + s= tree.getStringRepresentation(); + } logger.debug("Making post LGG simplification"); - logger.debug("LGG:\n" + TreeHelper.getAbbreviatedTreeRepresentation(tree, endpoint.getBaseURI(), endpoint.getPrefixes())); + logger.debug("LGG:\n" + s); int i = 1; // for(QueryTree<N> negTree : negTrees){ // logger.debug("Neg tree (" + i++ + "/" + negTrees.size() +"):\n" + TreeHelper.getAbbreviatedTreeRepresentation(negTree, endpoint.getBaseURI(), endpoint.getPrefixes())); Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java 2014-02-20 14:08:02 UTC (rev 4237) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorImpl.java 2014-02-20 14:56:46 UTC (rev 4238) @@ -101,13 +101,14 @@ } Monitor mon = MonitorFactory.getTimeMonitor("LGG"); mon.start(); - QueryTree<N> lgg = getLGG(treeList.get(0), treeList.get(1), learnFilters); + QueryTree<N> lgg = computeLGG(treeList.get(0), treeList.get(1), learnFilters); if(logger.isDebugEnabled()){ logger.debug("LGG for 1 and 2:\n" + lgg.getStringRepresentation()); } for(int i = 2; i < treeList.size(); i++){ - lgg = getLGG(lgg, treeList.get(i), learnFilters); + nodeId = 0; + lgg = computeLGG(lgg, treeList.get(i), learnFilters); if(logger.isDebugEnabled()){ logger.debug("LGG for 1-" + (i+1) + ":\n" + lgg.getStringRepresentation()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2014-02-20 14:08:08
|
Revision: 4237 http://sourceforge.net/p/dl-learner/code/4237 Author: lorenz_b Date: 2014-02-20 14:08:02 +0000 (Thu, 20 Feb 2014) Log Message: ----------- Fixed another problem in DBpedia ontology. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/PostLGG.java trunk/components-core/src/test/resources/org/dllearner/algorithms/isle/dbpedia_3.9.owl Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/PostLGG.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/PostLGG.java 2014-02-20 13:07:43 UTC (rev 4236) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/qtl/operations/PostLGG.java 2014-02-20 14:08:02 UTC (rev 4237) @@ -40,6 +40,7 @@ if(tree.getChildren().isEmpty()){ return; } + System.out.println(tree.getStringRepresentation()); if(logger.isDebugEnabled()){ logger.debug("Making post LGG simplification"); logger.debug("LGG:\n" + TreeHelper.getAbbreviatedTreeRepresentation(tree, endpoint.getBaseURI(), endpoint.getPrefixes())); Modified: trunk/components-core/src/test/resources/org/dllearner/algorithms/isle/dbpedia_3.9.owl =================================================================== --- trunk/components-core/src/test/resources/org/dllearner/algorithms/isle/dbpedia_3.9.owl 2014-02-20 13:07:43 UTC (rev 4236) +++ trunk/components-core/src/test/resources/org/dllearner/algorithms/isle/dbpedia_3.9.owl 2014-02-20 14:08:02 UTC (rev 4237) @@ -5247,8 +5247,6 @@ <rdfs:label xml:lang="en">influenced by</rdfs:label> <rdfs:label xml:lang="fr">influencé par</rdfs:label> <rdfs:label xml:lang="nl">beïnvloed door</rdfs:label> - <rdfs:range rdf:resource="http://dbpedia.org/ontology/Person"/> - <rdfs:domain rdf:resource="http://dbpedia.org/ontology/Person"/> </owl:ObjectProperty> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2014-02-20 13:07:46
|
Revision: 4236 http://sourceforge.net/p/dl-learner/code/4236 Author: lorenz_b Date: 2014-02-20 13:07:43 +0000 (Thu, 20 Feb 2014) Log Message: ----------- Fixed another problem in DBpedia ontology. Modified Paths: -------------- trunk/components-core/src/test/resources/org/dllearner/algorithms/isle/dbpedia_3.9.owl Modified: trunk/components-core/src/test/resources/org/dllearner/algorithms/isle/dbpedia_3.9.owl =================================================================== --- trunk/components-core/src/test/resources/org/dllearner/algorithms/isle/dbpedia_3.9.owl 2014-02-20 13:04:20 UTC (rev 4235) +++ trunk/components-core/src/test/resources/org/dllearner/algorithms/isle/dbpedia_3.9.owl 2014-02-20 13:07:43 UTC (rev 4236) @@ -2697,7 +2697,6 @@ <rdfs:label xml:lang="nl">club</rdfs:label> <rdfs:domain rdf:resource="http://dbpedia.org/ontology/Athlete"/> <rdfs:range rdf:resource="http://dbpedia.org/ontology/SportsTeam"/> - <owl:equivalentProperty rdf:resource="http://dbpedia.org/ontology/team"/> </owl:ObjectProperty> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |