N3PatchBuilder

Kotlin DSL builder for N3Patch.

Produces properly escaped N3 triple strings — callers work entirely with subject/predicate IRI strings and typed object values; no raw N3 syntax needed.

Variable names passed to where, deleteVar, and insertVar must not include the leading ? — the builder adds it automatically.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun build(): N3Patch

Assembles the accumulated triples into an N3Patch.

Link copied to clipboard
fun delete(subject: String, predicate: String, iriObject: String): N3PatchBuilder

Adds a delete triple whose object is an IRI.

Link copied to clipboard
fun deleteLiteral(subject: String, predicate: String, value: String, datatype: String? = null, language: String? = null): N3PatchBuilder

Adds a delete triple whose object is a literal. The literal must match the stored value exactly (including datatype/language) for the server to remove it.

Link copied to clipboard
fun deleteVar(subject: String, predicate: String, variable: String): N3PatchBuilder

Adds a delete triple whose object is the variable bound by a where clause. Use this to remove whatever value currently exists for a property in a safe replace.

Link copied to clipboard
fun insert(subject: String, predicate: String, iriObject: String): N3PatchBuilder

Adds an insert triple whose object is an IRI.

Link copied to clipboard
fun insertLiteral(subject: String, predicate: String, value: String, datatype: String? = null, language: String? = null): N3PatchBuilder

Adds an insert triple whose object is a literal.

Link copied to clipboard
fun insertVar(subject: String, predicate: String, variable: String): N3PatchBuilder

Adds an insert triple whose object is the variable bound by a where clause.

Link copied to clipboard
fun where(subject: String, predicate: String, variable: String): N3PatchBuilder

Adds a where pattern triple that binds variable to the current object of subject/predicate, so deleteVar and insertVar can reference it.