From f2eece0ca83cab56b4a1cf35c9ffe7a3dcfa261c Mon Sep 17 00:00:00 2001 From: Jeen Broekstra Date: Sat, 17 Nov 2018 12:13:52 +1100 Subject: [PATCH 1/3] protegeproject/rdf-library#6 pom dependencies migrated from sesame to rdf4j Signed-off-by: Jeen Broekstra --- pom.xml | 103 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/pom.xml b/pom.xml index c22a79a..1cfea53 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,7 @@ - + 4.0.0 @@ -34,7 +36,7 @@ tredmond@stanford.edu - + scm:git:git@github.com:protegeproject/rdf-library.git scm:git:git@github.com:protegeproject/rdf-library.git @@ -42,73 +44,76 @@ - 2.7.12 1.1.3 1.7.12 4.2.8 + + + + org.eclipse.rdf4j + rdf4j-bom + 2.4.1 + pom + import + + + + + - org.openrdf.sesame - sesame-repository-sail - ${sesame.version} + org.eclipse.rdf4j + rdf4j-repository-sail - + - org.openrdf.sesame - sesame-sail-memory - ${sesame.version} + org.eclipse.rdf4j + rdf4j-sail-memory - + - org.openrdf.sesame - sesame-rio-rdfxml - ${sesame.version} + org.eclipse.rdf4j + rdf4j-rio-rdfxml - + - org.openrdf.sesame - sesame-model - ${sesame.version} + org.eclipse.rdf4j + rdf4j-model - + - org.openrdf.sesame - sesame-queryparser-sparql - ${sesame.version} + org.eclipse.rdf4j + rdf4j-queryparser-sparql - + - org.openrdf.sesame - sesame-queryparser-serql - ${sesame.version} + org.eclipse.rdf4j + rdf4j-queryparser-serql - + ch.qos.logback logback-classic - ${logback.version} ch.qos.logback logback-core - ${logback.version} org.slf4j slf4j-api - ${slf4j.version} - + net.sourceforge.owlapi owlapi-osgidistribution ${owlapi.version} - + org.testng testng @@ -116,7 +121,7 @@ test - + @@ -157,7 +162,7 @@ - + org.apache.felix maven-bundle-plugin 3.0.1 @@ -166,24 +171,24 @@ org.protege.owl.rdf;singleton:=true The Protege Development Team - sesame-queryparser-serql, sesame-queryparser-sparql + rdf4j-queryparser-serql, + rdf4j-queryparser-sparql org.protege.owl.rdf*;version=${project.version}, - info.aduna.*;version="2.7.0", - org.openrdf.*;version="2.7.0", + org.eclipse.rdf4j.*;version="2.4.1", org.slf4j.*, ch.qos.logback.*, com.fasterxml.jackson.core.*;version="2.5.1" - org.openrdf.query.parser.QueryParserFactory + org.eclipse.rdf4j.query.parser.QueryParserFactory - !org.apache.commons.httpclient.*, - !groovy.lang, - !javax.jms, - !javax.mail.*, - !javax.servlet.*, - !org.codehaus.*, - !sun.reflect.*, + !org.apache.commons.httpclient.*, + !groovy.lang, + !javax.jms, + !javax.mail.*, + !javax.servlet.*, + !org.codehaus.*, + !sun.reflect.*, * @@ -197,7 +202,7 @@ - + org.apache.maven.plugins @@ -218,18 +223,18 @@ src/test/resources/unit-tests.xml - + - + maven-eclipse-plugin 2.9 true - + From 9ed3cac11994b9d53cd1fd3a4a1fda3c75528b9b Mon Sep 17 00:00:00 2001 From: Jeen Broekstra Date: Sat, 17 Nov 2018 13:08:58 +1100 Subject: [PATCH 2/3] protegeproject/rdf-library#6 bumped owlapi to v5, got compilation errors fixed [WIP] Signed-off-by: Jeen Broekstra --- pom.xml | 7 +- .../java/org/protege/owl/rdf/Utilities.java | 10 +-- .../protege/owl/rdf/api/OwlTripleStore.java | 9 +- .../rdf/impl/AnonymousResourceHandler.java | 31 +++---- .../owl/rdf/impl/OwlTripleStoreImpl.java | 90 ++++++++++--------- .../protege/owl/rdf/impl/RDFTranslator.java | 70 ++++++++------- .../rdf/impl/RepositoryRuntimeException.java | 2 +- .../impl/SynchronizeTripleStoreListener.java | 2 +- .../org/protege/owl/rdf/AnonymityTests.java | 13 ++- .../java/org/protege/owl/rdf/ImportTests.java | 13 ++- .../java/org/protege/owl/rdf/PizzaTests.java | 5 +- .../protege/owl/rdf/SynchronizationTests.java | 2 +- 12 files changed, 131 insertions(+), 123 deletions(-) diff --git a/pom.xml b/pom.xml index 1cfea53..672ed69 100644 --- a/pom.xml +++ b/pom.xml @@ -44,9 +44,8 @@ - 1.1.3 - 1.7.12 - 4.2.8 + 5.1.7 + 2.4.1 @@ -54,7 +53,7 @@ org.eclipse.rdf4j rdf4j-bom - 2.4.1 + ${rdf4j.version} pom import diff --git a/src/main/java/org/protege/owl/rdf/Utilities.java b/src/main/java/org/protege/owl/rdf/Utilities.java index 96118c5..6f6402b 100644 --- a/src/main/java/org/protege/owl/rdf/Utilities.java +++ b/src/main/java/org/protege/owl/rdf/Utilities.java @@ -1,10 +1,10 @@ package org.protege.owl.rdf; -import org.openrdf.repository.Repository; -import org.openrdf.repository.RepositoryException; -import org.openrdf.repository.sail.SailRepository; -import org.openrdf.sail.Sail; -import org.openrdf.sail.memory.MemoryStore; +import org.eclipse.rdf4j.repository.Repository; +import org.eclipse.rdf4j.repository.RepositoryException; +import org.eclipse.rdf4j.repository.sail.SailRepository; +import org.eclipse.rdf4j.sail.Sail; +import org.eclipse.rdf4j.sail.memory.MemoryStore; import org.protege.owl.rdf.api.OwlTripleStore; import org.protege.owl.rdf.impl.OwlTripleStoreImpl; import org.protege.owl.rdf.impl.SynchronizeTripleStoreListener; diff --git a/src/main/java/org/protege/owl/rdf/api/OwlTripleStore.java b/src/main/java/org/protege/owl/rdf/api/OwlTripleStore.java index b47e1cf..19af64c 100644 --- a/src/main/java/org/protege/owl/rdf/api/OwlTripleStore.java +++ b/src/main/java/org/protege/owl/rdf/api/OwlTripleStore.java @@ -1,10 +1,9 @@ package org.protege.owl.rdf.api; -import info.aduna.iteration.CloseableIteration; - -import org.openrdf.model.BNode; -import org.openrdf.repository.Repository; -import org.openrdf.repository.RepositoryException; +import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.model.BNode; +import org.eclipse.rdf4j.repository.Repository; +import org.eclipse.rdf4j.repository.RepositoryException; import org.semanticweb.owlapi.model.OWLAxiom; import org.semanticweb.owlapi.model.OWLClassExpression; import org.semanticweb.owlapi.model.OWLOntologyID; diff --git a/src/main/java/org/protege/owl/rdf/impl/AnonymousResourceHandler.java b/src/main/java/org/protege/owl/rdf/impl/AnonymousResourceHandler.java index e09a882..5c971f9 100644 --- a/src/main/java/org/protege/owl/rdf/impl/AnonymousResourceHandler.java +++ b/src/main/java/org/protege/owl/rdf/impl/AnonymousResourceHandler.java @@ -17,6 +17,7 @@ import org.semanticweb.owlapi.model.OWLNamedIndividual; import org.semanticweb.owlapi.model.OWLObject; import org.semanticweb.owlapi.model.OWLOntologyID; +import org.semanticweb.owlapi.model.OWLOntologyManager; import org.semanticweb.owlapi.util.OWLObjectDuplicator; public class AnonymousResourceHandler { @@ -108,15 +109,15 @@ private Set duplicateAxiomAnnotations(OWLAxiom axiom, OWLObjectDu private class SurrogateInserter extends OWLObjectDuplicator { public SurrogateInserter(OWLDataFactory factory) { - super(factory); + super((OWLOntologyManager)factory); } - public void visit(OWLAnonymousIndividual i) { + public OWLAnonymousIndividual visit(OWLAnonymousIndividual i) { IRI iri = getSurrogateId(i); - setLastObject(factory.getOWLNamedIndividual(iri)); + return (OWLAnonymousIndividual)t(factory.getOWLNamedIndividual(iri)); } - public void visit(OWLAnnotationAssertionAxiom axiom) { + public OWLAnnotationAssertionAxiom visit(OWLAnnotationAssertionAxiom axiom) { OWLObject rawSubject = duplicateObject(axiom.getSubject()); OWLAnnotationSubject subject; if (rawSubject instanceof OWLNamedIndividual) { @@ -134,10 +135,10 @@ public void visit(OWLAnnotationAssertionAxiom axiom) { else { value = (OWLAnnotationValue) rawValue; } - setLastObject(factory.getOWLAnnotationAssertionAxiom(prop, subject, value, duplicateAxiomAnnotations(axiom, this))); + return t(factory.getOWLAnnotationAssertionAxiom(prop, subject, value, duplicateAxiomAnnotations(axiom, this))); } - public void visit(OWLAnnotation node) { + public OWLAnnotation visit(OWLAnnotation node) { OWLAnnotationProperty prop = duplicateObject(node.getProperty()); OWLObject rawValue = duplicateObject(node.getValue()); OWLAnnotationValue val; @@ -147,7 +148,7 @@ public void visit(OWLAnnotation node) { else { val = (OWLAnnotationValue) rawValue; } - setLastObject(factory.getOWLAnnotation(prop, val)); + return t(factory.getOWLAnnotation(prop, val)); } } @@ -155,19 +156,19 @@ public void visit(OWLAnnotation node) { private class SurrogateRemover extends OWLObjectDuplicator { public SurrogateRemover(OWLDataFactory factory) { - super(factory); + super((OWLOntologyManager)factory); } - public void visit(OWLNamedIndividual i) { + public OWLNamedIndividual visit(OWLNamedIndividual i) { if (isSurrogate(i.getIRI())) { - setLastObject(getAnonymousIndividual(i.getIRI())); + return (OWLNamedIndividual)t(getAnonymousIndividual(i.getIRI())); } else { - setLastObject(i); + return t(i); } } - public void visit(OWLAnnotationAssertionAxiom axiom) { + public OWLAnnotationAssertionAxiom visit(OWLAnnotationAssertionAxiom axiom) { OWLAnnotationSubject subject = duplicateObject(axiom.getSubject()); if (subject instanceof IRI && isSurrogate((IRI) subject)) { subject = getAnonymousIndividual((IRI) subject); @@ -177,17 +178,17 @@ public void visit(OWLAnnotationAssertionAxiom axiom) { if (value instanceof IRI && isSurrogate((IRI) value)) { value = getAnonymousIndividual((IRI) value); } - setLastObject(factory.getOWLAnnotationAssertionAxiom(prop, subject, value, duplicateAxiomAnnotations(axiom, this))); + return t(factory.getOWLAnnotationAssertionAxiom(prop, subject, value, duplicateAxiomAnnotations(axiom, this))); } - public void visit(OWLAnnotation node) { + public OWLAnnotation visit(OWLAnnotation node) { node.getProperty().accept(this); OWLAnnotationProperty prop = (OWLAnnotationProperty) duplicateObject(node.getProperty()); OWLAnnotationValue val = (OWLAnnotationValue) duplicateObject(node.getValue()); if (val instanceof IRI && isSurrogate((IRI) val)) { val = getAnonymousIndividual((IRI) val); } - setLastObject(factory.getOWLAnnotation(prop, val)); + return t(factory.getOWLAnnotation(prop, val)); } } } diff --git a/src/main/java/org/protege/owl/rdf/impl/OwlTripleStoreImpl.java b/src/main/java/org/protege/owl/rdf/impl/OwlTripleStoreImpl.java index 0410f57..6f9532c 100644 --- a/src/main/java/org/protege/owl/rdf/impl/OwlTripleStoreImpl.java +++ b/src/main/java/org/protege/owl/rdf/impl/OwlTripleStoreImpl.java @@ -1,22 +1,24 @@ package org.protege.owl.rdf.impl; -import info.aduna.iteration.CloseableIteration; - import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.UUID; -import org.openrdf.model.BNode; -import org.openrdf.model.Statement; -import org.openrdf.model.ValueFactory; -import org.openrdf.repository.Repository; -import org.openrdf.repository.RepositoryConnection; -import org.openrdf.repository.RepositoryException; -import org.openrdf.repository.RepositoryResult; -import org.openrdf.rio.RDFHandlerException; -import org.openrdf.rio.RDFWriter; -import org.openrdf.rio.rdfxml.RDFXMLWriter; +import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.model.BNode; +import org.eclipse.rdf4j.model.Literal; +import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.model.Statement; +import org.eclipse.rdf4j.model.URI; +import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.repository.Repository; +import org.eclipse.rdf4j.repository.RepositoryConnection; +import org.eclipse.rdf4j.repository.RepositoryException; +import org.eclipse.rdf4j.repository.RepositoryResult; +import org.eclipse.rdf4j.rio.RDFHandlerException; +import org.eclipse.rdf4j.rio.RDFWriter; +import org.eclipse.rdf4j.rio.rdfxml.RDFXMLWriter; import org.protege.owl.rdf.api.OwlTripleStore; import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.model.IRI; @@ -48,10 +50,10 @@ public class OwlTripleStoreImpl implements OwlTripleStore { public static final String BNODE_PREFIX = "_:BNode"; - private org.openrdf.model.URI hashCodeProperty; - private org.openrdf.model.URI sourceOntologyProperty; - private org.openrdf.model.URI ontologyIdProperty; - private org.openrdf.model.URI ontologyVersionProperty; + private org.eclipse.rdf4j.model.URI hashCodeProperty; + private org.eclipse.rdf4j.model.URI sourceOntologyProperty; + private org.eclipse.rdf4j.model.URI ontologyIdProperty; + private org.eclipse.rdf4j.model.URI ontologyVersionProperty; private Repository repository; private AnonymousResourceHandler anonymousHandler; @@ -92,7 +94,7 @@ public Repository getRepository() { @Override public void addAxiom(OWLOntologyID ontologyId, OWLAxiom axiom) throws RepositoryException { axiom = anonymousHandler.insertSurrogates(axiom); - org.openrdf.model.URI ontologyRepresentative = getOntologyRepresentative(ontologyId); + URI ontologyRepresentative = getOntologyRepresentative(ontologyId); if (getAxiomId(ontologyId, axiom) != null) { return; } @@ -102,7 +104,7 @@ public void addAxiom(OWLOntologyID ontologyId, OWLAxiom axiom) throws Repository @Override public void removeAxiom(OWLOntologyID ontologyId, OWLAxiom axiom) throws RepositoryException { axiom = anonymousHandler.insertSurrogates(axiom); - org.openrdf.model.URI axiomResource = getAxiomId(ontologyId, axiom); + URI axiomResource = getAxiomId(ontologyId, axiom); if (axiomResource != null) { removeAxiom(axiomResource); } @@ -116,7 +118,7 @@ public boolean hasAxiom(OWLOntologyID ontologyId, OWLAxiom axiom) throws Reposit @Override public CloseableIteration listAxioms(OWLOntologyID ontologyId) throws RepositoryException { - org.openrdf.model.URI ontologyRepresentative = getOntologyRepresentative(ontologyId); + URI ontologyRepresentative = getOntologyRepresentative(ontologyId); final RepositoryConnection connection = repository.getConnection(); boolean success = false; try { @@ -131,7 +133,7 @@ public boolean hasNext() throws RepositoryException { @Override public OWLAxiom next() throws RepositoryException { Statement stmt = stmts.next(); - org.openrdf.model.URI axiomResource = (org.openrdf.model.URI) stmt.getSubject(); + URI axiomResource = (URI) stmt.getSubject(); RepositoryConnection connection = repository.getConnection(); try { return anonymousHandler.removeSurrogates(parseAxiom(connection, axiomResource)); @@ -190,18 +192,18 @@ public boolean incorporateExternalChanges() { * @return * @throws RepositoryException */ - private org.openrdf.model.URI getAxiomId(OWLOntologyID ontologyId, OWLAxiom axiom) throws RepositoryException { - org.openrdf.model.URI ontologyRepresentative = getOntologyRepresentative(ontologyId); + private URI getAxiomId(OWLOntologyID ontologyId, OWLAxiom axiom) throws RepositoryException { + URI ontologyRepresentative = getOntologyRepresentative(ontologyId); ValueFactory factory = repository.getValueFactory(); RepositoryConnection connection = repository.getConnection(); try { - org.openrdf.model.Literal hashCodeValue = factory.createLiteral(axiom.hashCode()); + Literal hashCodeValue = factory.createLiteral(axiom.hashCode()); RepositoryResult correctHashCodes = connection.getStatements(null, hashCodeProperty, hashCodeValue, false); try { while (correctHashCodes.hasNext()) { Statement stmt = correctHashCodes.next(); - if (stmt.getSubject() instanceof org.openrdf.model.URI) { - org.openrdf.model.URI axiomId = (org.openrdf.model.URI) stmt.getSubject(); + if (stmt.getSubject() instanceof URI) { + URI axiomId = (URI) stmt.getSubject(); if (connection.hasStatement(axiomId, sourceOntologyProperty, ontologyRepresentative, false) && axiom.equals(parseAxiom(connection, axiomId))) { return axiomId; @@ -239,7 +241,7 @@ private org.openrdf.model.URI getAxiomId(OWLOntologyID ontologyId, OWLAxiom axio * @throws IOException * @throws RDFHandlerException */ - private OWLAxiom parseAxiom(RepositoryConnection connection, org.openrdf.model.URI axiomId) throws OWLOntologyCreationException, RepositoryException, SAXException, IOException, RDFHandlerException { + private OWLAxiom parseAxiom(RepositoryConnection connection, URI axiomId) throws OWLOntologyCreationException, RepositoryException, SAXException, IOException, RDFHandlerException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Starting parse"); } @@ -268,7 +270,7 @@ public OWLClassExpression parseClassExpression(BNode classExpressionNode) throws try { RepositoryResult triples = connection.getStatements(classExpressionNode, null, null, false); Statement stmt = triples.next(); - org.openrdf.model.URI axiomId = (org.openrdf.model.URI) stmt.getContext(); + URI axiomId = (URI) stmt.getContext(); OWLRDFConsumer consumer = consumeTriples(connection, axiomId); String nodeName = generateName(classExpressionNode); OWLClassExpression ce = consumer.translateClassExpression(IRI.create(nodeName)); @@ -293,7 +295,7 @@ public OWLClassExpression parseClassExpression(BNode classExpressionNode) throws } } - private OWLRDFConsumer consumeTriples(RepositoryConnection connection, org.openrdf.model.URI axiomId) throws OWLOntologyCreationException, RepositoryException, IOException, RDFHandlerException, SAXException { + private OWLRDFConsumer consumeTriples(RepositoryConnection connection, URI axiomId) throws OWLOntologyCreationException, RepositoryException, IOException, RDFHandlerException, SAXException { OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); OWLOntology ontology = manager.createOntology(); OWLRDFConsumer consumer = new OWLRDFConsumer(ontology, anonymousNodeChecker, new OWLOntologyLoaderConfiguration()); @@ -315,10 +317,10 @@ private OWLRDFConsumer consumeTriples(RepositoryConnection connection, org.openr } String subjectName = generateName(stmt.getSubject()); String predicateName = generateName(stmt.getPredicate()); - if (stmt.getObject() instanceof org.openrdf.model.Literal) { - addTriple(consumer, subjectName, predicateName, (org.openrdf.model.Literal) stmt.getObject()); + if (stmt.getObject() instanceof Literal) { + addTriple(consumer, subjectName, predicateName, (Literal) stmt.getObject()); } else { - addTriple(consumer, subjectName, predicateName, (org.openrdf.model.Resource) stmt.getObject()); + addTriple(consumer, subjectName, predicateName, (Resource) stmt.getObject()); } } if (LOGGER.isDebugEnabled()) { @@ -333,7 +335,7 @@ private OWLRDFConsumer consumeTriples(RepositoryConnection connection, org.openr } private void addTriple(RDFConsumer consumer, - String subjectName, String predicateName, org.openrdf.model.Literal literal) throws SAXException { + String subjectName, String predicateName, Literal literal) throws SAXException { String datatype; if (literal.getDatatype() == null) { datatype = null; // OWL2Datatype.RDF_PLAIN_LITERAL.getIRI().toString(); @@ -344,18 +346,18 @@ private void addTriple(RDFConsumer consumer, consumer.statementWithLiteralValue(subjectName, predicateName, literal.stringValue(), - literal.getLanguage(), + literal.getLanguage().orElse(null), datatype); } private void addTriple(RDFConsumer consumer, String subjectName, String predicateName, - org.openrdf.model.Resource value) throws SAXException { + Resource value) throws SAXException { consumer.statementWithResourceValue(subjectName, predicateName, generateName(value)); } - private void removeAxiom(org.openrdf.model.URI axiomResource) throws RepositoryException { + private void removeAxiom(URI axiomResource) throws RepositoryException { if (axiomResource == null) { return; } @@ -373,7 +375,7 @@ private void removeAxiom(org.openrdf.model.URI axiomResource) throws RepositoryE } } - private String generateName(org.openrdf.model.Resource resource) { + private String generateName(Resource resource) { String name; if (resource instanceof BNode) { name = BNODE_PREFIX + ((BNode) resource).getID(); @@ -385,7 +387,7 @@ private String generateName(org.openrdf.model.Resource resource) { } - private org.openrdf.model.URI getOntologyRepresentative(OWLOntologyID id) throws RepositoryException { + private URI getOntologyRepresentative(OWLOntologyID id) throws RepositoryException { if (id.isAnonymous()) { return repository.getValueFactory().createURI(anonymousHandler.getSurrogateId(id).toString()); } @@ -394,19 +396,19 @@ private org.openrdf.model.URI getOntologyRepresentative(OWLOntologyID id) throws } } - private org.openrdf.model.URI getNamedOntologyRepresentative(OWLOntologyID id) throws RepositoryException { - org.openrdf.model.URI result = null; + private URI getNamedOntologyRepresentative(OWLOntologyID id) throws RepositoryException { + URI result = null; RepositoryConnection connection = repository.getConnection(); try { - org.openrdf.model.URI rdfId = repository.getValueFactory().createURI(id.getOntologyIRI().toString()); - org.openrdf.model.URI rdfVersion = id.getVersionIRI().isPresent() ? repository + URI rdfId = repository.getValueFactory().createURI(id.getOntologyIRI().toString()); + URI rdfVersion = id.getVersionIRI().isPresent() ? repository .getValueFactory().createURI( id.getVersionIRI().get().toString()) : null; RepositoryResult idStatements = connection.getStatements(null, ontologyIdProperty, rdfId, false); try { while (idStatements.hasNext()) { Statement idStatement = idStatements.next(); - org.openrdf.model.URI possible = (org.openrdf.model.URI) idStatement.getSubject(); + URI possible = (URI) idStatement.getSubject(); RepositoryResult versionStatements = connection.getStatements(possible, ontologyVersionProperty, null, false); try { if (rdfVersion == null && !versionStatements.hasNext()) { @@ -444,9 +446,9 @@ private org.openrdf.model.URI getNamedOntologyRepresentative(OWLOntologyID id) t return result; } - private org.openrdf.model.URI createNamedOntologyRepresentative(org.openrdf.model.URI rdfId, org.openrdf.model.URI rdfVersion) throws RepositoryException { + private URI createNamedOntologyRepresentative(URI rdfId, URI rdfVersion) throws RepositoryException { String uriString = NS + "#" + UUID.randomUUID().toString().replaceAll("-", "_"); - org.openrdf.model.URI representative = repository.getValueFactory().createURI(uriString); + URI representative = repository.getValueFactory().createURI(uriString); RepositoryConnection connection = repository.getConnection(); try { connection.add(representative, ontologyIdProperty, rdfId); diff --git a/src/main/java/org/protege/owl/rdf/impl/RDFTranslator.java b/src/main/java/org/protege/owl/rdf/impl/RDFTranslator.java index e1dc0fa..b906895 100644 --- a/src/main/java/org/protege/owl/rdf/impl/RDFTranslator.java +++ b/src/main/java/org/protege/owl/rdf/impl/RDFTranslator.java @@ -1,28 +1,38 @@ package org.protege.owl.rdf.impl; -import org.openrdf.model.BNode; -import org.openrdf.model.Resource; -import org.openrdf.model.Value; -import org.openrdf.model.ValueFactory; -import org.openrdf.repository.Repository; -import org.openrdf.repository.RepositoryConnection; -import org.openrdf.repository.RepositoryException; +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +import org.eclipse.rdf4j.model.BNode; +import org.eclipse.rdf4j.model.Literal; +import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.model.URI; +import org.eclipse.rdf4j.model.Value; +import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.repository.Repository; +import org.eclipse.rdf4j.repository.RepositoryConnection; +import org.eclipse.rdf4j.repository.RepositoryException; import org.semanticweb.owlapi.apibinding.OWLManager; -import org.semanticweb.owlapi.model.*; +import org.semanticweb.owlapi.model.IRI; +import org.semanticweb.owlapi.model.OWLAxiom; +import org.semanticweb.owlapi.model.OWLEntity; +import org.semanticweb.owlapi.model.OWLLiteral; +import org.semanticweb.owlapi.model.OWLOntology; +import org.semanticweb.owlapi.model.OWLOntologyCreationException; +import org.semanticweb.owlapi.model.OWLOntologyManager; import org.semanticweb.owlapi.rdf.model.AbstractTranslator; -import org.semanticweb.owlapi.util.AlwaysOutputId; +import org.semanticweb.owlapi.util.OWLAnonymousIndividualsWithMultipleOccurrences; import org.semanticweb.owlapi.vocab.OWLRDFVocabulary; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; - -public class RDFTranslator extends AbstractTranslator { +public class RDFTranslator extends AbstractTranslator { public static final Logger LOGGER = LoggerFactory.getLogger(RDFTranslator.class); - private org.openrdf.model.URI axiomResource; + private URI axiomResource; /** * There is a dangerous bend coming up! If you don't use the identity hash map then this @@ -40,9 +50,9 @@ public class RDFTranslator extends AbstractTranslator Date: Sat, 17 Nov 2018 13:19:40 +1100 Subject: [PATCH 3/3] protegeproject/rdf-library#6 replaced deprecated URI with IRI Signed-off-by: Jeen Broekstra --- .../rdf/impl/AnonymousResourceHandler.java | 2 + .../owl/rdf/impl/OwlTripleStoreImpl.java | 67 +++++----- .../protege/owl/rdf/impl/RDFTranslator.java | 125 +++++++++--------- .../rdf/impl/RepositoryRuntimeException.java | 16 --- 4 files changed, 98 insertions(+), 112 deletions(-) delete mode 100644 src/main/java/org/protege/owl/rdf/impl/RepositoryRuntimeException.java diff --git a/src/main/java/org/protege/owl/rdf/impl/AnonymousResourceHandler.java b/src/main/java/org/protege/owl/rdf/impl/AnonymousResourceHandler.java index 5c971f9..5751807 100644 --- a/src/main/java/org/protege/owl/rdf/impl/AnonymousResourceHandler.java +++ b/src/main/java/org/protege/owl/rdf/impl/AnonymousResourceHandler.java @@ -109,6 +109,7 @@ private Set duplicateAxiomAnnotations(OWLAxiom axiom, OWLObjectDu private class SurrogateInserter extends OWLObjectDuplicator { public SurrogateInserter(OWLDataFactory factory) { + // FIXME this cast is _very_ likely not correct. super((OWLOntologyManager)factory); } @@ -156,6 +157,7 @@ public OWLAnnotation visit(OWLAnnotation node) { private class SurrogateRemover extends OWLObjectDuplicator { public SurrogateRemover(OWLDataFactory factory) { + // FIXME this cast is _very_ likely not correct. super((OWLOntologyManager)factory); } diff --git a/src/main/java/org/protege/owl/rdf/impl/OwlTripleStoreImpl.java b/src/main/java/org/protege/owl/rdf/impl/OwlTripleStoreImpl.java index 6f9532c..4ee6db5 100644 --- a/src/main/java/org/protege/owl/rdf/impl/OwlTripleStoreImpl.java +++ b/src/main/java/org/protege/owl/rdf/impl/OwlTripleStoreImpl.java @@ -10,7 +10,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.model.URI; +import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.RepositoryConnection; @@ -21,7 +21,6 @@ import org.eclipse.rdf4j.rio.rdfxml.RDFXMLWriter; import org.protege.owl.rdf.api.OwlTripleStore; import org.semanticweb.owlapi.apibinding.OWLManager; -import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLAxiom; import org.semanticweb.owlapi.model.OWLClassExpression; import org.semanticweb.owlapi.model.OWLDataFactory; @@ -50,17 +49,17 @@ public class OwlTripleStoreImpl implements OwlTripleStore { public static final String BNODE_PREFIX = "_:BNode"; - private org.eclipse.rdf4j.model.URI hashCodeProperty; - private org.eclipse.rdf4j.model.URI sourceOntologyProperty; - private org.eclipse.rdf4j.model.URI ontologyIdProperty; - private org.eclipse.rdf4j.model.URI ontologyVersionProperty; + private org.eclipse.rdf4j.model.IRI hashCodeProperty; + private org.eclipse.rdf4j.model.IRI sourceOntologyProperty; + private org.eclipse.rdf4j.model.IRI ontologyIdProperty; + private org.eclipse.rdf4j.model.IRI ontologyVersionProperty; private Repository repository; private AnonymousResourceHandler anonymousHandler; private AnonymousNodeChecker anonymousNodeChecker = new AnonymousNodeChecker() { @Override - public boolean isAnonymousNode(IRI iri) { + public boolean isAnonymousNode(org.semanticweb.owlapi.model.IRI iri) { return iri.toString().startsWith(BNODE_PREFIX); } @@ -79,10 +78,10 @@ public boolean isAnonymousNode(String iri) { public OwlTripleStoreImpl(Repository repository, OWLDataFactory factory) { this.repository = repository; ValueFactory rdfFactory = repository.getValueFactory(); - hashCodeProperty = rdfFactory.createURI(HASH_CODE); - sourceOntologyProperty = rdfFactory.createURI(SOURCE_ONTOLOGY); - ontologyIdProperty = rdfFactory.createURI(ONTOLOGY_ID); - ontologyVersionProperty = rdfFactory.createURI(ONTOLOGY_VERSION); + hashCodeProperty = rdfFactory.createIRI(HASH_CODE); + sourceOntologyProperty = rdfFactory.createIRI(SOURCE_ONTOLOGY); + ontologyIdProperty = rdfFactory.createIRI(ONTOLOGY_ID); + ontologyVersionProperty = rdfFactory.createIRI(ONTOLOGY_VERSION); anonymousHandler = new AnonymousResourceHandler(factory); } @@ -94,7 +93,7 @@ public Repository getRepository() { @Override public void addAxiom(OWLOntologyID ontologyId, OWLAxiom axiom) throws RepositoryException { axiom = anonymousHandler.insertSurrogates(axiom); - URI ontologyRepresentative = getOntologyRepresentative(ontologyId); + IRI ontologyRepresentative = getOntologyRepresentative(ontologyId); if (getAxiomId(ontologyId, axiom) != null) { return; } @@ -104,7 +103,7 @@ public void addAxiom(OWLOntologyID ontologyId, OWLAxiom axiom) throws Repository @Override public void removeAxiom(OWLOntologyID ontologyId, OWLAxiom axiom) throws RepositoryException { axiom = anonymousHandler.insertSurrogates(axiom); - URI axiomResource = getAxiomId(ontologyId, axiom); + IRI axiomResource = getAxiomId(ontologyId, axiom); if (axiomResource != null) { removeAxiom(axiomResource); } @@ -118,7 +117,7 @@ public boolean hasAxiom(OWLOntologyID ontologyId, OWLAxiom axiom) throws Reposit @Override public CloseableIteration listAxioms(OWLOntologyID ontologyId) throws RepositoryException { - URI ontologyRepresentative = getOntologyRepresentative(ontologyId); + IRI ontologyRepresentative = getOntologyRepresentative(ontologyId); final RepositoryConnection connection = repository.getConnection(); boolean success = false; try { @@ -133,7 +132,7 @@ public boolean hasNext() throws RepositoryException { @Override public OWLAxiom next() throws RepositoryException { Statement stmt = stmts.next(); - URI axiomResource = (URI) stmt.getSubject(); + IRI axiomResource = (IRI) stmt.getSubject(); RepositoryConnection connection = repository.getConnection(); try { return anonymousHandler.removeSurrogates(parseAxiom(connection, axiomResource)); @@ -192,8 +191,8 @@ public boolean incorporateExternalChanges() { * @return * @throws RepositoryException */ - private URI getAxiomId(OWLOntologyID ontologyId, OWLAxiom axiom) throws RepositoryException { - URI ontologyRepresentative = getOntologyRepresentative(ontologyId); + private IRI getAxiomId(OWLOntologyID ontologyId, OWLAxiom axiom) throws RepositoryException { + IRI ontologyRepresentative = getOntologyRepresentative(ontologyId); ValueFactory factory = repository.getValueFactory(); RepositoryConnection connection = repository.getConnection(); try { @@ -202,8 +201,8 @@ private URI getAxiomId(OWLOntologyID ontologyId, OWLAxiom axiom) throws Reposito try { while (correctHashCodes.hasNext()) { Statement stmt = correctHashCodes.next(); - if (stmt.getSubject() instanceof URI) { - URI axiomId = (URI) stmt.getSubject(); + if (stmt.getSubject() instanceof IRI) { + IRI axiomId = (IRI) stmt.getSubject(); if (connection.hasStatement(axiomId, sourceOntologyProperty, ontologyRepresentative, false) && axiom.equals(parseAxiom(connection, axiomId))) { return axiomId; @@ -241,7 +240,7 @@ private URI getAxiomId(OWLOntologyID ontologyId, OWLAxiom axiom) throws Reposito * @throws IOException * @throws RDFHandlerException */ - private OWLAxiom parseAxiom(RepositoryConnection connection, URI axiomId) throws OWLOntologyCreationException, RepositoryException, SAXException, IOException, RDFHandlerException { + private OWLAxiom parseAxiom(RepositoryConnection connection, IRI axiomId) throws OWLOntologyCreationException, RepositoryException, SAXException, IOException, RDFHandlerException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Starting parse"); } @@ -270,10 +269,10 @@ public OWLClassExpression parseClassExpression(BNode classExpressionNode) throws try { RepositoryResult triples = connection.getStatements(classExpressionNode, null, null, false); Statement stmt = triples.next(); - URI axiomId = (URI) stmt.getContext(); + IRI axiomId = (IRI) stmt.getContext(); OWLRDFConsumer consumer = consumeTriples(connection, axiomId); String nodeName = generateName(classExpressionNode); - OWLClassExpression ce = consumer.translateClassExpression(IRI.create(nodeName)); + OWLClassExpression ce = consumer.translateClassExpression(org.semanticweb.owlapi.model.IRI.create(nodeName)); consumer.endModel(); if (!((TrackingOntologyFormat) consumer.getOntologyFormat()).getFailed()) { return ce; @@ -295,7 +294,7 @@ public OWLClassExpression parseClassExpression(BNode classExpressionNode) throws } } - private OWLRDFConsumer consumeTriples(RepositoryConnection connection, URI axiomId) throws OWLOntologyCreationException, RepositoryException, IOException, RDFHandlerException, SAXException { + private OWLRDFConsumer consumeTriples(RepositoryConnection connection, IRI axiomId) throws OWLOntologyCreationException, RepositoryException, IOException, RDFHandlerException, SAXException { OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); OWLOntology ontology = manager.createOntology(); OWLRDFConsumer consumer = new OWLRDFConsumer(ontology, anonymousNodeChecker, new OWLOntologyLoaderConfiguration()); @@ -357,7 +356,7 @@ private void addTriple(RDFConsumer consumer, consumer.statementWithResourceValue(subjectName, predicateName, generateName(value)); } - private void removeAxiom(URI axiomResource) throws RepositoryException { + private void removeAxiom(IRI axiomResource) throws RepositoryException { if (axiomResource == null) { return; } @@ -387,28 +386,28 @@ private String generateName(Resource resource) { } - private URI getOntologyRepresentative(OWLOntologyID id) throws RepositoryException { + private IRI getOntologyRepresentative(OWLOntologyID id) throws RepositoryException { if (id.isAnonymous()) { - return repository.getValueFactory().createURI(anonymousHandler.getSurrogateId(id).toString()); + return repository.getValueFactory().createIRI(anonymousHandler.getSurrogateId(id).toString()); } else { return getNamedOntologyRepresentative(id); } } - private URI getNamedOntologyRepresentative(OWLOntologyID id) throws RepositoryException { - URI result = null; + private IRI getNamedOntologyRepresentative(OWLOntologyID id) throws RepositoryException { + IRI result = null; RepositoryConnection connection = repository.getConnection(); try { - URI rdfId = repository.getValueFactory().createURI(id.getOntologyIRI().toString()); - URI rdfVersion = id.getVersionIRI().isPresent() ? repository - .getValueFactory().createURI( + IRI rdfId = repository.getValueFactory().createIRI(id.getOntologyIRI().toString()); + IRI rdfVersion = id.getVersionIRI().isPresent() ? repository + .getValueFactory().createIRI( id.getVersionIRI().get().toString()) : null; RepositoryResult idStatements = connection.getStatements(null, ontologyIdProperty, rdfId, false); try { while (idStatements.hasNext()) { Statement idStatement = idStatements.next(); - URI possible = (URI) idStatement.getSubject(); + IRI possible = (IRI) idStatement.getSubject(); RepositoryResult versionStatements = connection.getStatements(possible, ontologyVersionProperty, null, false); try { if (rdfVersion == null && !versionStatements.hasNext()) { @@ -446,9 +445,9 @@ private URI getNamedOntologyRepresentative(OWLOntologyID id) throws RepositoryEx return result; } - private URI createNamedOntologyRepresentative(URI rdfId, URI rdfVersion) throws RepositoryException { + private IRI createNamedOntologyRepresentative(IRI rdfId, IRI rdfVersion) throws RepositoryException { String uriString = NS + "#" + UUID.randomUUID().toString().replaceAll("-", "_"); - URI representative = repository.getValueFactory().createURI(uriString); + IRI representative = repository.getValueFactory().createIRI(uriString); RepositoryConnection connection = repository.getConnection(); try { connection.add(representative, ontologyIdProperty, rdfId); diff --git a/src/main/java/org/protege/owl/rdf/impl/RDFTranslator.java b/src/main/java/org/protege/owl/rdf/impl/RDFTranslator.java index b906895..e5614fd 100644 --- a/src/main/java/org/protege/owl/rdf/impl/RDFTranslator.java +++ b/src/main/java/org/protege/owl/rdf/impl/RDFTranslator.java @@ -7,16 +7,15 @@ import java.util.UUID; import org.eclipse.rdf4j.model.BNode; +import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.URI; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.RepositoryConnection; import org.eclipse.rdf4j.repository.RepositoryException; import org.semanticweb.owlapi.apibinding.OWLManager; -import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLAxiom; import org.semanticweb.owlapi.model.OWLEntity; import org.semanticweb.owlapi.model.OWLLiteral; @@ -29,48 +28,51 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +public class RDFTranslator extends AbstractTranslator { -public class RDFTranslator extends AbstractTranslator { - public static final Logger LOGGER = LoggerFactory.getLogger(RDFTranslator.class); - private URI axiomResource; + public static final Logger LOGGER = LoggerFactory.getLogger(RDFTranslator.class); + + private IRI axiomResource; /** - * There is a dangerous bend coming up! If you don't use the identity hash map then this - * code doesn't work. The identity hashmap is used to ensure that lists are not reused in - * non-standard ways by different axioms. (I think that this might actually lead to an OWL full by - * the specification because of how triples are "consumed" by the translator). But there is - * an additional problem (not quite a bug because it works) in the AbstractTranslator.translateList - * method in an off by one error when it generates the key for getAnonymousNode. So using a - * HashMap here leads to unexpectedly bad results even when you would not expect that lists - * would be shared. + * There is a dangerous bend coming up! If you don't use the identity hash map then this code doesn't work. + * The identity hashmap is used to ensure that lists are not reused in non-standard ways by different + * axioms. (I think that this might actually lead to an OWL full by the specification because of how triples + * are "consumed" by the translator). But there is an additional problem (not quite a bug because it works) + * in the AbstractTranslator.translateList method in an off by one error when it generates the key for + * getAnonymousNode. So using a HashMap here leads to unexpectedly bad results even when you would not + * expect that lists would be shared. */ private Map bnodeMap = new IdentityHashMap(); + private static OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); + private ValueFactory rdfFactory; + private RepositoryConnection connection; - - public static void translate(Repository repository, OWLAxiom axiom, - URI hashCodeProperty, - URI sourceOntologyProperty, - URI ontologyRepresentative) throws RepositoryException { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("Starting axiom parse"); - } + + public static void translate(Repository repository, OWLAxiom axiom, IRI hashCodeProperty, + IRI sourceOntologyProperty, IRI ontologyRepresentative) + throws RepositoryException + { + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("Starting axiom parse"); + } boolean success = false; RDFTranslator translator = null; - + try { OWLOntology ontology = createOntology(manager, axiom); - translator = new RDFTranslator(repository, manager, ontology); + translator = new RDFTranslator(repository, manager, ontology); ValueFactory rdfFactory = repository.getValueFactory(); RepositoryConnection connection = translator.getConnection(); axiom.accept(translator); - for (OWLEntity entity : axiom.getSignature()) { // why aren't these getting included? - connection.add(rdfFactory.createURI(entity.getIRI().toString()), - rdfFactory.createURI(OWLRDFVocabulary.RDF_TYPE.getIRI().toString()), - rdfFactory.createURI(entity.getEntityType().getVocabulary().getIRI().toString()), - translator.axiomResource); + for (OWLEntity entity : axiom.getSignature()) { // why aren't these getting included? + connection.add(rdfFactory.createIRI(entity.getIRI().toString()), + rdfFactory.createIRI(OWLRDFVocabulary.RDF_TYPE.getIRI().toString()), + rdfFactory.createIRI(entity.getEntityType().getVocabulary().getIRI().toString()), + translator.axiomResource); } Literal hashCodeValue = rdfFactory.createLiteral(axiom.hashCode()); @@ -78,9 +80,7 @@ public static void translate(Repository repository, OWLAxiom axiom, connection.add(translator.axiomResource, sourceOntologyProperty, ontologyRepresentative); success = true; } - catch (RepositoryRuntimeException rre) { - throw rre.getCause(); - } catch (OWLOntologyCreationException e) { + catch (OWLOntologyCreationException e) { throw new RepositoryException(e); } finally { @@ -89,25 +89,31 @@ public static void translate(Repository repository, OWLAxiom axiom, } } if (LOGGER.isDebugEnabled()) { - LOGGER.debug("Finished axiom parse"); + LOGGER.debug("Finished axiom parse"); } } - - private static OWLOntology createOntology(OWLOntologyManager manager, OWLAxiom axiom) throws OWLOntologyCreationException { + + private static OWLOntology createOntology(OWLOntologyManager manager, OWLAxiom axiom) + throws OWLOntologyCreationException + { Set axiomSet = new HashSet<>(); axiomSet.add(axiom); return manager.createOntology(axiomSet); } - private RDFTranslator(Repository repository, OWLOntologyManager manager, OWLOntology ontology) throws RepositoryException { + private RDFTranslator(Repository repository, OWLOntologyManager manager, OWLOntology ontology) + throws RepositoryException + { super(manager, ontology, false, new OWLAnonymousIndividualsWithMultipleOccurrences()); rdfFactory = repository.getValueFactory(); - axiomResource = rdfFactory.createURI(OwlTripleStoreImpl.NS + "/" + UUID.randomUUID().toString().replace('-', '_')); + axiomResource = rdfFactory.createIRI( + OwlTripleStoreImpl.NS + "/" + UUID.randomUUID().toString().replace('-', '_')); connection = repository.getConnection(); } - - public void close(boolean success) throws RepositoryException { + public void close(boolean success) + throws RepositoryException + { if (success) { connection.commit(); } @@ -116,23 +122,23 @@ public void close(boolean success) throws RepositoryException { } connection.close(); } - + public RepositoryConnection getConnection() { return connection; } - - public URI getAxiomResource() { + + public IRI getAxiomResource() { return axiomResource; } @Override - protected URI getResourceNode(IRI iri) { - return rdfFactory.createURI(iri.toString()); + protected IRI getResourceNode(org.semanticweb.owlapi.model.IRI iri) { + return rdfFactory.createIRI(iri.toString()); } @Override - protected URI getPredicateNode(IRI iri) { - return rdfFactory.createURI(iri.toString()); + protected IRI getPredicateNode(org.semanticweb.owlapi.model.IRI iri) { + return rdfFactory.createIRI(iri.toString()); } @Override @@ -145,11 +151,11 @@ protected BNode getAnonymousNode(Object key) { return node; } -// @Nonnull -// @Override -// protected Resource getAnonymousNodeForExpressions(@Nonnull Object o) { -// return rdfFactory.createBNode(); -// } + // @Nonnull + // @Override + // protected Resource getAnonymousNodeForExpressions(@Nonnull Object o) { + // return rdfFactory.createBNode(); + // } @Override protected Literal getLiteralNode(OWLLiteral literal) { @@ -160,22 +166,17 @@ else if (literal.isRDFPlainLiteral()) { return rdfFactory.createLiteral(literal.getLiteral()); } else { - return rdfFactory.createLiteral(literal.getLiteral(), rdfFactory.createURI(literal.getDatatype().getIRI().toString())); + return rdfFactory.createLiteral(literal.getLiteral(), + rdfFactory.createIRI(literal.getDatatype().getIRI().toString())); } } @Override - protected void addTriple(Resource subject, URI pred, Value object) { - try { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("Inserting triple into graph with name " + axiomResource); - LOGGER.debug("\t" + subject + ", " + pred + ", " + object); - } - connection.add(subject, pred, object, axiomResource); - } - catch (RepositoryException e) { - throw new RepositoryRuntimeException(e); + protected void addTriple(Resource subject, IRI pred, Value object) { + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("Inserting triple into graph with name " + axiomResource); + LOGGER.debug("\t" + subject + ", " + pred + ", " + object); } + connection.add(subject, pred, object, axiomResource); } - } diff --git a/src/main/java/org/protege/owl/rdf/impl/RepositoryRuntimeException.java b/src/main/java/org/protege/owl/rdf/impl/RepositoryRuntimeException.java deleted file mode 100644 index f0131f0..0000000 --- a/src/main/java/org/protege/owl/rdf/impl/RepositoryRuntimeException.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.protege.owl.rdf.impl; - -import org.eclipse.rdf4j.repository.RepositoryException; - -public class RepositoryRuntimeException extends RuntimeException { - private static final long serialVersionUID = -7871457225828300162L; - - public RepositoryRuntimeException(RepositoryException cause) { - super(cause); - } - - @Override - public RepositoryException getCause() { - return (RepositoryException) super.getCause(); - } -}