Skip to content

Commit

Permalink
adding automatic javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
TortugaAttack committed Apr 1, 2021
1 parent 4a54634 commit 596b074
Show file tree
Hide file tree
Showing 23 changed files with 729 additions and 29 deletions.
15 changes: 15 additions & 0 deletions src/main/java/org/dice_group/LPBenchGen/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,20 @@

import java.io.IOException;

/**
* The type Main.
*
* @author Lixi Alié Conrads
*/
public class Main {

/**
* The entry point of application.
*
* @param args the input arguments
* @throws OWLOntologyCreationException the owl ontology creation exception
* @throws IOException the io exception
*/
public static void main(String[] args) throws OWLOntologyCreationException, IOException {
if(args.length!=4){
printHelp();
Expand Down Expand Up @@ -38,6 +50,9 @@ 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" +
"\n\twill create learning problems and an ontology " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;

/**
* The type Ontology inconsistent finder.
*
* @author Lixi Alié Conrads
*/
public class OntologyInconsistentFinder {

private static final Logger LOGGER = LoggerFactory.getLogger(OntologyInconsistentFinder.class.getName());
Expand Down Expand Up @@ -61,6 +66,14 @@ public class OntologyInconsistentFinder {
private Set<String> rangeDone = new HashSet<String>();
private Set<String> domainDone = new HashSet<String>();

/**
* The entry point of application.
*
* @param args the input arguments
* @throws OWLOntologyCreationException the owl ontology creation exception
* @throws FileNotFoundException the file not found exception
* @throws OWLOntologyStorageException the owl ontology storage exception
*/
public static void main(String[] args) throws OWLOntologyCreationException, FileNotFoundException, OWLOntologyStorageException {
if(args.length==3) {
OntologyInconsistentFinder finder = new OntologyInconsistentFinder();
Expand All @@ -81,6 +94,14 @@ private static void printHelp() {
System.out.println("ontologyCleaner INPUT_ONTOLOGY SPARQL_ENDPOINT OUTPUT");
}

/**
* Print inconsistents.
*
* @param endpoint the endpoint
* @param ontology the ontology
* @throws FileNotFoundException the file not found exception
* @throws OWLOntologyStorageException the owl ontology storage exception
*/
public void printInconsistents(String endpoint, OWLOntology ontology) throws FileNotFoundException, OWLOntologyStorageException {
this.endpoint=endpoint;
Configuration conf = new Configuration();
Expand Down Expand Up @@ -145,6 +166,9 @@ public void printInconsistents(String endpoint, OWLOntology ontology) throws Fil
//ontology.saveOntology(new FileOutputStream(new File("fixed-ontology.owl")));
}

/**
* Build tree.
*/
public void buildTree(){
OWLClass owlThing =factory.getOWLClass("http://www.w3.org/2002/07/owl#Thing");
Set<OWLClass> subClasses = res.getSubClasses(owlThing, true).getFlattened();
Expand All @@ -153,6 +177,12 @@ public void buildTree(){
addDSF(subClasses, root);
}

/**
* Add dsf.
*
* @param subClasses the sub classes
* @param current the current
*/
public void addDSF(Set<OWLClass> subClasses, TreeNode current){
for(OWLClass sCL : subClasses){
TreeNode node = new TreeNode();
Expand All @@ -164,6 +194,13 @@ public void addDSF(Set<OWLClass> subClasses, TreeNode current){
}


/**
* Get single value set.
*
* @param queryStr the query str
* @param var the var
* @return the set
*/
public Set<String> getSingleValue(String queryStr, String var){
Query q = QueryFactory.create(queryStr);
QueryExecution qexec = QueryExecutionFactory.sparqlService(endpoint, q);
Expand All @@ -185,6 +222,12 @@ public Set<String> getSingleValue(String queryStr, String var){
return ret;
}

/**
* Suggest exchange.
*
* @param property the property
* @param isRange the is range
*/
public void suggestExchange(String property, boolean isRange){
//get a Class which all Individuals contain. -> worst case owl:Thing
//For the property -> getMostSpecific Class
Expand Down Expand Up @@ -243,6 +286,12 @@ private Set<String> getClassesForProperty(String property, boolean isRange) {
return ret;
}

/**
* Build tree set.
*
* @param classes the classes
* @return the set
*/
public Set<String> buildTree(Set<String> classes){
Set<String> paths=null;
for(String cl : classes){
Expand All @@ -266,8 +315,8 @@ public Set<String> buildTree(Set<String> classes){
/**
* Returns the most specific class of the set.
*
* @param classes
* @return
* @param classes the classes
* @return owl class expression
*/
public OWLClassExpression getMostSpecificClass(Set<String> classes){
//TODO group all classes by the
Expand All @@ -293,6 +342,13 @@ public OWLClassExpression getMostSpecificClass(Set<String> classes){
}


/**
* Print debug.
*
* @param endpoint the endpoint
* @param query the query
* @param vars the vars
*/
public void printDebug(String endpoint, String query, String[] vars){
StringBuilder select = new StringBuilder("PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT");
for(String v : vars){
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/dice_group/LPBenchGen/cleaner/TreeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,20 @@
import java.util.ArrayList;
import java.util.List;

/**
* The type Tree node.
*
* @author Lixi Alié Conrads
*/
public class TreeNode {

/**
* The Children.
*/
public List<TreeNode> children = new ArrayList<TreeNode>();
/**
* The Repr class.
*/
public String reprClass;

}
Loading

0 comments on commit 596b074

Please sign in to comment.