diff --git a/src/uloimport/.gitignore b/src/uloimport/.gitignore deleted file mode 100644 index 5bd05d6255ea4f4745a74ec86304c3b02b903068..0000000000000000000000000000000000000000 --- a/src/uloimport/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -target -.idea \ No newline at end of file diff --git a/src/uloimport/pom.xml b/src/uloimport/pom.xml deleted file mode 100644 index 13ea6732496af72a39ad8df87d0256d207e13170..0000000000000000000000000000000000000000 --- a/src/uloimport/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>info.kwarc.uloimport</groupId> - <artifactId>uloimport</artifactId> - <version>indev</version> - - <properties> - <!-- https://stackoverflow.com/questions/59601077/intellij-errorjava-error-release-version-5-not-supported --> - <maven.compiler.source>1.11</maven.compiler.source> - <maven.compiler.target>1.11</maven.compiler.target> - </properties> - - <dependencies> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-core</artifactId> - <version>1.2.3</version> - </dependency> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - <version>29.0-jre</version> - </dependency> - <dependency> - <groupId>com.ontotext.graphdb</groupId> - <artifactId>graphdb-free-runtime</artifactId> - <version>9.2.0</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.7.30</version> - </dependency> - </dependencies> -</project> \ No newline at end of file diff --git a/src/uloimport/src/main/java/info/kwarc/uloimport/Main.java b/src/uloimport/src/main/java/info/kwarc/uloimport/Main.java deleted file mode 100644 index d04a07ecfdcc4b8764f50b0dbc653375204475c1..0000000000000000000000000000000000000000 --- a/src/uloimport/src/main/java/info/kwarc/uloimport/Main.java +++ /dev/null @@ -1,7 +0,0 @@ -package info.kwarc.uloimport; - -public class Main { - public static void main(String[] args) { - System.out.println("Hello, World!"); - } -} diff --git a/src/uloimport/src/main/java/info/kwarc/uloimport/importer/GraphDbImporter.java b/src/uloimport/src/main/java/info/kwarc/uloimport/importer/GraphDbImporter.java deleted file mode 100644 index f97bd19b63828e29e476dcafba896da7b72d8f45..0000000000000000000000000000000000000000 --- a/src/uloimport/src/main/java/info/kwarc/uloimport/importer/GraphDbImporter.java +++ /dev/null @@ -1,54 +0,0 @@ -package info.kwarc.uloimport.importer; - -import org.eclipse.rdf4j.repository.Repository; -import org.eclipse.rdf4j.repository.RepositoryConnection; -import org.eclipse.rdf4j.repository.manager.RemoteRepositoryManager; -import org.eclipse.rdf4j.repository.manager.RepositoryManager; - -import java.io.InputStream; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * {@link Importer} that uploads imported data to a GraphDB instance. - */ -public class GraphDbImporter implements Importer { - private final String serverUrl; - private final String repository; - - /** - * Construct a new GraphDbImporter that imports its data to a remote - * GraphDB instance. - * - * @param serverUrl The URL under which GraphDB is running. - * @param repository The name of the repository to dump to. - */ - public GraphDbImporter(String serverUrl, String repository) { - this.serverUrl = checkNotNull(serverUrl); - this.repository = checkNotNull(repository); - } - - @Override - public void importRdfFile(InputStream is) throws ImportException { - final RepositoryManager manager; - final Repository repository; - final RepositoryConnection connection; - - try { - manager = new RemoteRepositoryManager(this.serverUrl); - manager.init(); - - repository = manager.getRepository(this.repository); - if (repository == null) { - throw new ImportException("could not connect to repository=%s", this.repository); - } - - connection = repository.getConnection(); - } catch (Exception e) { - throw new ImportException("could not initialize database connection", e); - } - - // TODO: Handle errors during initialization. This is quite annoying - // to do with this API. - } -} diff --git a/src/uloimport/src/main/java/info/kwarc/uloimport/importer/ImportException.java b/src/uloimport/src/main/java/info/kwarc/uloimport/importer/ImportException.java deleted file mode 100644 index dfd16b773bbeaf6a4a65e2065250c48ff59b69cf..0000000000000000000000000000000000000000 --- a/src/uloimport/src/main/java/info/kwarc/uloimport/importer/ImportException.java +++ /dev/null @@ -1,36 +0,0 @@ -package info.kwarc.uloimport.importer; - -/** - * An Exception caused by an import of ULO/RDF data. - */ -public class ImportException extends RuntimeException { - /** - * Construct a new {@link ImportException} with just a message. - * - * @param message The message associated with this exception. - */ - public ImportException(String message) { - super(message); - } - - /** - * Construct a new {@link ImportException} with a formatted message. - * - * @param format Format string of the message. - * @param args Arguments for the format string. - */ - public ImportException(String format, Object... args) { - super(String.format(format, args)); - } - - /** - * Construct a new {@link ImportException} with a message and a cause - * that caused this exception. - * - * @param message The message associated with this exception. - * @param cause The underlying cause of the import error. - */ - public ImportException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/src/uloimport/src/main/java/info/kwarc/uloimport/importer/Importer.java b/src/uloimport/src/main/java/info/kwarc/uloimport/importer/Importer.java deleted file mode 100644 index 2727ac8056c5424af6eb8fe0df3dafbafc3e29e8..0000000000000000000000000000000000000000 --- a/src/uloimport/src/main/java/info/kwarc/uloimport/importer/Importer.java +++ /dev/null @@ -1,14 +0,0 @@ -package info.kwarc.uloimport.importer; - -import java.io.InputStream; - -public interface Importer { - /** - * Import the (single) ULO/RDF file at the given input stream to the - * storage underlying this {@link Importer}. - * - * @param is The stream from which to read a single ULO/RDF file. - * @throws ImportException When the import failed. - */ - void importRdfFile(InputStream is) throws ImportException; -}