diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/ChangeSet.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/ChangeSet.java index 6d98600af..fdb6a2b9e 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/ChangeSet.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/ChangeSet.java @@ -5,8 +5,6 @@ package edu.cornell.mannlib.vitro.webapp.rdfservice; import java.io.InputStream; import java.util.List; -import edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange.Operation; - /* * Input parameter to changeSetUpdate() method in RDFService. * Represents a precondition query and an ordered list of model changes. @@ -14,28 +12,78 @@ import edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange.Operation; public interface ChangeSet { + /** + * Getter for the precondition query + * + * @return String - a SPARQL query + */ public String getPreconditionQuery(); + /** + * Setter for the precondition query + * + * @param String - a SPARQL query + */ public void setPreconditionQuery(String preconditionQuery); + /** + * Getter for the precondition query type + * + * @return RDFService.SPARQLQueryType - the precondition query type + */ public RDFService.SPARQLQueryType getPreconditionQueryType(); + /** + * Setter for the precondition query type + * + * @param RDFService.SPARQLQueryType - the precondition query type + */ public void setPreconditionQueryType(RDFService.SPARQLQueryType queryType); + /** + * Getter for the list of model changes + * + * @return List - list of model changes + */ public List getModelChanges(); + /** + * Adds one model change representing an addition to the list of model changes + * + * @param InputStream - a serialized RDF model (collection of triples) + * @param RDFService.ModelSerializationFormat - format of the serialized RDF model + * @param String - URI of the graph to which the RDF model should be added + */ public void addAddition(InputStream model, RDFService.ModelSerializationFormat format, String graphURI); + /** + * Adds one model change representing a deletion to the list of model changes + * + * @param InputStream - a serialized RDF model (collection of triples) + * @param RDFService.ModelSerializationFormat - format of the serialized RDF model + * @param String - URI of the graph from which the RDF model should be removed + */ public void addRemoval(InputStream model, RDFService.ModelSerializationFormat format, String graphURI); - + + /** + * Creates an instance of the ModelChange class + */ public ModelChange manufactureModelChange(); + /** + * Creates an instance of the ModelChange class + * + * @param InputStream - a serialized RDF model (collection of triples) + * @param RDFService.ModelSerializationFormat - format of the serialized RDF model + * @param ModelChange.Operation - the type of operation to be performed with the serialized RDF model + * @param String - URI of the graph on which to apply the model change operation + */ public ModelChange manufactureModelChange(InputStream serializedModel, RDFService.ModelSerializationFormat serializationFormat, - Operation operation, + ModelChange.Operation operation, String graphURI); } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/impl/ChangeSetImpl.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/impl/ChangeSetImpl.java index 1b1753cad..52f92ab75 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/impl/ChangeSetImpl.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/impl/ChangeSetImpl.java @@ -25,46 +25,96 @@ public class ChangeSetImpl implements ChangeSet { private RDFService.SPARQLQueryType queryType; private ArrayList modelChanges; + /** + * Getter for the precondition query + * + * @return String - a SPARQL query + */ @Override public String getPreconditionQuery() { return preconditionQuery; } + /** + * Setter for the precondition query + * + * @param String - a SPARQL query + */ @Override public void setPreconditionQuery(String preconditionQuery) { this.preconditionQuery = preconditionQuery; } + /** + * Getter for the precondition query type + * + * @return RDFService.SPARQLQueryType - the precondition query type + */ @Override public RDFService.SPARQLQueryType getPreconditionQueryType() { return queryType; } + /** + * Setter for the precondition query type + * + * @param RDFService.SPARQLQueryType - the precondition query type + */ @Override public void setPreconditionQueryType(RDFService.SPARQLQueryType queryType) { this.queryType = queryType; } + /** + * Getter for the list of model changes + * + * @return List - list of model changes + */ @Override public List getModelChanges() { return modelChanges; } + /** + * Adds one model change representing an addition to the list of model changes + * + * @param InputStream - a serialized RDF model (collection of triples) + * @param RDFService.ModelSerializationFormat - format of the serialized RDF model + * @param String - URI of the graph to which the RDF model should be added + */ @Override public void addAddition(InputStream model, RDFService.ModelSerializationFormat format, String graphURI) { modelChanges.add(manufactureModelChange(model,format, ModelChange.Operation.ADD, graphURI)); } + /** + * Adds one model change representing a deletion to the list of model changes + * + * @param InputStream - a serialized RDF model (collection of triples) + * @param RDFService.ModelSerializationFormat - format of the serialized RDF model + * @param String - URI of the graph from which the RDF model should be removed + */ @Override public void addRemoval(InputStream model, RDFService.ModelSerializationFormat format, String graphURI) { modelChanges.add(manufactureModelChange(model, format, ModelChange.Operation.REMOVE, graphURI)); } + /** + * Creates an instance of the ModelChange class + */ @Override public ModelChange manufactureModelChange() { return new ModelChangeImpl(); } - + + /** + * Creates an instance of the ModelChange class + * + * @param InputStream - a serialized RDF model (collection of triples) + * @param RDFService.ModelSerializationFormat - format of the serialized RDF model + * @param ModelChange.Operation - the type of operation to be performed with the serialized RDF model + * @param String - URI of the graph on which to apply the model change operation + */ @Override public ModelChange manufactureModelChange(InputStream serializedModel, RDFService.ModelSerializationFormat serializationFormat, diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/impl/RDFServiceImpl.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/impl/RDFServiceImpl.java index 4e127b9f2..055200ef2 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/impl/RDFServiceImpl.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/rdfservice/impl/RDFServiceImpl.java @@ -57,7 +57,13 @@ public class RDFServiceImpl implements RDFService { /** * Returns an RDFService for a remote repository - * @param endpointURI + * @param String - URI of the SPARQL endpoint for the knowledge base + * @param String - URI of the default write graph within the knowledge base. + * this is the graph that will be written to when a graph + * is not explicitly specified. + * + * The default read graph is the union of all graphs in the + * knowledge base */ public RDFServiceImpl(String endpointURI, String defaultWriteGraphURI) { this.endpointURI = endpointURI;