A wrapper around RDF4J for Kotlin. It allows writing code using Kotlin's DSL. Documentation can be found here. Code can be found here.
You can now write things such as
val model = modelBuilder {
namespace("ex", "http://example.org/")
subject("ex:Picasso") {
add(RDF.TYPE, "ex:Artist")
add(FOAF.FIRST_NAME, "Pablo")
}
}.build()
model.map { statement ->
println(statement)
}
fun modelBuilder(block: ModelBuilder.() -> Unit): ModelBuilder
Allows to construct a ModelBuilder using Kotlin's DSL |
|
fun selectQuery(block: SelectQuery.() -> Unit): SelectQuery
Allows to construct a SPARQL Query using Kotlin's DSL |
|
fun sparqlPrefix(name: String, iri: Iri): Prefix
A helper function to help write SPARQL prefix in the DSL |
|
fun sparqlVariable(name: String): Variable
A helper function to help write SPARQL variables in the DSL |