Geoknoesis LLC Logo
Geoknoesis GeoSemantic AI
← Back to Blog
· Geoknoesis Engineering

Designing Kastor: Ergonomic RDF 1.2 and SHACL in Modern Kotlin

A look inside Kastor's Kotlin DSLs, KSP code generation, and multi-backend architecture for semantic web engineering.

#Kastor #Open Source #Kotlin #RDF 1.2 #SHACL

Working with RDF and SPARQL on the JVM has historically meant choosing between verbose low-level APIs or rigid framework lock-in. With Kastor, we set out to bring modern Kotlin ergonomics to the entire Semantic Web stack.

Core Design Principles

  • Idiomatic Kotlin DSLs: Build graphs, write SPARQL queries, and declare SHACL shapes with expressive, readable syntax.
  • Compile-Time Safety with Kastor Gen: Use Kotlin Symbol Processing (KSP) to generate strongly typed domain classes directly from your ontologies.
  • Backend Freedom: Run against Apache Jena, Eclipse RDF4J, in-memory stores, or remote SPARQL endpoints through a single unified API.

Get Involved

Kastor is open source on GitHub at geoknoesis/kastor. Star the repository, try the quickstart, and let us know what you’re building!