| Crates.io | sdml-core |
| lib.rs | sdml-core |
| version | 0.4.1 |
| created_at | 2023-07-28 03:00:11.156955+00 |
| updated_at | 2025-04-15 21:41:33.696804+00 |
| description | Core Model for Simple Domain Modeling Language (SDML) |
| homepage | |
| repository | https://github.com/johnstonskj/rust-sdml.git |
| max_upload_size | |
| id | 928100 |
| size | 3,386,099 |
Rust in-Memory model of the Simple Domain Modeling Language (SDML).
This package is part of the Rust SDML project and specifically defines the in-memory model of an SDML module. The project's intent is to provide an idiomatic implementation of the in-memory model, parser, generators, and the CLI tool.
The following figure demonstrates this package in the broader project context.

Note that other tools can use the =sdml_core= API to create or manipulate models.
Another major release with language features; these have been building up in the mainline branch for the grammar for a while, but getting the new build working for v0.4 has taken longer than expected.
from clause to import statements to allow import paths.self from the rule quantified_variable.use statements with nesting.The primary aim of this release is to introduce a new definition type, a dimension. This may be seen as a violation of SDML's goal of being technology or implementation independent however it is a pragmatic decision based on usage experience. Modeling the data managed by a business in terms of entities solves many operational purposes but ignores a major purpose of this data -- reporting.
module example is
import [ sales stores xsd ]
dimension Region is
;; define an identifier for this dimension
identity region -> long
;; add members
name -> string
end
dimension Location is
;; tightly bind this dimension to the Sale entity
source sales:Sale
;; define a hierarchy by noting one or more parent dimensions
parent region -> Region
;; reuse members from the source entity
store from sales:Sale
city from sales:Sale
;; add additional members not on the source entity
state -> stores:State
country -> stores:Country
end
end
Detailed Changes:
DimensionDef to the model which has a source clause, set of parents
and set of members.source claused based on, but extending, the one on an event definition.DimensionParent structure with name and entity name reference.The new syntax for the source keyword also allows the inclusion of members from
the source entity rather than requiring duplicate members. This new source
clause has been added to the event definition as a part of the body of an event
thus allowing incomplete event definitions.
module example is
entity Thing is
identity id -> long
name -> string
end
event Empty
event NewThing is
source Thing with name
end
end
Additionally, this version of the grammar allows module's to rename imports,
both modules and members. This allows then client module to avoid always using
qualified names, and to use short, or more meaningful, names as appropriate.
``` sdml
module example is
import rentals_billing as billing
import billing:Invoice as Invoice
end
ModuleStore.Member to be a union of MemberDef and IdentifierReference~identity to be just a Member.PropertyDef to be a wrapper around MemberDef.cache (now store) and load
modules.MaybeInvalid to MaybeIncomplete.has_source to the trait ModuleLoader.FromStr for both QualifiedReference and
IdentifierReference.Identifier::from_str should allow type names.ModuleStore trait, implemented by ModuleCache.While not advantageous immediately, it mirrors the separation of trait and
implementation that worked well for ModuleLoader and ModuleResolver.
IdentifierNotPreferredCase, to enforce case
conventions.todo! panics.sdml_error.iso_3166 for country codes, and iso_4217 for
currency codes.with_ constructors on Cardinality to take option types.Clean-up release.
import! macro for stdlib modules.println! calls.sdml stdlib module.is_stdlib_property and is_datatype_facet to
AnnotationProperty.AnnotationBuilder trait and impls on most definitions to
allow easy adding of annotation properties.ModuleCache to make it more collection-like.dc (elements) -- Complete.dc_terms -- Not started.dc_am -- Not started.dc_type -- Not started.owl -- Complete.rdf -- Complete.rdfs -- Complete.sdml -- Mostly complete.skos -- Complete.xsd (part 2) -- Complete.This change affects the =ModuleCache= as well, it's with_stdlib constructor will
include all the library modules and their definitions. This can be checked out
with the command-line tool to either draw diagrams of the standard library
modules or convert into s-expressions, etc.
base keyword.version keyword after module URI with:
owl:versionInfo.owl:verionIRI.rdf followed by either structure or property with name
and annotation body.SimpleModuleWalker with support for RDF class/property definitions.Cardinality::to_uml_string to output constraints.mapping_type and mapping_value rules.Option.tree-sitter-sdml version
0.1.29stdlib module and moved all the SDML and relevant RDF files into it.tree-sitter-sdml version 0.1.21.tree-sitter-sdml dependency with updated constraints.
TypeDefinition to =Definition= to address the fact that property
definitions aren't types.EnumVariant to ValueVariant to align with TypeVariant on unions.
This required change to walker methods.Previously part of a single crate sdml.