com.github.anno4j.TransactionCommands Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of anno4j-core Show documentation
Show all versions of anno4j-core Show documentation
Read and write API for W3C Web Annotation Data Model (http://www.w3.org/TR/annotation-model/) and W3C Open Annotation Data Model (http://www.openannotation.org/spec/core/)
package com.github.anno4j;
import com.github.anno4j.model.impl.ResourceObject;
import com.github.anno4j.querying.QueryService;
import org.openrdf.model.Resource;
import org.openrdf.model.URI;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.object.ObjectRepository;
import java.util.List;
public interface TransactionCommands {
/**
* Writes the resource object to the configured SPARQL endpoint with a corresponding INSERT query.
* @param resource resource object to write to the SPARQL endpoint
* @throws RepositoryException
*/
void persist(ResourceObject resource) throws RepositoryException;
T findByID(Class type, String id) throws RepositoryException;
T findByID(Class type, URI id) throws RepositoryException;
/**
* Removes all triples from the given context.
* @param context context to clear
* @throws RepositoryException
*/
void clearContext(URI context) throws RepositoryException;
/**
* Removes all triples from the given context.
* @param context context to clear
* @throws RepositoryException
*/
void clearContext(String context) throws RepositoryException;
/**
* Queries for all instances of the RDF class connected with the given class
* @param type Class with connected RDF type
* @return All instances of the given RDF type
* @throws RepositoryException
*/
List findAll(Class type) throws RepositoryException;
/**
* Create query service
*
* @return query service object for specified type
*/
QueryService createQueryService() throws RepositoryException;
T createObject(Class clazz) throws RepositoryException, IllegalAccessException, InstantiationException;
T createObject(Class clazz, Resource id) throws RepositoryException, IllegalAccessException, InstantiationException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy