Class RDFPatchOps

java.lang.Object
org.apache.jena.rdfpatch.RDFPatchOps

public class RDFPatchOps extends Object
  • Field Details

    • namespace

      public static String namespace
  • Constructor Details

    • RDFPatchOps

      public RDFPatchOps()
  • Method Details

    • fileToPatch

      public static RDFPatch fileToPatch(String filename)
      Read an RDFPatch from a file.
    • nullPatch

      public static RDFPatch nullPatch()
      A immutable "nullop" patch - no transaction, no id.
    • emptyPatch

      public static RDFPatch emptyPatch()
      An immutable "empty" patch - a single transaction of no changes. Each call generates a new empty patch with a different id.
    • summary

      public static PatchSummary summary(RDFPatch patch)
      Create a brief summary of a patch.

      This function plays the patch.

    • collect

      public static RDFPatch collect(RDFPatch patch)
      Make sure a patch has been read from its input. The returned RDFPatch is not connected to an external resource like an InputStream.
    • build

      public static RDFPatch build(Consumer<RDFChangesCollector> filler)
      Build a patch.
    • rdf2patch

      public static RDFPatch rdf2patch(String rdfDataFile)
    • withPrev

      public static RDFPatch withPrev(RDFPatch body, org.apache.jena.graph.Node prev)
      Create a patch with a specified "prev".
    • withPrev

      public static RDFPatch withPrev(RDFPatch patch, RDFPatch prevPatch)
      Create a patch with body from "patch" and previous set to the id of "prevPatch".
    • withHeader

      public static RDFPatch withHeader(RDFPatch body, org.apache.jena.graph.Node id, org.apache.jena.graph.Node prev)
      Create a patch with the id and prev as as given in the arguments, ignoring any header in the body patch.
    • withHeader

      public static RDFPatch withHeader(PatchHeader header, RDFPatch body)
      Create a patch with the header and body as given in the arguments, ignoring any header in the body patch.
    • makeHeader

      public static PatchHeader makeHeader(org.apache.jena.graph.Node id, org.apache.jena.graph.Node prev)
      Match a patch header with the given id and prev. Prev may be null.
    • read

      public static RDFPatch read(InputStream input)
      Read an RDFPatch from a file in text format Throws PatchException on patch parse error.
    • read

      public static RDFPatch read(InputStream input, org.apache.jena.riot.system.ErrorHandler errorHandler)
    • read

      public static RDFPatch read(String filename)
      Read an RDFPatch from a file.
    • readBinary

      public static RDFPatch readBinary(InputStream input)
      Read an RDFPatch from an input stream in binary format.
    • readBinary

      public static RDFPatch readBinary(String filename)
      Read an RDFPatch from a file.
    • readHeader

      public static PatchHeader readHeader(InputStream input)
      Read an RDFPatch header.
    • applyChange

      public static void applyChange(org.apache.jena.sparql.core.DatasetGraph dsg, RDFPatch patch)
      Apply changes from a RDFPatch to a DatasetGraph
    • applyChange

      public static void applyChange(org.apache.jena.sparql.core.DatasetGraph dsg, InputStream input)
      Apply changes from a text format input stream to a DatasetGraph
    • applyChange

      public static void applyChange(org.apache.jena.graph.Graph graph, RDFPatch patch)
      Apply changes from a RDFPatch to a Graph
    • applyChange

      public static void applyChange(org.apache.jena.graph.Graph graph, InputStream input)
      Apply changes from a text format input stream to a Graph
    • changes

      public static org.apache.jena.sparql.core.DatasetGraph changes(org.apache.jena.sparql.core.DatasetGraph dsgBase, RDFChanges changes)
      Create a DatasetGraph that sends changes to a RDFChanges stream
    • changesPrinter

      public static RDFChanges changesPrinter()
      An RDFChanges that prints debug information to System.out. Output is for debugging - it is not legal text patch syntax.
    • textWriter

      public static RDFChangesWriterText textWriter(OutputStream output)
      An RDFChanges that prints RDFPatch syntax to an OutputStream in text format. The application must call RDFChanges.start and RDFChanges.finish.
    • changes

      public static org.apache.jena.graph.Graph changes(org.apache.jena.graph.Graph graphBase, RDFChanges changes)
      Create a Graph that sends changes to a RDFChanges stream
    • textWriter

      public static org.apache.jena.sparql.core.DatasetGraph textWriter(org.apache.jena.sparql.core.DatasetGraph dsgBase, OutputStream out)
      Create a DatasetGraph that writes changes to an OutputStream in text format. The caller is responsible for closing the OutputStream.
    • textWriter

      public static org.apache.jena.graph.Graph textWriter(org.apache.jena.graph.Graph graph, OutputStream out)
      Create a Graph that writes changes to an OutputStream in text format. The caller is responsible for closing the OutputStream.
    • write

      public static void write(OutputStream out, RDFPatch patch)
      Write a RDFPatch in text format
    • writeBinary

      public static void writeBinary(OutputStream out, RDFPatch patch)
      Write a RDFPatch in binary format
    • write

      public static org.apache.jena.riot.system.StreamRDF write(OutputStream out)
      Write an StreamRDF out in RDFPatch text format. StreamRDF.start() and StreamRDF.finish() must be called; these bracket the patch in transaction markers TX and TC.
    • writeBinary

      public static void writeBinary(OutputStream out, Consumer<org.apache.jena.riot.system.StreamRDF> action)
      Provide an StreamRDF that will output in RDFPatch binary format. StreamRDF.start() and StreamRDF.finish() must be called; these bracket the patch in transaction markers TX and TC.
    • str

      public static String str(RDFPatch patch)