Optional registration

Add structure, meaning, or both

Keep your DataModel or semantic definitions in your own public Git repository. Registering it is optional; the registry adds discovery, immutable provenance and connections in MeaningGraph.

OptionalGit-backedNo MeaningGraph account

Choose your starting point

Structure, meaning, or both

Use a DataModel to describe storage-independent record types, fields, keys, constraints and relationships. Use a meaning graph to define entities, properties and semantic relationships. Each works independently; add semantic mappings later when they help.

The DataModel authoring format uses .modelspec.hcl, .modelspec.json and modelspec:// identifiers. These technical names describe the serialization within MeaningGraph.

Browse DataModels or follow the meaning-graph registration steps below. Model submissions currently use the model registration repository. MeaningGraph provides the shared browse and discovery experience; changing the registration writer is a separate migration.

DataModel guide

Describe structure once

A DataModel describes logical record types, fields, keys, constraints and relationships independently of a storage engine. Use it on its own, or add semantic mappings later. The same logical model can describe SQLite, PostgreSQL or SQL Server implementations; their physical schemas and dev, QA and production deployments remain separate.

Records, components and enums

A record type is a named structure of fields. An optional key declares logical record identity. A component groups reusable fields, included with use. An enum defines allowed values. A record reference expresses a logical relationship; it does not promise that a database enforces a foreign key.

This complete authoring example requires no semantic definitions or database connection. Download the HCL example or its exported JSON.

component "Auditable" {
  field "createdAt" {
    type = "datetime"
    required = true
  }
}

enum "CustomerStatus" {
  values = ["active", "inactive"]
}

record "Customer" {
  key = ["id"]
  use = ["Auditable"]
  field "id" {
    type = "uuid"
  }
  field "email" {
    type = "string"
    required = true
    unique = true
    format = "email"
  }
  field "status" {
    type = "string"
    enum = "CustomerStatus"
  }
}

record "Order" {
  key = ["id"]
  field "id" {
    type = "uuid"
  }
  field "customer" {
    record = "Customer"
    required = true
  }
}

Author, validate and export

Author HCL and export its parsed abstract syntax tree to JSON for tools. The existing file extensions .modelspec.hcl and .modelspec.json, JSON modelspec version field, and reference command name describe the technical format used by DataModels. DataModel is the MeaningGraph concept; this is not another product.

The format reference CLI validates HCL and JSON and exports HCL to JSON. Pin a published CLI release and checksum using its installation instructions.

modelspec lint customer.modelspec.hcl
modelspec export customer.modelspec.hcl --module-id github.com/meaninggraph/examples/customer --module-name customer --module-version 0.1.0 --out customer.modelspec.json

HCL grammar · JSON serialization · Versioned JSON Schema. The schema checks JSON shape; the validator must also check references, keys and constraints. No YAML authoring form is defined for this format.

Version and reuse

Published models retain their exact source commit and archived definition. Browse the model’s revisions and use an immutable revision when reproducibility matters. Qualified references can name concepts from another module; pinned provenance makes their source explicit. Browse DataModels, including Chinook.

Scope and current limits

This authoring format is a preview; its grammar and vocabulary may change before a stable release. Pin the format and tooling version when publishing.

Semantic annotation is optional. Model metadata does not deploy a database, select a storage engine or define permissions, authentication, workflows or UI behavior. Parsing, validation, JSON export and registry browsing are available. Generation of SQL schemas, application types and APIs from this authoring format remains planned; the example does not execute such generators.

Registration does not require publishing your graph to MeaningGraph or hosting it here. Keep the graph in your repository, then add a record to the public registry if you want it to be easier to find and reuse.

Contribution steps

Register a repository

  1. Add graphs/$records/<id>.yaml to the MeaningGraph registry, with the repository URL, full 40-character commit, meaning-file paths and the SPDX licence for those files. List ModelSpec model files and their licence when the meanings bind to a model.
  2. Add dependency records under dependencies/$records/ for the registered graphs your meanings reference. Add a maintainer record under maintainers/$records/ when the maintainer is new to the registry.
  3. From the registry checkout, run npm ci && npm run index, then ingitdb validate and npm run check. The checks validate the full commit, paths, licences, meanings and dependencies.
  4. Open a GitHub pull request with the graph record, any needed dependency or maintainer records, and regenerated index.json. This uses your GitHub account; no MeaningGraph account or hosted publishing is required. See the authoritative registration instructions and submit a registry pull request.

Keep control of your data

Registration is separate from a local draft

A downloaded local draft is for editing and previewing on your own machine. It does not submit a registry record. Registration happens only when you contribute the record and its supporting files to the registry repository.

Open the MeaningGraph registry

Start with meaning

Propose a definition

This local draft is for a semantic meaning only. Register logical data models or meaning files through the registry guide.

A local JSON draft downloads to your device. Nothing is published.