Skip to content

Commit

Permalink
Avoid ontologies with invalid IRIs which are created by OWL API is no…
Browse files Browse the repository at this point in the history
… IRI is given.
  • Loading branch information
LorenzBuehmann committed Mar 14, 2016
1 parent b7b1324 commit b2d7aae
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public class OwlApiJenaUtils {

private static OWLDataFactory dataFactory = new OWLDataFactoryImpl();

private static final OWLOntologyManager man = OWLManager.createOWLOntologyManager();

private static int ONT_COUNTER = 0;

/**
* Converts a JENA API model into an OWL API ontology.
* @param model the JENA API model
Expand Down Expand Up @@ -170,7 +174,7 @@ public static LiteralLabel getLiteral(OWLLiteral lit){
*/
public static Set<Statement> asStatements(Set<OWLAxiom> axioms) {
try {
OWLOntology ontology = OWLManager.createOWLOntologyManager().createOntology(axioms);
OWLOntology ontology = man.createOntology(axioms, IRI.create("http://dllearner.org/converter" + ONT_COUNTER++));
Model model = getModel(ontology);
return model.listStatements().toSet();
} catch (OWLOntologyCreationException e) {
Expand Down

0 comments on commit b2d7aae

Please sign in to comment.