Skip to content

Commit

Permalink
fixes, move packagename
Browse files Browse the repository at this point in the history
  • Loading branch information
TortugaAttack committed Apr 1, 2021
1 parent 596b074 commit 13c257f
Show file tree
Hide file tree
Showing 28 changed files with 136 additions and 92 deletions.
4 changes: 1 addition & 3 deletions exampleconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,4 @@ maxGenerateConcepts: 100
maxConceptLength: 8
maxDepth: 1
removeLiterals: true
namespace: http://dbpedia.org/ontology/
concepts:
- positive: Album and (artist some Agent)
namespace: http://dbpedia.org/ontology/
71 changes: 67 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
</developer>
</developers>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<log4j.version>2.13.3</log4j.version>
</properties>

Expand Down Expand Up @@ -101,7 +101,6 @@
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>org.semanticweb.hermit</artifactId>
<version>1.4.5.519</version>
<scope>test</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -144,7 +143,6 @@
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>org.semanticweb.hermit</artifactId>
<version>1.4.5.519</version>
<scope>compile</scope>
</dependency>
</dependencies>

Expand All @@ -161,4 +159,69 @@
<url>http://maven.aksw.org/archiva/repository/snapshots</url>
</repository>
</repositories>

<build>

<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<transformers>
<transformer implementation=
"org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.dice_group.lpbenchgen.Main</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
<encoding>UTF-8</encoding>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.dice_group.LPBenchGen;
package org.dice_group.lpbenchgen;


import com.fasterxml.jackson.core.JsonProcessingException;
import org.dice_group.LPBenchGen.lp.LPGenerator;
import org.apache.jena.query.ARQ;
import org.dice_group.lpbenchgen.lp.LPGenerator;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;

import java.io.IOException;
Expand All @@ -26,6 +26,8 @@ public static void main(String[] args) throws OWLOntologyCreationException, IOEx
printHelp();
}
else {
//somehow we need to do this manually otherwise the jar will not do it for weird reasons I do not understand.
ARQ.init();
String name="";
String config="";
if(args[0].equals("--name")){
Expand Down Expand Up @@ -54,14 +56,15 @@ public static void main(String[] args) throws OWLOntologyCreationException, IOEx
* Print help.
*/
public static void printHelp(){
String help =" obscene --config <CONFIG.YML> --name <BENCHMARK-NAME> \n" +
String help =" lpbenchgen --config <CONFIG.YML> --name <BENCHMARK-NAME> \n" +
"\n\twill create learning problems and an ontology " +
"\n\tbased upon a SPARQL endpoint and a base ontology" +
"\n\tfor each concept in <CONFIG.YML> a learning problem will be created" +
"\n\tand the corresponding Individuals will be added to the ontology" +
"\n\tfurther on a certain amount of random Individuals will be added as well which will be retrieved using the types" +
"\n\tstated in <CONFIG.YML>" +
"\n\n\tOutput at <BENCHMARK-NAME>-lp.json and <BENCHMARK-NAME>-ontology.owl";
System.out.println(help);
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.dice_group.LPBenchGen.cleaner;
package org.dice_group.lpbenchgen.cleaner;

import com.google.common.collect.Sets;
import org.apache.jena.query.*;
Expand All @@ -15,7 +15,6 @@
import java.io.FileOutputStream;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;

/**
* The type Ontology inconsistent finder.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package org.dice_group.LPBenchGen.cleaner;

import org.semanticweb.owlapi.model.OWLClass;
package org.dice_group.lpbenchgen.cleaner;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.dice_group.LPBenchGen.config;
package org.dice_group.lpbenchgen.config;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.dice_group.LPBenchGen.config;
package org.dice_group.lpbenchgen.config;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.semanticweb.owlapi.model.OWLClassExpression;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package org.dice_group.LPBenchGen.dl;
package org.dice_group.lpbenchgen.dl;

import com.google.common.collect.Lists;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.query.ResultSet;
import org.apache.jena.sparql.algebra.optimize.VariableUsageVisitor;
import org.apache.jena.sparql.core.Var;
import org.apache.jena.sparql.syntax.ElementWalker;
import org.dice_group.LPBenchGen.sparql.IndividualRetriever;
import org.dice_group.LPBenchGen.sparql.QueryTripleMappingVisitor;
import org.dice_group.LPBenchGen.sparql.VariableCollector;
import org.dice_group.LPBenchGen.sparql.visitors.QueryRemoveUselessTriplesVisitor;
import org.dice_group.lpbenchgen.sparql.IndividualRetriever;
import org.dice_group.lpbenchgen.sparql.QueryTripleMappingVisitor;
import org.dice_group.lpbenchgen.sparql.VariableCollector;
import org.dice_group.lpbenchgen.sparql.visitors.QueryRemoveUselessTriplesVisitor;
import org.semanticweb.owlapi.model.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.dice_group.LPBenchGen.dl;
package org.dice_group.lpbenchgen.dl;

import org.semanticweb.owlapi.dlsyntax.renderer.DLSyntaxObjectRenderer;
import org.semanticweb.owlapi.model.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.dice_group.LPBenchGen.dl;
package org.dice_group.lpbenchgen.dl;

import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
Expand All @@ -14,7 +14,6 @@
import org.apache.jena.query.Syntax;
import org.apache.jena.sparql.algebra.Algebra;
import org.apache.jena.sparql.algebra.Op;
import org.eclipse.rdf4j.model.vocabulary.XSD;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.dlsyntax.renderer.DLSyntaxObjectRenderer;
import org.semanticweb.owlapi.io.ToStringRenderer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.dice_group.LPBenchGen.dl;
package org.dice_group.lpbenchgen.dl;

import org.semanticweb.owlapi.model.*;
import uk.ac.manchester.cs.owl.owlapi.OWLObjectSomeValuesFromImpl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package org.dice_group.LPBenchGen.dl;
package org.dice_group.lpbenchgen.dl;


import com.google.common.collect.Lists;
import org.semanticweb.owlapi.model.*;
import uk.ac.manchester.cs.owl.owlapi.*;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Collection;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.dice_group.LPBenchGen.dl;
package org.dice_group.lpbenchgen.dl;

/**
* The type Owlsparql positive creator.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.dice_group.LPBenchGen.dl;
package org.dice_group.lpbenchgen.dl;

import java.util.Collection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package org.dice_group.LPBenchGen.dl;
package org.dice_group.lpbenchgen.dl;

import org.dice_group.LPBenchGen.dl.visitors.Pattern2ExprVisitor;
import org.dice_group.lpbenchgen.dl.visitors.Pattern2ExprVisitor;
import org.semanticweb.owlapi.model.OWLClassExpression;
import org.semanticweb.owlapi.model.OWLOntology;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Random;

/**
* The type Owlt box pattern positive creator.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package org.dice_group.LPBenchGen.dl;
package org.dice_group.lpbenchgen.dl;

import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.dice_group.LPBenchGen.sparql.IndividualRetriever;
import org.semanticweb.HermiT.Configuration;
import org.dice_group.lpbenchgen.sparql.IndividualRetriever;
import org.semanticweb.HermiT.Reasoner;
import org.semanticweb.owlapi.model.*;
import org.slf4j.Logger;
Expand All @@ -12,7 +10,6 @@
import uk.ac.manchester.cs.owl.owlapi.OWLObjectComplementOfImpl;
import uk.ac.manchester.cs.owl.owlapi.OWLObjectIntersectionOfImpl;
import uk.ac.manchester.cs.owl.owlapi.OWLObjectSomeValuesFromImpl;
import org.semanticweb.owlapi.reasoner.Node;

import java.util.*;

Expand Down Expand Up @@ -86,16 +83,19 @@ public Collection<String> createDistinctConcepts(int noOfConcepts){
toSmallCount++;
continue;
}
if(!retriever.retrieveIndividualsForConcept(concept, 1, 5).isEmpty()) {
try {
if (!retriever.retrieveIndividualsForConcept(concept, 1, 5).isEmpty()) {

ret.add(parser.render(concept));
if(ret.size()>=noOfConcepts){
break;
ret.add(parser.render(concept));
if (ret.size() >= noOfConcepts) {
break;
}
} else {
noResults++;
}
}else{
noResults++;
}catch(Exception e){
e.printStackTrace();
}

}
List<String> ret2= new ArrayList<String>(ret);
LOGGER.info("Final {} concepts. [{} to small, {} with no results/timeout]", ret2.size(), toSmallCount, noResults);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.dice_group.LPBenchGen.dl;
package org.dice_group.lpbenchgen.dl;

import com.google.common.collect.Sets;
import org.semanticweb.owlapi.apibinding.OWLManager;
Expand All @@ -8,7 +8,6 @@
import org.semanticweb.owlapi.manchestersyntax.renderer.ManchesterOWLSyntaxOWLObjectRendererImpl;
import org.semanticweb.owlapi.manchestersyntax.renderer.ManchesterOWLSyntaxPrefixNameShortFormProvider;
import org.semanticweb.owlapi.model.*;
import org.semanticweb.owlapi.util.BidirectionalShortFormProvider;
import org.semanticweb.owlapi.util.BidirectionalShortFormProviderAdapter;
import uk.ac.manchester.cs.owl.owlapi.OWLDataFactoryImpl;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.dice_group.LPBenchGen.dl.visitors;
package org.dice_group.lpbenchgen.dl.visitors;

import org.semanticweb.owlapi.dlsyntax.renderer.DLSyntaxObjectRenderer;
import org.semanticweb.owlapi.model.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.dice_group.LPBenchGen.dl.visitors;
package org.dice_group.lpbenchgen.dl.visitors;

import org.semanticweb.owlapi.model.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.dice_group.LPBenchGen.lp;
package org.dice_group.lpbenchgen.lp;

import com.google.common.collect.Lists;
import org.dice_group.LPBenchGen.config.Configuration;
import org.dice_group.LPBenchGen.config.PosNegExample;
import org.dice_group.LPBenchGen.dl.ABoxFiller;
import org.dice_group.LPBenchGen.dl.OWLNegationCreator;
import org.dice_group.LPBenchGen.dl.OWLTBoxPositiveCreator;
import org.dice_group.LPBenchGen.dl.Parser;
import org.dice_group.LPBenchGen.dl.visitors.ConceptSubClassesExchanger;
import org.dice_group.LPBenchGen.sparql.IndividualRetriever;
import org.dice_group.lpbenchgen.config.Configuration;
import org.dice_group.lpbenchgen.config.PosNegExample;
import org.dice_group.lpbenchgen.dl.ABoxFiller;
import org.dice_group.lpbenchgen.dl.OWLNegationCreator;
import org.dice_group.lpbenchgen.dl.OWLTBoxPositiveCreator;
import org.dice_group.lpbenchgen.dl.Parser;
import org.dice_group.lpbenchgen.dl.visitors.ConceptSubClassesExchanger;
import org.dice_group.lpbenchgen.sparql.IndividualRetriever;
import org.semanticweb.HermiT.Reasoner;
import org.semanticweb.owlapi.formats.TurtleDocumentFormat;
import org.semanticweb.owlapi.model.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.dice_group.LPBenchGen.lp;
package org.dice_group.lpbenchgen.lp;

import org.semanticweb.owlapi.model.OWLClassExpression;
import org.semanticweb.owlapi.model.OWLDataProperty;
Expand Down
Loading

0 comments on commit 13c257f

Please sign in to comment.