Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions backend/conf/config.sample.properties
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ database.rdf.platform = localRDF
#database.rdf.password = dba
# }

# or GraphDB {
# database.rdf.platform = graphdb
# database.rdf.url = http://localhost:7200
# database.rdf.user = admin
# database.rdf.password = admin
# }


# Administrator contact email for sending reports and failure notifications
email.enabled = false
email.admin = admin@example.com
Expand Down
5 changes: 5 additions & 0 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@
<artifactId>jetty-server</artifactId>
<version>${jetty.server.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.8.3</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
package cz.cuni.mff.xrg.odcs.commons.app.rdf;

import java.io.File;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.PostConstruct;
import cz.cuni.mff.xrg.odcs.commons.app.resource.MissingResourceException;
import cz.cuni.mff.xrg.odcs.commons.app.resource.ResourceManager;
import eu.unifiedviews.commons.rdf.repository.ManagableRepository;
import eu.unifiedviews.commons.rdf.repository.RDFException;
import eu.unifiedviews.commons.rdf.repository.RepositoryFactory;
import org.openrdf.repository.Repository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

import cz.cuni.mff.xrg.odcs.commons.app.resource.MissingResourceException;
import cz.cuni.mff.xrg.odcs.commons.app.resource.ResourceManager;
import eu.unifiedviews.commons.rdf.repository.ManagableRepository;
import eu.unifiedviews.commons.rdf.repository.RDFException;
import eu.unifiedviews.commons.rdf.repository.RepositoryFactory;
import javax.annotation.PostConstruct;
import java.io.File;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
* Provide access to repositories.
Expand Down Expand Up @@ -87,6 +86,9 @@ protected void init() {
case "remoteRDF":
repositoryType = ManagableRepository.Type.REMOTE_RDF;
break;
case "graphdb":
repositoryType = ManagableRepository.Type.GRAPHDB;
break;
default:
throw new RuntimeException("Unknown repository type.");
}
Expand Down
17 changes: 17 additions & 0 deletions dataunit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,21 @@
<artifactId>com.openlinksw.virtuoso.virtjdbc4_1</artifactId>
<version>${virtuoso.jdbc.version}</version>
</dependency>

<!--
<dependency>
<groupId>com.complexible.stardog</groupId>
<artifactId>client-http</artifactId>
<version>4.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.complexible.stardog.sesame</groupId>
<artifactId>stardog-sesame-core</artifactId>
<version>4.2</version>
</dependency> -->


</dependencies>

<build>
Expand All @@ -279,4 +294,6 @@
</plugin>
</plugins>
</build>


</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package eu.unifiedviews.commons.rdf.repository;

import eu.unifiedviews.commons.dataunit.core.ConnectionSource;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.manager.RemoteRepositoryManager;
import org.openrdf.repository.manager.RepositoryManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Collection;

/**
* Created by tomasknap on 09/01/17.
*/
public class GraphDB implements ManagableRepository {

private static final Logger log = LoggerFactory.getLogger(GraphDB.class);

private Repository repository = null;


public GraphDB(String url, String user, String password) throws RDFException {

// String port = url.substring(url.lastIndexOf(":")+1);
// int portNumber = Integer.valueOf(port);
// log.info("Port number: {}", portNumber);
//
// String host = url.substring(0,url.lastIndexOf(":"));
// log.info("Host: {}", host);

// Repository repository = new StardogRepository(ConnectionConfiguration.to("uv").credentials(user, password));

// Instantiate a local repository manager and initialize it
RepositoryManager repositoryManager = new RemoteRepositoryManager(url);
try {
repositoryManager.initialize();

Collection<Repository> allRepositories = repositoryManager.getAllRepositories();

this.repository = repositoryManager.getRepository("uv");

// Repository repository = new HTTPRepository(url, "uv");

} catch (RepositoryException ex) {
throw new RDFException("Could not initialize repository", ex);
} catch (Exception e) {
log.error(e.getLocalizedMessage(),e);
}



try {
repository.initialize();
} catch (RepositoryException ex) {
throw new RDFException("Could not initialize repository", ex);
}
}

@Override
public ConnectionSource getConnectionSource() {
return new ConnectionSourceImpl(repository, false);
}

@Override
public void release() throws RDFException {
try {
repository.shutDown();
} catch (RepositoryException ex) {
throw new RDFException("Can't shutDown repository.", ex);
}

}

@Override
public void delete() throws RDFException {
// Do nothing here.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public static enum Type {
LOCAL_RDF,
INMEMORY_RDF,
REMOTE_RDF,
VIRTUOSO
VIRTUOSO,
GRAPHDB
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public ManagableRepository create(Long executionId, ManagableRepository.Type typ
case VIRTUOSO:
repository = new Virtuoso(uri, user, password);
break;
case GRAPHDB:
repository = new GraphDB(uri, user, password);
break;
default:
throw new RDFException("Unknown repository type: " + type.toString());
}
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/main/webapp/WEB-INF/config.sample.properties
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ database.rdf.platform = localRDF
#database.rdf.password = dba
# }

# or GraphDB {
# database.rdf.platform = graphdb
# database.rdf.url = http://localhost:7200
# database.rdf.user = admin
# database.rdf.password = admin
# }


# Administrator contact email for sending reports and failure notifications
email.enabled = false
Expand Down
6 changes: 3 additions & 3 deletions lib/lib-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.6.0</version>
<version>2.8.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.6.0</version>
<version>2.8.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.6.0</version>
<version>2.8.3</version>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
Expand Down
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,20 @@
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>

<!--
<repository>
<id>stardog-public</id>
<url>http://maven.stardog.com</url>
</repository> -->

<repository>
<id>ontotex-public</id>
<url>http://maven.ontotext.com/content/groups/all-onto</url>
</repository>



</repositories>

<pluginRepositories>
Expand All @@ -162,6 +176,7 @@
<configuration>
<source>${project.java.source.version}</source>
<target>${project.java.target.version}</target>
<maxmem>1024m</maxmem>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -281,6 +296,7 @@
</plugin>

</plugins>

</build>

<profiles>
Expand Down