All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ontoware.rdf2go.model.ModelAddRemove Maven / Gradle / Ivy

Go to download

RDF2go is an implementation-independent Java API with the design goals: portability (hence the name), performance and ease of implementation. This project was started at FZI Forschungszentrum Informatik Karlsruhe, Germany - www.fzi.de

The newest version!
/**
 * LICENSE INFORMATION
 *
 * Copyright 2005-2008 by FZI (http://www.fzi.de).
 * Licensed under a BSD license (http://www.opensource.org/licenses/bsd-license.php)
 *  = Max Völkel
 *  = FZI Forschungszentrum Informatik Karlsruhe, Karlsruhe, Germany
 *  = 2010
 *
 * Further project information at http://semanticweb.org/wiki/RDF2Go
 */

package org.ontoware.rdf2go.model;

import java.util.Iterator;

import org.ontoware.aifbcommons.collection.ClosableIterable;
import org.ontoware.rdf2go.exception.ModelRuntimeException;
import org.ontoware.rdf2go.model.node.Node;
import org.ontoware.rdf2go.model.node.Resource;
import org.ontoware.rdf2go.model.node.URI;

/**
 * Can remove statements and apply diffs in one atomic operation.
 * 
 * @author voelkel
 */
public interface ModelAddRemove extends ClosableIterable,
		ModelWriter, Lockable {

	// ////////////
	// diffing

	/**
	 * Apply the changes given by this diff in one atomic operation
	 * 
	 * Implementations must check that all statements to be removed are still in
	 * the Model. Otherwise an exception is thrown.
	 * 
	 * First all triples to be removed are removed, then triples to be added are
	 * added.
	 * 
	 * @param diff
	 * @throws ModelRuntimeException
	 */
	void update(DiffReader diff) throws ModelRuntimeException;

	/**
	 * @param statements
	 * @return a Diff between this model and the statements given in the
	 *         iterator
	 * @throws ModelRuntimeException
	 */
	Diff getDiff(Iterator statements)
			throws ModelRuntimeException;

	/**
	 * Removes all statements from this model.
	 * 
	 * @throws ModelRuntimeException
	 */
	void removeAll() throws ModelRuntimeException;

	/**
	 * Removes all statements contained in 'other' from this model =
	 * 'difference'
	 * 
	 * @param other
	 *            another RDF2GO model
	 * @throws ModelRuntimeException
	 */
	void removeAll(Iterator statements)
			throws ModelRuntimeException;

	// /////////////////
	// remove

	/**
	 * remove a (subject, property ,object)-statement from the model
	 * 
	 * @param subject
	 *            URI or Object (= blankNode)
	 * @param predicate
	 * @param object
	 *            URI or String (=plainLiteral) or BlankNode (=blankNode) or
	 *            TypedLiteral or LanguageTagLiteral
	 * @throws ModelRuntimeException
	 */
	void removeStatement(Resource subject, URI predicate, Node object)
			throws ModelRuntimeException;

	void removeStatement(Resource subject, URI predicate, String literal)
			throws ModelRuntimeException;

	/**
	 * remove a (subject, property ,literal, language tag)-statement from the
	 * model
	 * 
	 * @param subject
	 * @param predicate
	 * @param literal
	 * @param languageTag
	 * @throws ModelRuntimeException
	 */
	void removeStatement(Resource subject, URI predicate, String literal,
			String languageTag) throws ModelRuntimeException;

	/**
	 * remove a (subject, property ,literal, datatype)-statement from the model
	 * 
	 * datatype often is an uri for a xml schema datatype (xsd)
	 * 
	 * @param subject
	 * @param predicate
	 * @param literal
	 * @param datatypeURI
	 * @throws ModelRuntimeException
	 */
	void removeStatement(Resource subject, URI predicate, String literal,
			URI datatypeURI) throws ModelRuntimeException;

	/**
	 * remove a rdf2go-statement from the model
	 * 
	 * @param statement
	 * @throws ModelRuntimeException
	 */
	void removeStatement(Statement statement) throws ModelRuntimeException;

	void removeStatement(String subjectURIString, URI predicate, String literal)
			throws ModelRuntimeException;

	/**
	 * remove a (subject, property ,literal, language tag)-statement from the
	 * model
	 * 
	 * @param subject
	 * @param predicate
	 * @param literal
	 * @param languageTag
	 * @throws ModelRuntimeException
	 */
	void removeStatement(String subjectURIString, URI predicate,
			String literal, String languageTag) throws ModelRuntimeException;

	/**
	 * remove a (subject, property ,literal, datatype)-statement from the model
	 * 
	 * datatype often is an uri for a xml schema datatype (xsd)
	 * 
	 * @param subject
	 * @param predicate
	 * @param literal
	 * @param datatypeURI
	 * @throws ModelRuntimeException
	 */
	void removeStatement(String subjectURIString, URI predicate,
			String literal, URI datatypeURI) throws ModelRuntimeException;

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy