KerML and SysML v2 metamodel definitions for the Hivecore Framework, plus the generators that produce typed Kotlin APIs from them. Built on HMF (Hivecore Model Framework).
This repository is a multi-module Gradle build:
hcf-models/
├── kerml-model/ # KerML metamodel — MetaClass + MetaAssociation
│ # definitions for ~85 classes and ~127 associations
│ # across the Root, Core, and Kernel packages.
├── kerml-codegen/ # Dev-only runner that drives HMF's
│ # MetamodelCodeGenerator / TypeScriptCodeGenerator
│ # over the KerML registry. Not on consumer classpath.
├── kerml-generated/ # Module whose sources are produced by kerml-codegen
│ # into build/generated-src. Nothing is checked in;
│ # the compileKotlin task triggers regeneration.
│
├── sysml-model/ # SysML v2 metamodel — built on top of kerml-model,
│ # adding SysML-specific MetaClasses and associations.
├── sysml-codegen/ # Dev-only runner for the SysML metamodel registry.
└── sysml-generated/ # Build-only output module for SysML typed code.
Composed builds (via includeBuild in settings.gradle.kts):
- hmf —
hmf-schema,hmf-runtime - hmf-codegen — Kotlin / TypeScript generators
Implements the KerML v1.0 specification:
- Root package —
Element,Relationship,Namespace,Membership,OwningMembership,Import,Annotation,Comment,Documentation,Dependency, … - Core package —
Type,Classifier,Feature,Structure,Specializationand its kinds (Subclassification,Conjugation,Disjoining,Differencing,Intersecting,Unioning),FeatureMembership,FeatureTyping,Featuring,TypeFeaturing,Subsetting,Redefinition,ReferenceSubsetting,CrossSubsetting,Multiplicity, … - Kernel package — Classifiers (
DataType,Class,Association,Behavior,Function,Predicate,Metaclass,Interaction), features (Step,Connector,BindingConnector,Succession,FeatureValue), expressions (Expression,OperatorExpression,InvocationExpression,FeatureChainExpression,LiteralExpressionand its subtypes,CollectExpression,SelectExpression,IndexExpression), flows, and containers (Package,LibraryPackage).
Includes semantic bindings (implied relationships to library types) and ownership bindings (Membership / FeatureMembership intermediaries).
Builds on kerml-model with the SysML v2 metaclasses and associations.
Refer to SPEC-ISSUES.md and
sysmlv2-rtf-issues.md for spec typos and corrections
encountered during implementation.
Both kerml-generated and sysml-generated contain output produced by the
corresponding *-codegen module. The output includes:
- Typed Kotlin interfaces over
ModelElement— one per concrete metaclass with stored, derived, and association-based properties typed correctly and derived properties exposed as read-only. HMFObject-wrapping implementations —*Implclasses that delegate to anHMFEnginefor property access, so derivations and constraints remain centrally evaluated.- Factory classes for constructing typed instances by metaclass name.
Optional TypeScript output (interfaces + discriminated-union metaclass type)
is also available via hmf-codegen for downstream REST clients.
./gradlew build --no-configuration-cache
./gradlew test --no-configuration-cacheThe kerml-generated and sysml-generated modules have no checked-in source;
their compileKotlin tasks depend on the corresponding *-codegen:generateMetamodelCode
task, which writes to build/generated-src/main/kotlin. Regeneration happens
automatically; you only need to invoke the codegen tasks explicitly if you
want output without compiling:
./gradlew :kerml-codegen:generateMetamodelCode --no-configuration-cache
./gradlew :sysml-codegen:generateMetamodelCode --no-configuration-cache
./gradlew :kerml-codegen:generateTypeScriptTypes --no-configuration-cacheRequires JDK 21 and Gradle 9.x.
- hmf — schema and runtime that this metamodel targets.
- hmf-codegen — code generators invoked by the
*-codegenmodules. - hcf-runtime — parser, writer, expression evaluator, and analysis services for the metamodels defined here.
- hcf-server — REST API server exposing these metamodels.
- hcf-intellij — IntelliJ plugin built on these metamodels.