tree-sitter-sdml

A tree-sitter grammar for the Simple Domain Modeling Language (SDML). For more information on the language, see the documentation.

Example

``` sdml module Campaign is

import [xsd skos xml:base dc]

@xml:base = https://advertising.amazon.com/api-model

@skos:version = xsd:decimal(2)

datatype Name <- xsd:string is @xsd:minLength = 5 @xsd:maxLength = 25 end

datatype CampaignId <- xsd:string is @skos:prefLabel = [ "Campaign Identifier"@en "Identified de campagne"@fr ] end

structure Tag is key -> xsd:NMTOKEN value -> {0..} rdfs:langStrings end

entity campaign is identity campaignId -> CampaignId

name -> Name is
  @skos:definition = ""
end

tag -> {0..} Tag

ref target {0..1} -> {0..} Target

end

entity Target

end ```

Changes

Version: 0.1.15

``` sdml module ddict is import account

property accountId -> account:AccountId is @skos:prefLabel = "accountId"@en @skos:altLabel = "account_id"@en

identifier is
  @skos:definition = "Used as ..."@en
end

default = {1..1}

end

structure Account is accountId as default name -> string end

end

```

Version: 0.1.14

Allows both:

``` sdml module example is

datatype mystring <- string

structure Person is name -> string age -> integer end end ```

Where the keywords string and integer will be expanded into the qualified identifiers sdml:string and sdml:integer respectively.

Version: 0.1.13

Introduces:

sdml module example base <https://example.org/v/example> is end

Which replaces the annotation form:

```sdml module example is import xml

@xml:base = https://example.org/v/example end ```

Version: 0.1.12

Version: 0.1.11

Introduces:

```sdml module example is

union Example is Variant1 Variant1 as Alternative end end ```

This allows the use of the same type as a variant more than once if the new identifier is unique within the same union.

Version: 0.1.10

Version: 0.1.9

Version: 0.1.8

Version: 0.1.7

Version: 0.1.6

Additional Links