diff --git a/src/main/java/org/dice_research/enexa/transform/EnexaTransformator.java b/src/main/java/org/dice_research/enexa/transform/EnexaTransformator.java index ec97a8e..aa66cb1 100644 --- a/src/main/java/org/dice_research/enexa/transform/EnexaTransformator.java +++ b/src/main/java/org/dice_research/enexa/transform/EnexaTransformator.java @@ -32,7 +32,6 @@ import org.dice_research.enexa.vocab.IANAMediaType; import org.dice_research.rdf.RdfHelper; import org.dice_research.sparql.SparqlQueryUtils; -import org.semanticweb.owlapi.formats.OWLXMLDocumentFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -134,6 +133,8 @@ public static void main(String[] args) { * @param targetMediaResource * @return */ + @SuppressWarnings("unused") + @Deprecated private static Lang getOutputLang(Resource targetMediaResource) { Lang outputLang = IANAMediaType.resource2Lang(targetMediaResource); // If this is one of the languages we can handle... diff --git a/src/main/java/org/dice_research/enexa/transform/StreamingTransformator.java b/src/main/java/org/dice_research/enexa/transform/StreamingTransformator.java index 6706131..1ae6a43 100644 --- a/src/main/java/org/dice_research/enexa/transform/StreamingTransformator.java +++ b/src/main/java/org/dice_research/enexa/transform/StreamingTransformator.java @@ -1,22 +1,16 @@ package org.dice_research.enexa.transform; import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.util.Random; import javax.annotation.CheckForNull; import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; -import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream; import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream; -import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream; -import org.apache.commons.io.IOUtils; import org.apache.jena.atlas.web.ContentType; import org.apache.jena.atlas.web.TypedInputStream; import org.apache.jena.riot.Lang; @@ -24,7 +18,6 @@ import org.apache.jena.riot.RDFParser; import org.apache.jena.riot.WebContent; import org.apache.jena.riot.system.StreamRDF; -import org.apache.jena.riot.system.StreamRDFWriter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/test/java/org/dice_research/enexa/transform/AbstractTransformatorTest.java b/src/test/java/org/dice_research/enexa/transform/AbstractTransformatorTest.java index f0f08e1..270f282 100644 --- a/src/test/java/org/dice_research/enexa/transform/AbstractTransformatorTest.java +++ b/src/test/java/org/dice_research/enexa/transform/AbstractTransformatorTest.java @@ -47,7 +47,7 @@ public AbstractTransformatorTest(Model expectedModel, String outputFormatIri, Mo this.inputFormatIris = inputFormatIris; this.inputLangs = new Lang[inputFormatIris.length]; // Print information about this test - System.out.println("Test output format: " + IANAMediaType.iri2ContentType(outputFormatIri.toString())); + System.out.println("Test output format: " + IANAMediaType.iri2ContentType(outputFormatIri)); System.out.print(" input formats: "); for (int i = 0; i < inputFormatIris.length; ++i) { inputLangs[i] = IANAMediaType.iri2Lang(inputFormatIris[i]); @@ -59,35 +59,35 @@ public AbstractTransformatorTest(Model expectedModel, String outputFormatIri, Mo } } -// @Test -// public void testCompInFileExt() { -// try { -// createFilesAndTest(true, true); -// } catch (Exception e) { -// e.printStackTrace(); -// Assert.fail(); -// } -// } -// -// @Test -// public void testFileExt() { -// try { -// createFilesAndTest(true, false); -// } catch (Exception e) { -// e.printStackTrace(); -// Assert.fail(); -// } -// } -// -// @Test -// public void testCompIn() { -// try { -// createFilesAndTest(false, true); -// } catch (Exception e) { -// e.printStackTrace(); -// Assert.fail(); -// } -// } + @Test + public void testCompInFileExt() { + try { + createFilesAndTest(true, true); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + + @Test + public void testFileExt() { + try { + createFilesAndTest(true, false); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } + + @Test + public void testCompIn() { + try { + createFilesAndTest(false, true); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } @Test public void test() { diff --git a/src/test/java/org/dice_research/enexa/transform/RDF2OntologyTransformatorTest.java b/src/test/java/org/dice_research/enexa/transform/RDF2OntologyTransformatorTest.java index 67c1ce9..d83663d 100644 --- a/src/test/java/org/dice_research/enexa/transform/RDF2OntologyTransformatorTest.java +++ b/src/test/java/org/dice_research/enexa/transform/RDF2OntologyTransformatorTest.java @@ -25,7 +25,6 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import org.semanticweb.owlapi.apibinding.OWLManager; -import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLAxiom; import org.semanticweb.owlapi.model.OWLOntology; import org.semanticweb.owlapi.model.OWLOntologyCreationException; @@ -51,7 +50,6 @@ public RDF2OntologyTransformatorTest(Model expectedModel, String outputFormatIri @Override protected void compareModels(InputStream is, String outputFormatIri, Model expectedModel) { -// String contentType = IANAMediaType.iri2ContentType(outputFormatIri); try { File expectedFile = File.createTempFile("test-expected-result-", ".nt"); try (Writer writer = new FileWriter(expectedFile, StandardCharsets.UTF_8)) { @@ -71,12 +69,10 @@ protected void compareModels(InputStream is, String outputFormatIri, Model expec OWLOntology readOnt = manager.loadOntologyFromOntologyDocument(is); for (OWLAxiom a : expectedOntology.getAxioms()) { - System.out.println(a); Assert.assertTrue("Read ontology does not contain the expected axiom " + a.toString(), readOnt.containsAxiom(a)); } for (OWLAxiom a : readOnt.getAxioms()) { - System.out.println(a); Assert.assertTrue("Read ontology contains the additional axiom " + a.toString(), expectedOntology.containsAxiom(a)); }