java.lang.Object
org.apache.jena.rdfpatch.RDFPatchOps
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyChange(org.apache.jena.graph.Graph graph, InputStream input) Apply changes from a text format input stream to aGraphstatic voidapplyChange(org.apache.jena.graph.Graph graph, RDFPatch patch) Apply changes from aRDFPatchto aGraphstatic voidapplyChange(org.apache.jena.sparql.core.DatasetGraph dsg, InputStream input) Apply changes from a text format input stream to aDatasetGraphstatic voidapplyChange(org.apache.jena.sparql.core.DatasetGraph dsg, RDFPatch patch) Apply changes from aRDFPatchto aDatasetGraphstatic RDFPatchbuild(Consumer<RDFChangesCollector> filler) Build a patch.static org.apache.jena.graph.Graphchanges(org.apache.jena.graph.Graph graphBase, RDFChanges changes) Create aGraphthat sends changes to aRDFChangesstreamstatic org.apache.jena.sparql.core.DatasetGraphchanges(org.apache.jena.sparql.core.DatasetGraph dsgBase, RDFChanges changes) Create aDatasetGraphthat sends changes to aRDFChangesstreamstatic RDFChangesAnRDFChangesthat prints debug information toSystem.out.static RDFPatchMake sure a patch has been read from its input.static RDFPatchAn immutable "empty" patch - a single transaction of no changes.static RDFPatchfileToPatch(String filename) Read anRDFPatchfrom a file.static PatchHeadermakeHeader(org.apache.jena.graph.Node id, org.apache.jena.graph.Node prev) Match a patch header with the given id and prev.static RDFPatchA immutable "nullop" patch - no transaction, no id.static RDFPatchRDF data file to patch.static RDFPatchread(InputStream input) Read anRDFPatchfrom a file in text format ThrowsPatchExceptionon patch parse error.static RDFPatchread(InputStream input, org.apache.jena.riot.system.ErrorHandler errorHandler) static RDFPatchRead anRDFPatchfrom a file.static RDFPatchreadBinary(InputStream input) Read anRDFPatchfrom an input stream in binary format.static RDFPatchreadBinary(String filename) Read anRDFPatchfrom a file.static PatchHeaderreadHeader(InputStream input) Read anRDFPatchheader.static Stringstatic PatchSummaryCreate a brief summary of a patch.static RDFChangesWriterTexttextWriter(OutputStream output) AnRDFChangesthat prints RDFPatch syntax to anOutputStreamin text format.static org.apache.jena.graph.GraphtextWriter(org.apache.jena.graph.Graph graph, OutputStream out) Create aGraphthat writes changes to anOutputStreamin text format.static org.apache.jena.sparql.core.DatasetGraphtextWriter(org.apache.jena.sparql.core.DatasetGraph dsgBase, OutputStream out) Create aDatasetGraphthat writes changes to anOutputStreamin text format.static RDFPatchwithHeader(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 RDFPatchwithHeader(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 RDFPatchCreate a patch with a specified "prev".static RDFPatchCreate a patch with body from "patch" and previous set to the id of "prevPatch".static org.apache.jena.riot.system.StreamRDFwrite(OutputStream out) Write anStreamRDFout inRDFPatchtext format.static voidwrite(OutputStream out, RDFPatch patch) Write aRDFPatchin text formatstatic voidwriteBinary(OutputStream out, Consumer<org.apache.jena.riot.system.StreamRDF> action) Provide anStreamRDFthat will output in RDFPatch binary format.static voidwriteBinary(OutputStream out, RDFPatch patch) Write aRDFPatchin binary format
-
Field Details
-
namespace
-
-
Constructor Details
-
RDFPatchOps
public RDFPatchOps()
-
-
Method Details
-
fileToPatch
Read anRDFPatchfrom 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 returnedRDFPatchis 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 anRDFPatchfrom a file in text format ThrowsPatchExceptionon patch parse error. -
read
public static RDFPatch read(InputStream input, org.apache.jena.riot.system.ErrorHandler errorHandler) -
read
Read anRDFPatchfrom a file. -
readBinary
Read anRDFPatchfrom an input stream in binary format. -
readBinary
Read anRDFPatchfrom a file. -
readHeader
Read anRDFPatchheader. -
applyChange
Apply changes from aRDFPatchto aDatasetGraph -
applyChange
Apply changes from a text format input stream to aDatasetGraph -
applyChange
Apply changes from aRDFPatchto 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 aDatasetGraphthat sends changes to aRDFChangesstream -
changesPrinter
AnRDFChangesthat prints debug information toSystem.out. Output is for debugging - it is not legal text patch syntax. -
textWriter
AnRDFChangesthat prints RDFPatch syntax to anOutputStreamin text format. The application must callRDFChanges.startandRDFChanges.finish. -
changes
public static org.apache.jena.graph.Graph changes(org.apache.jena.graph.Graph graphBase, RDFChanges changes) Create aGraphthat sends changes to aRDFChangesstream -
textWriter
public static org.apache.jena.sparql.core.DatasetGraph textWriter(org.apache.jena.sparql.core.DatasetGraph dsgBase, OutputStream out) Create aDatasetGraphthat writes changes to anOutputStreamin 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 aGraphthat writes changes to anOutputStreamin text format. The caller is responsible for closing theOutputStream. -
write
Write aRDFPatchin text format -
writeBinary
Write aRDFPatchin binary format -
write
Write anStreamRDFout inRDFPatchtext format.StreamRDF.start()andStreamRDF.finish()must be called; these bracket the patch in transaction markersTXandTC. -
writeBinary
public static void writeBinary(OutputStream out, Consumer<org.apache.jena.riot.system.StreamRDF> action) Provide anStreamRDFthat will output in RDFPatch binary format.StreamRDF.start()andStreamRDF.finish()must be called; these bracket the patch in transaction markersTXandTC. -
str
-