Skip to content

Commit

Permalink
Merge branch 'release/1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickwestphal committed Jul 21, 2015
2 parents 6fa6b02 + 4cc0284 commit 1b980c4
Show file tree
Hide file tree
Showing 538 changed files with 38,659 additions and 19,148 deletions.
192 changes: 126 additions & 66 deletions components-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,113 @@
<parent>
<groupId>org.dllearner</groupId>
<artifactId>dllearner-parent</artifactId>
<version>1.0</version>
<version>1.1</version>
</parent>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<!--Surefire - for JUnits -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Uncomment this when the junits are independent of a runtime directory -->
<!--<includes> -->
<!--<include>org/dllearner/test/junit/*</include> -->
<!--</includes> -->
<excludes>
<exclude>org/dllearner/test/*</exclude>
<exclude>org/dllearner/test/junit/TestOntologies.java</exclude>
<exclude>org/dllearner/test/junit/PropertyLearningTest.java</exclude>
<exclude>org/dllearner/test/junit/DisjointClassesLearningTest.java</exclude>
<!--This line excludes inner classes -->
<exclude>**/*$*</exclude>
</excludes>
</configuration>
</plugin>
<!-- Jar the tests up into a separate jar so other components tests'
can leverage them -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- <plugin> -->
<!-- <groupId>com.mycila</groupId> -->
<!-- <artifactId>license-maven-plugin</artifactId> -->
<!-- <configuration> -->
<!-- <header>src/etc/header.txt</header> -->
<!-- </configuration> -->
<!-- </plugin> -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>1.8</version>
<configuration>
<licenseName>gpl_v3</licenseName>
<organizationName>AKSW</organizationName>
<inceptionYear>2007</inceptionYear>
<roots>
<root>src/main/java</root>
<root>src/test/java</root>
</roots>
<addSvnKeyWords>true</addSvnKeyWords>
</configuration>
<executions>
<execution>
<id>download-licenses</id>
<goals>
<goal>download-licenses</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<header></header>
<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>${compiler.version}</source>
<sourcepath>src/main/java</sourcepath>
<splitindex>true</splitindex>
<stylesheetfile>src/etc/javadoc2.css</stylesheetfile>
<use>true</use>
<version>true</version>
<linksource>true</linksource>
<bottom>&lt;img style='float:right'
src='https://raw.githubusercontent.com/github/media/master/octocats/blacktocat-16.png'
border='0' alt='Github.com Logo' /&gt; DL-Learner is licenced
under the terms of the GNU General Public License.&lt;br
/&gt;Copyright &amp;#169; 2007-2015 Jens Lehmann</bottom>
<encoding>ISO-8859-1</encoding>
<windowtitle>DL-Learner Javadoc</windowtitle>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
Expand Down Expand Up @@ -47,67 +152,6 @@
</execution>
</executions>
</plugin>
<!-- <plugin> -->
<!-- <groupId>com.mycila</groupId> -->
<!-- <artifactId>license-maven-plugin</artifactId> -->
<!-- <configuration> -->
<!-- <header>src/etc/header.txt</header> -->
<!-- </configuration> -->
<!-- </plugin> -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>1.8</version>
<configuration>
<licenseName>gpl_v3</licenseName>
<organizationName>AKSW</organizationName>
<inceptionYear>2007</inceptionYear>
<roots>
<root>src/main/java</root>
<root>src/test/java</root>
</roots>
<addSvnKeyWords>true</addSvnKeyWords>
</configuration>
<executions>
<execution>
<id>download-licenses</id>
<goals>
<goal>download-licenses</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<header></header>
<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>${compiler.version}</source>
<sourcepath>src/main/java</sourcepath>
<splitindex>true</splitindex>
<stylesheetfile>src/etc/javadoc2.css</stylesheetfile>
<use>true</use>
<version>true</version>
<linksource>true</linksource>
<bottom>&lt;img style='float:right' src='https://raw.githubusercontent.com/github/media/master/octocats/blacktocat-16.png' border='0' alt='Github.com Logo' /&gt; DL-Learner is licenced under the terms of the GNU General Public License.&lt;br /&gt;Copyright &amp;#169; 2007-2015 Jens Lehmann</bottom>
<encoding>ISO-8859-1</encoding>
<windowtitle>DL-Learner Javadoc</windowtitle>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>


</plugins>
</build>

Expand All @@ -116,12 +160,12 @@
<groupId>org.ini4j</groupId>
<artifactId>ini4j</artifactId>
</dependency>
<!--

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
-->

<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-distribution</artifactId>
Expand Down Expand Up @@ -152,10 +196,10 @@
</dependency>
-->

<dependency>
<!-- <dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-arq</artifactId>
</dependency>
</dependency> -->
<!--
<dependency>
<groupId>org.apache.jena</groupId>
Expand Down Expand Up @@ -318,6 +362,12 @@
<dependency>
<groupId>org.aksw.jena-sparql-api</groupId>
<artifactId>jena-sparql-api-core</artifactId>
<exclusions>
<exclusion>
<artifactId>slf4j-ext</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.aksw.jena-sparql-api</groupId>
Expand Down Expand Up @@ -352,5 +402,15 @@
<artifactId>weka-stable</artifactId>
<version>3.6.9</version>
</dependency> -->
<dependency>
<groupId>org.aksw</groupId>
<artifactId>semlibsvm</artifactId>
</dependency>

<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.9-RC1</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
import org.aksw.jena_sparql_api.pagination.core.QueryExecutionFactoryPaginated;
import org.dllearner.algorithms.celoe.CELOE;
import org.dllearner.core.AbstractAxiomLearningAlgorithm;
import org.dllearner.core.AbstractLearningProblem;
import org.dllearner.core.AbstractClassExpressionLearningProblem;
import org.dllearner.core.AbstractReasonerComponent;
import org.dllearner.core.ComponentInitException;
import org.dllearner.kb.OWLAPIOntology;
import org.dllearner.kb.SparqlEndpointKS;
import org.dllearner.kb.sparql.SparqlEndpoint;
import org.dllearner.learningproblems.PosNegLPStandard;
import org.dllearner.reasoning.FastInstanceChecker;
import org.dllearner.reasoning.ClosedWorldReasoner;
import org.dllearner.utilities.OwlApiJenaUtils;
import org.dllearner.utilities.owl.OWLEntityTypeAdder;
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat;
Expand Down Expand Up @@ -110,10 +110,10 @@ protected void learnAxioms() {
e1.printStackTrace();
}
try {
AbstractReasonerComponent rc = new FastInstanceChecker(new OWLAPIOntology(fragment));
AbstractReasonerComponent rc = new ClosedWorldReasoner(new OWLAPIOntology(fragment));
rc.init();

AbstractLearningProblem lp = new PosNegLPStandard(rc, posExamples, negExamples);
AbstractClassExpressionLearningProblem lp = new PosNegLPStandard(rc, posExamples, negExamples);
lp.init();

CELOE la = new CELOE(lp, rc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.dllearner.core.ComponentAnn;
import org.dllearner.core.EvaluatedAxiom;
import org.dllearner.core.EvaluatedDescription;
import org.dllearner.core.Score;
import org.dllearner.core.owl.ClassHierarchy;
import org.dllearner.kb.LocalModelBasedSparqlEndpointKS;
import org.dllearner.kb.SparqlEndpointKS;
Expand Down Expand Up @@ -83,7 +84,7 @@ public class DisjointClassesLearner extends AbstractAxiomLearningAlgorithm<OWLDi
private static final ParameterizedSparqlString SAMPLE_QUERY = new ParameterizedSparqlString(
"CONSTRUCT{?s a ?entity . ?s a ?cls1 .} WHERE {?s a ?entity . OPTIONAL {?s a ?cls1 .}");

private List<EvaluatedDescription> currentlyBestEvaluatedDescriptions;
private List<EvaluatedDescription<? extends Score>> currentlyBestEvaluatedDescriptions;
private SortedSet<OWLClassExpression> subClasses;

private boolean useWordNetDistance = false;
Expand Down Expand Up @@ -408,14 +409,14 @@ private void runSPARQL1_1_Mode() {
@Override
public List<OWLClassExpression> getCurrentlyBestDescriptions(int nrOfDescriptions) {
List<OWLClassExpression> bestDescriptions = new ArrayList<OWLClassExpression>();
for (EvaluatedDescription evDesc : getCurrentlyBestEvaluatedDescriptions(nrOfDescriptions)) {
for (EvaluatedDescription<? extends Score> evDesc : getCurrentlyBestEvaluatedDescriptions(nrOfDescriptions)) {
bestDescriptions.add(evDesc.getDescription());
}
return bestDescriptions;
}

@Override
public List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions) {
public List<? extends EvaluatedDescription<? extends Score>> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions) {
int max = Math.min(currentlyBestEvaluatedDescriptions.size(), nrOfDescriptions);
return currentlyBestEvaluatedDescriptions.subList(0, max);
}
Expand All @@ -440,7 +441,7 @@ public List<EvaluatedAxiom<OWLDisjointClassesAxiom>> getCurrentlyBestEvaluatedAx
public List<EvaluatedAxiom<OWLDisjointClassesAxiom>> getCurrentlyBestEvaluatedAxioms(int nrOfAxioms) {
List<EvaluatedAxiom<OWLDisjointClassesAxiom>> axioms = new ArrayList<EvaluatedAxiom<OWLDisjointClassesAxiom>>();
Set<OWLClassExpression> descriptions;
for (EvaluatedDescription ed : getCurrentlyBestEvaluatedDescriptions(nrOfAxioms)) {
for (EvaluatedDescription<? extends Score> ed : getCurrentlyBestEvaluatedDescriptions(nrOfAxioms)) {
descriptions = new TreeSet<OWLClassExpression>();
descriptions.add(entityToDescribe);
descriptions.add(ed.getDescription());
Expand All @@ -450,9 +451,9 @@ public List<EvaluatedAxiom<OWLDisjointClassesAxiom>> getCurrentlyBestEvaluatedAx
return axioms;
}

private List<EvaluatedDescription> buildEvaluatedClassDescriptions(Map<OWLClass, Integer> class2Count,
private List<EvaluatedDescription<? extends Score>> buildEvaluatedClassDescriptions(Map<OWLClass, Integer> class2Count,
Set<OWLClass> allClasses, int total) {
List<EvaluatedDescription> evalDescs = new ArrayList<EvaluatedDescription>();
List<EvaluatedDescription<? extends Score>> evalDescs = new ArrayList<>();

//Remove temporarily entityToDescribe but keep track of their count
// Integer all = class2Count.get(entityToDescribe);
Expand All @@ -473,7 +474,7 @@ private List<EvaluatedDescription> buildEvaluatedClassDescriptions(Map<OWLClass,
keepMostGeneralClasses(completeDisjointclasses);
}

EvaluatedDescription evalDesc;
EvaluatedDescription<? extends Score> evalDesc;
//firstly, create disjoint classexpressions which do not occur and give score of 1
for (OWLClass cls : completeDisjointclasses) {
if (useClassPopularity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.Map;

import org.dllearner.core.AbstractCELA;
import org.dllearner.core.AbstractLearningProblem;
import org.dllearner.core.AbstractClassExpressionLearningProblem;
import org.dllearner.core.AbstractReasonerComponent;
import org.dllearner.core.ComponentAnn;
import org.dllearner.core.ComponentInitException;
Expand Down Expand Up @@ -36,7 +36,7 @@ public class NaiveALLearner extends AbstractCELA{
public NaiveALLearner() {
}

public NaiveALLearner(AbstractLearningProblem lp, AbstractReasonerComponent reasoner) {
public NaiveALLearner(AbstractClassExpressionLearningProblem lp, AbstractReasonerComponent reasoner) {
super(lp, reasoner);
}
@Override
Expand Down
Loading

0 comments on commit 1b980c4

Please sign in to comment.