Skip to content

Commit 03ec70e

Browse files
Merge remote-tracking branch 'fork/develop' into develop
# Conflicts: # interfaces-ext/pom.xml # interfaces/pom.xml
2 parents fe08512 + 422857b commit 03ec70e

28 files changed

Lines changed: 286 additions & 102 deletions

components-core/pom.xml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
<plugin>
221221
<groupId>org.jacoco</groupId>
222222
<artifactId>jacoco-maven-plugin</artifactId>
223-
<version>0.7.6.201602180812</version>
223+
<version>0.8.4</version>
224224
<executions>
225225
<execution>
226226
<goals>
@@ -303,12 +303,12 @@
303303
<dependency>
304304
<groupId>javax.json</groupId>
305305
<artifactId>javax.json-api</artifactId>
306-
<version>1.1.2</version>
306+
<version>1.1.4</version>
307307
</dependency>
308308
<dependency>
309309
<groupId>org.glassfish</groupId>
310310
<artifactId>javax.json</artifactId>
311-
<version>1.1.2</version>
311+
<version>1.1.4</version>
312312
</dependency>
313313

314314
<!--
@@ -577,7 +577,18 @@
577577
<artifactId>commons-collections4</artifactId>
578578
</dependency>
579579

580-
580+
<dependency>
581+
<groupId>javax.annotation</groupId>
582+
<artifactId>javax.annotation-api</artifactId>
583+
</dependency>
584+
<dependency>
585+
<groupId>javax.xml.bind</groupId>
586+
<artifactId>jaxb-api</artifactId>
587+
</dependency>
588+
<dependency>
589+
<groupId>javax.xml.ws</groupId>
590+
<artifactId>jaxws-api</artifactId>
591+
</dependency>
581592

582593
<dependency>
583594
<groupId>org.apache.logging.log4j</groupId>

components-core/src/main/java/org/dllearner/algorithms/CELOEWrapper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package org.dllearner.algorithms;
2020

21+
import com.google.common.base.StandardSystemProperty;
2122
import com.google.common.collect.Sets;
2223
import org.apache.jena.query.ParameterizedSparqlString;
2324
import org.apache.jena.query.QueryExecution;
@@ -41,6 +42,7 @@
4142
import org.semanticweb.owlapi.model.*;
4243
import uk.ac.manchester.cs.owl.owlapi.OWLClassImpl;
4344

45+
import java.io.File;
4446
import java.io.FileNotFoundException;
4547
import java.io.FileOutputStream;
4648
import java.util.Set;
@@ -113,7 +115,7 @@ protected void learnAxioms() {
113115

114116
OWLOntology fragment = buildFragment(posExamples, negExamples);
115117
try {
116-
fragment.getOWLOntologyManager().saveOntology(fragment, new RDFXMLDocumentFormat(), new FileOutputStream("/tmp/ont.owl"));
118+
fragment.getOWLOntologyManager().saveOntology(fragment, new RDFXMLDocumentFormat(), new FileOutputStream(System.getProperty("java.io.tmpdir") + File.separator + "ont.owl"));
117119
} catch (OWLOntologyStorageException | FileNotFoundException e1) {
118120
// TODO Auto-generated catch block
119121
e1.printStackTrace();

components-core/src/main/java/org/dllearner/algorithms/qtl/operations/lgg/LGGGeneratorRDFS.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package org.dllearner.algorithms.qtl.operations.lgg;
2020

21+
import com.google.common.base.StandardSystemProperty;
2122
import com.google.common.collect.Lists;
2223
import com.google.common.collect.Sets;
2324
import org.aksw.jena_sparql_api.cache.h2.CacheUtilsH2;
@@ -49,6 +50,7 @@
4950
import org.dllearner.utilities.NonStandardReasoningServices;
5051
import org.semanticweb.owlapi.model.EntityType;
5152

53+
import java.io.File;
5254
import java.util.*;
5355
import java.util.concurrent.TimeUnit;
5456
import java.util.function.Predicate;
@@ -214,7 +216,7 @@ public static void main(String[] args) throws Exception {
214216
endpoint = SparqlEndpoint.create("http://sake.informatik.uni-leipzig.de:8890/sparql", "http://dbpedia.org");
215217
QueryExecutionFactory qef = FluentQueryExecutionFactory
216218
.http(endpoint.getURL().toString(), endpoint.getDefaultGraphURIs()).config()
217-
.withCache(CacheUtilsH2.createCacheFrontend("/tmp/cache", false, TimeUnit.DAYS.toMillis(60)))
219+
.withCache(CacheUtilsH2.createCacheFrontend(System.getProperty("java.io.tmpdir") + File.separator + "cache", false, TimeUnit.DAYS.toMillis(60)))
218220
.withPagination(10000).withDelay(50, TimeUnit.MILLISECONDS).end().create();
219221

220222
// tree generation

components-core/src/main/java/org/dllearner/algorithms/qtl/operations/tuples/QTLTuples.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.stream.Collectors;
99
import java.util.stream.Stream;
1010

11+
import com.google.common.base.StandardSystemProperty;
1112
import com.google.common.collect.Lists;
1213
import com.google.common.collect.Maps;
1314
import com.google.common.collect.Sets;
@@ -308,7 +309,7 @@ private Map<String, Map.Entry<RDFResourceTree, List<Node>>> connect(List<Node> t
308309
});
309310
});
310311
log.debug("connected tree\n{}", tree::getStringRepresentation);
311-
QueryTreeUtils.asGraph(tree, baseIRI, pm, new File("/tmp/tree-" + FmtUtils.stringForNode(node, pm) + ".graphml"));
312+
QueryTreeUtils.asGraph(tree, baseIRI, pm, new File(System.getProperty("java.io.tmpdir") + File.separator + "tree-" + FmtUtils.stringForNode(node, pm) + ".graphml"));
312313
result.put(key, Maps.immutableEntry(tree, new ArrayList<>(nodes2Project)));
313314
};
314315

@@ -729,7 +730,7 @@ public static void main(String[] args) throws Exception {
729730

730731
Graph<Vertex, Edge> g = QueryTreeUtils.toGraph(tree, baseIRI, pm);
731732

732-
QueryTreeUtils.asGraph(tree, baseIRI, pm, new File("/tmp/lgg.graphml"));
733+
QueryTreeUtils.asGraph(tree, baseIRI, pm, new File(System.getProperty("java.io.tmpdir") + File.separator + "lgg.graphml"));
733734

734735
});
735736

components-core/src/main/java/org/dllearner/kb/repository/bioportal/BioPortalRepository.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.dllearner.kb.repository.bioportal;
2020

2121
import com.google.common.base.Charsets;
22+
import com.google.common.base.StandardSystemProperty;
2223
import joptsimple.OptionParser;
2324
import joptsimple.OptionSet;
2425
import joptsimple.OptionSpec;
@@ -186,7 +187,7 @@ public static void main(String[] args) throws Exception{
186187
// create Options object
187188
OptionParser parser = new OptionParser();
188189
OptionSpec<File> baseDir =
189-
parser.accepts( "basedir" ).withRequiredArg().ofType( File.class ).defaultsTo(new File("/tmp/bioportal/"));
190+
parser.accepts( "basedir" ).withRequiredArg().ofType( File.class ).defaultsTo(new File(System.getProperty("java.io.tmpdir") + File.separator + "bioportal" + File.separator));
190191
OptionSpec<Void> downloadOption =
191192
parser.accepts( "download" );
192193
OptionSpec<Void> parseOption =

components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.clarkparsia.owlapi.explanation.PelletExplanation;
2222
import com.clarkparsia.owlapiv3.XSD;
2323
import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory;
24+
import com.google.common.base.StandardSystemProperty;
2425
import org.apache.log4j.Level;
2526
import org.apache.log4j.Logger;
2627
import org.dllearner.core.*;
@@ -1258,7 +1259,7 @@ public void setSynchronized() {
12581259
}
12591260

12601261
public static void main(String[] args) throws Exception{
1261-
OWLOntology o = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(new File("/tmp/test2.rdf"));
1262+
OWLOntology o = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(new File(System.getProperty("java.io.tmpdir") + File.separator + "test2.rdf"));
12621263
System.out.println(o.getClassesInSignature());
12631264
System.out.println(o.getDataPropertiesInSignature());
12641265
System.out.println(o.getIndividualsInSignature().size());

components-core/src/main/java/org/dllearner/reasoning/StructuralReasonerExtended.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package org.dllearner.reasoning;
2020

21+
import com.google.common.base.StandardSystemProperty;
2122
import org.dllearner.kb.OWLAPIOntology;
2223
import org.dllearner.kb.OWLOntologyKnowledgeSource;
2324
import org.joda.time.Period;
@@ -33,6 +34,7 @@
3334
import org.semanticweb.owlapi.util.Version;
3435

3536
import javax.annotation.Nonnull;
37+
import java.io.File;
3638
import java.util.*;
3739
import java.util.stream.Stream;
3840

@@ -1446,7 +1448,7 @@ public Collection<OWLDataProperty> getChildren(OWLDataProperty parent) {
14461448
public static void main(String[] args) throws Exception {
14471449
OWLOntologyManager man = OWLManager.createOWLOntologyManager();
14481450
OWLOntology schema = //man.loadOntology(IRI.create("http://downloads.dbpedia.org/2016-10/dbpedia_2016-10.nt"));
1449-
man.loadOntology(IRI.create("file:///tmp/merged.ttl"));
1451+
man.loadOntology(IRI.create("file://" + System.getProperty("java.io.tmpdir") + "/merged.ttl"));
14501452

14511453
OWLOntologyKnowledgeSource sampleKS = new OWLAPIOntology(schema);
14521454
sampleKS.init();

components-core/src/main/java/org/dllearner/utilities/TreeUtils.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
*/
1919
package org.dllearner.utilities;
2020

21+
import org.dllearner.algorithms.ocel.ExampleBasedNode;
2122
import org.dllearner.core.AbstractSearchTreeNode;
2223
import org.dllearner.core.Heuristic;
2324
import org.dllearner.utilities.datastructures.AbstractSearchTree;
2425

26+
import javax.annotation.Nonnull;
27+
2528
public class TreeUtils {
2629

2730
public static <T extends AbstractSearchTreeNode> String toTreeString(
@@ -49,7 +52,7 @@ private static <T extends AbstractSearchTreeNode> StringBuilder toTreeString(T n
4952
if(depth!=0)
5053
treeString.append("|--> ");
5154
treeString.append(node.toString())
52-
.append(heuristic != null ? ("[score: " + heuristic.getNodeScore(node) + "]") : "")
55+
.append(addNodeScore(node, heuristic))
5356
.append("\n");
5457
for (Object child :
5558
node.getChildren()) {
@@ -58,4 +61,21 @@ private static <T extends AbstractSearchTreeNode> StringBuilder toTreeString(T n
5861
return treeString;
5962
}
6063

64+
@Nonnull
65+
private static <T extends AbstractSearchTreeNode> String addNodeScore(T node, Heuristic<T> heuristic) {
66+
if (heuristic == null)
67+
return "";
68+
69+
if (node instanceof ExampleBasedNode) {
70+
if (!((ExampleBasedNode) node).isQualityEvaluated()) {
71+
return "";
72+
}
73+
if (((ExampleBasedNode) node).isTooWeak()) {
74+
return "[score:too weak]";
75+
}
76+
}
77+
78+
return "[score: " + heuristic.getNodeScore(node) + "]";
79+
}
80+
6181
}

components-core/src/test/java/org/dllearner/algorithms/qtl/QTLTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.dllearner.algorithms.qtl;
2020

2121
import com.google.common.base.Splitter;
22+
import com.google.common.base.StandardSystemProperty;
2223
import com.google.common.collect.Sets;
2324
import com.jamonapi.Monitor;
2425
import com.jamonapi.MonitorFactory;
@@ -218,7 +219,7 @@ public static void main(String[] args) throws Exception {
218219
System.out.println(filter.apply(bestSolution).getStringRepresentation());
219220
System.out.println(QueryTreeUtils.toSPARQLQueryString(filter.apply(bestSolution)));
220221

221-
QueryTreeUtils.asGraph(bestSolution, null, PrefixCCPrefixMapping.Full, new File("/tmp/tree.graphml"));
222+
QueryTreeUtils.asGraph(bestSolution, null, PrefixCCPrefixMapping.Full, new File(System.getProperty("java.io.tmpdir") + File.separator + "tree.graphml"));
222223
}
223224

224225
private static RDFResourceTree getQueryTree(String resource, CBDStructureTree cbdStructure,

components-core/src/test/java/org/dllearner/algorithms/qtl/experiments/LSQBenchmarkQueries.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.dllearner.algorithms.qtl.experiments;
22

3+
import com.google.common.base.StandardSystemProperty;
34
import com.google.common.collect.Lists;
45
import com.google.common.collect.Sets;
56
import com.google.common.io.FileWriteMode;
@@ -61,7 +62,7 @@ public static void main(String[] args) throws Exception{
6162
SparqlEndpoint endpoint = SparqlEndpoint.getEndpointDBpedia();
6263
endpoint = SparqlEndpoint.create("http://localhost:7200/repositories/dbpedia?infer=false", Collections.emptyList());
6364
SparqlEndpointKS ks = new SparqlEndpointKS(endpoint);
64-
ks.setCacheDir("/tmp/qtl/sparql-cache");
65+
ks.setCacheDir(System.getProperty("java.io.tmpdir") + File.separator + "qtl" + File.separator + "sparql-cache");
6566
ks.init();
6667

6768
QueryExecutionFactory qef = ks.getQueryExecutionFactory();
@@ -122,7 +123,7 @@ public boolean isMeaningless(Node predicate) {
122123

123124
List<Query> queries = getQueries();
124125

125-
File out = new File("/tmp/qtl.out");
126+
File out = new File(System.getProperty("java.io.tmpdir") + File.separator + "qtl.out");
126127

127128
queries.forEach(query -> {
128129
try {

0 commit comments

Comments
 (0)