edu.cornell.mannlib.vitro.webapp.rdfservice
Interface ChangeSet


public interface ChangeSet

Input parameter to changeSetUpdate() method in RDFService. Represents a precondition query and an ordered list of model changes.


Method Summary
 void addAddition(java.io.InputStream model, RDFService.ModelSerializationFormat serializationFormat, java.lang.String graphURI)
          Adds one model change representing an addition to the list of model changes
 void addPostChangeEvent(java.lang.Object event)
          Adds an event that will be be passed to any change listeners after all of the change set additions and retractions are performed.
 void addPreChangeEvent(java.lang.Object event)
          Adds an event that will be be passed to any change listeners in advance of the change set additions and retractions being performed.
 void addRemoval(java.io.InputStream model, RDFService.ModelSerializationFormat serializationFormat, java.lang.String graphURI)
          Adds one model change representing a deletion to the list of model changes
 java.util.List<ModelChange> getModelChanges()
           
 java.util.List<java.lang.Object> getPostChangeEvents()
          Returns a list of events to pass to any change listeners after the change set additions and retractions are performed.
 java.util.List<java.lang.Object> getPreChangeEvents()
          Returns a list of events to pass to any change listeners in advance of the change set additions and retractions being performed.
 java.lang.String getPreconditionQuery()
           
 RDFService.SPARQLQueryType getPreconditionQueryType()
           
 ModelChange manufactureModelChange()
          Creates an instance of the ModelChange class
 ModelChange manufactureModelChange(java.io.InputStream serializedModel, RDFService.ModelSerializationFormat serializationFormat, ModelChange.Operation operation, java.lang.String graphURI)
          Creates an instance of the ModelChange class
 void setPreconditionQuery(java.lang.String preconditionQuery)
           
 void setPreconditionQueryType(RDFService.SPARQLQueryType queryType)
           
 

Method Detail

getPreconditionQuery

java.lang.String getPreconditionQuery()
Returns:
String - a SPARQL query

setPreconditionQuery

void setPreconditionQuery(java.lang.String preconditionQuery)
Parameters:
preconditionQuery - - a SPARQL query

getPreconditionQueryType

RDFService.SPARQLQueryType getPreconditionQueryType()
Returns:
RDFService.SPARQLQueryType - the precondition query type

setPreconditionQueryType

void setPreconditionQueryType(RDFService.SPARQLQueryType queryType)
Parameters:
queryType - - the precondition query type

getModelChanges

java.util.List<ModelChange> getModelChanges()
Returns:
List - list of model changes

addAddition

void addAddition(java.io.InputStream model,
                 RDFService.ModelSerializationFormat serializationFormat,
                 java.lang.String graphURI)
Adds one model change representing an addition to the list of model changes

Parameters:
model - - a serialized RDF model (collection of triples)
serializationFormat - - format of the serialized RDF model
graphURI - - URI of the graph to which the RDF model should be added

addRemoval

void addRemoval(java.io.InputStream model,
                RDFService.ModelSerializationFormat serializationFormat,
                java.lang.String graphURI)
Adds one model change representing a deletion to the list of model changes

Parameters:
model - - a serialized RDF model (collection of triples)
serializationFormat - - format of the serialized RDF model
graphURI - - URI of the graph from which the RDF model should be removed

manufactureModelChange

ModelChange manufactureModelChange()
Creates an instance of the ModelChange class

Returns:
ModelChange - an empty instance of the ModelChange class

manufactureModelChange

ModelChange manufactureModelChange(java.io.InputStream serializedModel,
                                   RDFService.ModelSerializationFormat serializationFormat,
                                   ModelChange.Operation operation,
                                   java.lang.String graphURI)
Creates an instance of the ModelChange class

Parameters:
serializedModel - - a serialized RDF model (collection of triples)
serializationFormat - - format of the serialized RDF model
operation - - the type of operation to be performed with the serialized RDF model
graphURI - - URI of the graph on which to apply the model change operation
Returns:
ModelChange - a ModelChange instance initialized with the input model, model format, operation and graphURI

addPreChangeEvent

void addPreChangeEvent(java.lang.Object event)
Adds an event that will be be passed to any change listeners in advance of the change set additions and retractions being performed. The event will only be fired if the precondition (if any) is met.

Parameters:
event - - event to notify listeners of in advance of making changes to the triple store.

addPostChangeEvent

void addPostChangeEvent(java.lang.Object event)
Adds an event that will be be passed to any change listeners after all of the change set additions and retractions are performed.

Parameters:
event - - the event to notify listeners of after the changes are performed.

getPreChangeEvents

java.util.List<java.lang.Object> getPreChangeEvents()
Returns a list of events to pass to any change listeners in advance of the change set additions and retractions being performed.

Returns:
List

getPostChangeEvents

java.util.List<java.lang.Object> getPostChangeEvents()
Returns a list of events to pass to any change listeners after the change set additions and retractions are performed.

Returns:
List