java.lang.Object
org.apache.jena.rdfpatch.RDFPatchOps
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyChange
(org.apache.jena.graph.Graph graph, InputStream input) Apply changes from a text format input stream to aGraph
static void
applyChange
(org.apache.jena.graph.Graph graph, RDFPatch patch) Apply changes from aRDFPatch
to aGraph
static void
applyChange
(org.apache.jena.sparql.core.DatasetGraph dsg, InputStream input) Apply changes from a text format input stream to aDatasetGraph
static void
applyChange
(org.apache.jena.sparql.core.DatasetGraph dsg, RDFPatch patch) Apply changes from aRDFPatch
to aDatasetGraph
static RDFPatch
build
(Consumer<RDFChangesCollector> filler) Build a patch.static org.apache.jena.graph.Graph
changes
(org.apache.jena.graph.Graph graphBase, RDFChanges changes) Create aGraph
that sends changes to aRDFChanges
streamstatic org.apache.jena.sparql.core.DatasetGraph
changes
(org.apache.jena.sparql.core.DatasetGraph dsgBase, RDFChanges changes) Create aDatasetGraph
that sends changes to aRDFChanges
streamstatic RDFChanges
AnRDFChanges
that prints debug information toSystem.out
.static RDFPatch
Make sure a patch has been read from its input.static RDFPatch
An immutable "empty" patch - a single transaction of no changes.static RDFPatch
fileToPatch
(String filename) Read anRDFPatch
from a file.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.static RDFPatch
A immutable "nullop" patch - no transaction, no id.static RDFPatch
RDF data file to patch.static RDFPatch
read
(InputStream input) Read anRDFPatch
from a file in text format ThrowsPatchException
on patch parse error.static RDFPatch
read
(InputStream input, org.apache.jena.riot.system.ErrorHandler errorHandler) static RDFPatch
Read anRDFPatch
from a file.static RDFPatch
readBinary
(InputStream input) Read anRDFPatch
from an input stream in binary format.static RDFPatch
readBinary
(String filename) Read anRDFPatch
from a file.static PatchHeader
readHeader
(InputStream input) Read anRDFPatch
header.static String
static PatchSummary
Create a brief summary of a patch.static RDFChangesWriterText
textWriter
(OutputStream output) AnRDFChanges
that prints RDFPatch syntax to anOutputStream
in text format.static org.apache.jena.graph.Graph
textWriter
(org.apache.jena.graph.Graph graph, OutputStream out) Create aGraph
that writes changes to anOutputStream
in text format.static org.apache.jena.sparql.core.DatasetGraph
textWriter
(org.apache.jena.sparql.core.DatasetGraph dsgBase, OutputStream out) Create aDatasetGraph
that writes changes to anOutputStream
in text format.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.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.static RDFPatch
Create a patch with a specified "prev".static RDFPatch
Create a patch with body from "patch" and previous set to the id of "prevPatch".static org.apache.jena.riot.system.StreamRDF
write
(OutputStream out) Write anStreamRDF
out inRDFPatch
text format.static void
write
(OutputStream out, RDFPatch patch) Write aRDFPatch
in text formatstatic void
writeBinary
(OutputStream out, Consumer<org.apache.jena.riot.system.StreamRDF> action) Provide anStreamRDF
that will output in RDFPatch binary format.static void
writeBinary
(OutputStream out, RDFPatch patch) Write aRDFPatch
in binary format
-
Field Details
-
namespace
-
-
Constructor Details
-
RDFPatchOps
public RDFPatchOps()
-
-
Method Details
-
fileToPatch
Read anRDFPatch
from a file. -
nullPatch
A immutable "nullop" patch - no transaction, no id. -
emptyPatch
An immutable "empty" patch - a single transaction of no changes. Each call generates a new empty patch with a different id. -
summary
Create a brief summary of a patch.This function plays the patch.
-
collect
Make sure a patch has been read from its input. The returnedRDFPatch
is not connected to an external resource like anInputStream
. -
build
Build a patch. -
rdf2patch
RDF data file to patch. The patch has no Id or Previous - seewithHeader(org.apache.jena.rdfpatch.RDFPatch, org.apache.jena.graph.Node, org.apache.jena.graph.Node)
. -
withPrev
Create a patch with a specified "prev". -
withPrev
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
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
Read anRDFPatch
from a file in text format ThrowsPatchException
on patch parse error. -
read
public static RDFPatch read(InputStream input, org.apache.jena.riot.system.ErrorHandler errorHandler) -
read
Read anRDFPatch
from a file. -
readBinary
Read anRDFPatch
from an input stream in binary format. -
readBinary
Read anRDFPatch
from a file. -
readHeader
Read anRDFPatch
header. -
applyChange
Apply changes from aRDFPatch
to aDatasetGraph
-
applyChange
Apply changes from a text format input stream to aDatasetGraph
-
applyChange
Apply changes from aRDFPatch
to aGraph
-
applyChange
Apply changes from a text format input stream to aGraph
-
changes
public static org.apache.jena.sparql.core.DatasetGraph changes(org.apache.jena.sparql.core.DatasetGraph dsgBase, RDFChanges changes) Create aDatasetGraph
that sends changes to aRDFChanges
stream -
changesPrinter
AnRDFChanges
that prints debug information toSystem.out
. Output is for debugging - it is not legal text patch syntax. -
textWriter
AnRDFChanges
that prints RDFPatch syntax to anOutputStream
in text format. The application must callRDFChanges.start
andRDFChanges.finish
. -
changes
public static org.apache.jena.graph.Graph changes(org.apache.jena.graph.Graph graphBase, RDFChanges changes) Create aGraph
that sends changes to aRDFChanges
stream -
textWriter
public static org.apache.jena.sparql.core.DatasetGraph textWriter(org.apache.jena.sparql.core.DatasetGraph dsgBase, OutputStream out) Create aDatasetGraph
that writes changes to anOutputStream
in text format. The caller is responsible for closing theOutputStream
. -
textWriter
public static org.apache.jena.graph.Graph textWriter(org.apache.jena.graph.Graph graph, OutputStream out) Create aGraph
that writes changes to anOutputStream
in text format. The caller is responsible for closing theOutputStream
. -
write
Write aRDFPatch
in text format -
writeBinary
Write aRDFPatch
in binary format -
write
Write anStreamRDF
out inRDFPatch
text format.StreamRDF.start()
andStreamRDF.finish()
must be called; these bracket the patch in transaction markersTX
andTC
. -
writeBinary
public static void writeBinary(OutputStream out, Consumer<org.apache.jena.riot.system.StreamRDF> action) Provide anStreamRDF
that will output in RDFPatch binary format.StreamRDF.start()
andStreamRDF.finish()
must be called; these bracket the patch in transaction markersTX
andTC
. -
str
-