Dolfin is an open-source language for modelling knowledge: clean, readable, and designed to be understood by domain experts, developers, and data architects alike.
Dolfin (.dlf) is an indentation-based ontology definition language that compiles to OWL/RDF (Turtle). Think of it as a schema language with superpowers:
concept Animal:
has name: one string
has species: one Species
has vaccinations: Vaccination
concept Dog:
sub Animal
has breed: optional string
has neutered: one boolean
rule flag_unvaccinated:
match:
?animal a Animal
none:
?animal vaccinations ?_
then:
?animal a UnvaccinatedAnimal
No braces, no boilerplate, just your domain, clearly expressed.
| Traditional schema | Dolfin ontology |
|---|---|
name column of type text |
name must have exactly one value |
Foreign key to vet_id |
An intern cannot treat an emergency |
| ❎ | An unvaccinated animal is automatically flagged |
| ❎ | Animal here is the same concept as fao:Animal in the global species registry |
Dolfin separates what your data means from where it is stored. The same model drives validation, feeds a reasoning engine, and serves as shared vocabulary across a team.
- Python-like syntax: indentation-based blocks, no braces
- Rich type system: primitives, references, enumerations, cardinality modifiers (
one,optional,any,some) - Inference rules: SWRL-style
match/thenblocks for automated reasoning - Quantifier constraints:
at least N,at most N,exactly N,between N M - Interoperability: prefix declarations link your model to external IRI namespaces
- Compiles to OWL/RDF Turtle: works with any standards-compliant reasoner or graph store
No installation needed ➡️ visit dolfin.fr/playground to experiment with Dolfin directly in your browser.
The playground is a fully featured in-browser environment powered by WebAssembly:
- Live editor with syntax highlighting, bracket matching, and real-time diagnostics
- Language server built in, hover for type info, autocomplete as you type, quick-fix suggestions
- Multiple output tabs view the parsed AST, compiled OWL/RDF Turtle, an SVG class diagram, or an interactive graph
- Graph view, explore your ontology as a node-link diagram; drag nodes, filter by data properties, and see relationships at a glance
- Multi-file packages, work with several
.dlffiles at once, just like a real project - Load & save, import or export your whole package as a
.zip - Built-in examples, start from the Happy Paws veterinary clinic model or an HR ontology
| Repository | What it does | Available |
|---|---|---|
| rowl | Rust parser with Python bindings (via PyO3/maturin) | ✅ |
| dolfin-lsp | Language Server Protocol implementation | ❎ |
| dolfin-analysis | Semantic analysis, type checking, diagnostics | ❎ |
| dolfin-lint | Linter and formatter | ❎ |
| dolfin-playground | In-browser playground (WASM) | |
| dolfin-viz | Ontology graph visualization | ❎ |
| vscode-dolfin | VS Code extension with syntax highlighting | ❎ |
| tree-sitter-dolfin | Tree-sitter grammar for editor integrations | ❎ |
- Read the documentation and tutorial: follow Dr. Helen Portbridge as she builds a veterinary clinic ontology from scratch across ten chapters
- Browse the examples:
- HR
- Happy paws from the tutorial
- Open an issue or pull request: contributions welcome!
# Install the Python package
pip install rowlimport rowl
ontology = rowl.parse("my-model.dlf")Dolfin: describe what your data means, let the implementation decide where it lives.