Search in sources :

Example 91 with URI

use of org.openrdf.model.URI in project gocd by gocd.

the class SesameGraph method remove.

public void remove(Resource tripleSubject, RDFProperty triplePredicate, Resource tripleObject) {
    AbstractSesameResource sesameSubject = (AbstractSesameResource) tripleSubject;
    URI sesameNativePredicate = getSesameNativeProperty(triplePredicate);
    AbstractSesameResource sesameObject = (AbstractSesameResource) tripleObject;
    try {
        conn.remove(sesameSubject.getSesameNativeResource(), sesameNativePredicate, sesameObject.getSesameNativeResource(), contextResource);
    } catch (RepositoryException e) {
        throw new ShineRuntimeException(e);
    }
}
Also used : ShineRuntimeException(com.thoughtworks.studios.shine.ShineRuntimeException) RepositoryException(org.openrdf.repository.RepositoryException) URI(org.openrdf.model.URI)

Example 92 with URI

use of org.openrdf.model.URI in project gocd by gocd.

the class SesameGraph method addStatement.

public void addStatement(Resource subject, RDFProperty predicate, Integer object) {
    AbstractSesameResource sesameSubject = (AbstractSesameResource) subject;
    URI sesameNativePredicate = getSesameNativeProperty(predicate);
    try {
        conn.add(sesameSubject.getSesameNativeResource(), sesameNativePredicate, conn.getValueFactory().createLiteral(String.valueOf(object), XMLSchema.INTEGER), contextResource);
    } catch (RepositoryException e) {
        throw new ShineRuntimeException("Could not add statement << [" + subject + "] [" + predicate + "] [" + object + "] >>", e);
    }
}
Also used : ShineRuntimeException(com.thoughtworks.studios.shine.ShineRuntimeException) RepositoryException(org.openrdf.repository.RepositoryException) URI(org.openrdf.model.URI)

Example 93 with URI

use of org.openrdf.model.URI in project gocd by gocd.

the class SesameGraph method addStatement.

public void addStatement(Resource subject, RDFProperty predicate, Boolean object) {
    AbstractSesameResource sesameSubject = (AbstractSesameResource) subject;
    URI sesameNativePredicate = getSesameNativeProperty(predicate);
    try {
        conn.add(sesameSubject.getSesameNativeResource(), sesameNativePredicate, conn.getValueFactory().createLiteral(String.valueOf(object), XMLSchema.BOOLEAN), contextResource);
    } catch (RepositoryException e) {
        throw new ShineRuntimeException("Could not add statement << [" + subject + "] [" + predicate + "] [" + object + "] >>", e);
    }
}
Also used : ShineRuntimeException(com.thoughtworks.studios.shine.ShineRuntimeException) RepositoryException(org.openrdf.repository.RepositoryException) URI(org.openrdf.model.URI)

Example 94 with URI

use of org.openrdf.model.URI in project gocd by gocd.

the class SesameGraph method addStatement.

public void addStatement(Resource subject, RDFProperty predicate, Resource object) {
    AbstractSesameResource sesameSubject = (AbstractSesameResource) subject;
    URI sesameNativePredicate = getSesameNativeProperty(predicate);
    AbstractSesameResource sesameObject = (AbstractSesameResource) object;
    try {
        conn.add(sesameSubject.getSesameNativeResource(), sesameNativePredicate, sesameObject.getSesameNativeResource(), contextResource);
    } catch (RepositoryException e) {
        throw new ShineRuntimeException("Could not add statement << [" + subject + "] [" + predicate + "] [" + object + "] >>", e);
    }
}
Also used : ShineRuntimeException(com.thoughtworks.studios.shine.ShineRuntimeException) RepositoryException(org.openrdf.repository.RepositoryException) URI(org.openrdf.model.URI)

Example 95 with URI

use of org.openrdf.model.URI in project gocd by gocd.

the class SesameGraph method remove.

public void remove(Resource tripleSubject, RDFProperty triplePredicate, String tripleObject) {
    AbstractSesameResource sesameSubject = (AbstractSesameResource) tripleSubject;
    URI sesameNativePredicate = getSesameNativeProperty(triplePredicate);
    try {
        conn.remove(sesameSubject.getSesameNativeResource(), sesameNativePredicate, conn.getValueFactory().createLiteral(tripleObject, XMLSchema.STRING), contextResource);
    } catch (RepositoryException e) {
        throw new ShineRuntimeException(e);
    }
}
Also used : ShineRuntimeException(com.thoughtworks.studios.shine.ShineRuntimeException) RepositoryException(org.openrdf.repository.RepositoryException) URI(org.openrdf.model.URI)

Aggregations

URI (org.openrdf.model.URI)111 Test (org.junit.Test)28 SailConnection (org.openrdf.sail.SailConnection)25 Value (org.openrdf.model.Value)22 Statement (org.openrdf.model.Statement)21 NotifyingSailConnection (org.openrdf.sail.NotifyingSailConnection)21 Resource (org.openrdf.model.Resource)20 Literal (org.openrdf.model.Literal)14 ValueFactory (org.openrdf.model.ValueFactory)12 RepositoryException (org.openrdf.repository.RepositoryException)11 SailException (org.openrdf.sail.SailException)10 ShineRuntimeException (com.thoughtworks.studios.shine.ShineRuntimeException)8 Vertex (com.tinkerpop.blueprints.Vertex)7 HashSet (java.util.HashSet)7 Representation (org.apache.stanbol.entityhub.servicesapi.model.Representation)7 Model (org.openrdf.model.Model)7 URIImpl (org.openrdf.model.impl.URIImpl)7 Edge (com.tinkerpop.blueprints.Edge)6 BNode (org.openrdf.model.BNode)6 QueryEvaluationException (org.openrdf.query.QueryEvaluationException)6