๐Ÿš€ DomainForgeโ„ข Quick Start

Get the semantic modeling stack running locally.


Prerequisites

Tool Version Purpose
Docker 24+ Container runtime
Python 3.11+ DSL tooling
just 1.0+ Task runner
sea-cli latest DSL compiler

1. Start Knowledge Graph

1
2
3
4
5
# Start Oxigraph
docker-compose up -d oxigraph

# Verify it's running
curl http://localhost:7878/

Expected Output

1
Oxigraph SPARQL server

2. Write Your First Model

Create models/example.sea:

@namespace "com.example.inventory"
@version "1.0.0"

Dimension "Mass"
Unit "kg" of "Mass" factor 1

Resource "Steel" unit "kg" in manufacturing

Entity "Warehouse.Main" in logistics
Entity "Plant.A" in manufacturing

Flow "SteelDelivery" from "Plant.A" to "Warehouse.Main" quantity 500 "kg"

Policy min_stock per Constraint Obligation priority 5 as:
  sum(f in flows where f.resource = "Steel" and f.to.name = "Warehouse.Main": 
      f.quantity) >= 100 "kg"

3. Validate the Model

1
2
3
4
5
6
7
8
# Type and unit checking
sea validate models/example.sea --type-check --unit-check

# Expected output
โœ“ Syntax valid
โœ“ Types consistent
โœ“ Units compatible
โœ“ 1 policy validated

4. Generate Projections

1
2
3
4
5
6
7
# Generate all projections
sea project models/example.sea --calm --kg --sbvr

# Output files
# generated/example.calm.json   - CALM architecture
# generated/example.ttl         - RDF triples (Turtle)
# generated/example.sbvr.md     - Business rules

5. Load into Knowledge Graph

1
2
3
4
5
6
7
8
9
# Upload triples to Oxigraph
curl -X POST http://localhost:7878/store \
  -H "Content-Type: text/turtle" \
  --data-binary @generated/example.ttl

# Verify loaded
curl -X POST http://localhost:7878/query \
  -H "Content-Type: application/sparql-query" \
  -d "SELECT (COUNT(*) as ?count) WHERE { ?s ?p ?o }"

6. Query the Graph

1
2
3
4
5
6
7
8
9
10
# Find all entities
curl -X POST http://localhost:7878/query \
  -H "Content-Type: application/sparql-query" \
  -d "
    PREFIX sea: <http://sea-forge.com/schema/core#>
    SELECT ?entity ?name WHERE {
      ?entity a sea:Entity ;
              rdfs:label ?name .
    }
  "

Common Issues

Issue Solution
connection refused on 7878 Start Oxigraph: docker-compose up oxigraph
UnitError.MismatchedDimension Use as "unit" to convert
ScopeError.UnknownIdentifier Check entity/resource is declared

Next Steps