tree-sitter-sdml


Nametree-sitter-sdml JSON
Version 0.3.2 PyPI version JSON
download
home_pageNone
SummarySDML grammar for tree-sitter
upload_time2024-07-02 18:22:21
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseCopyright 2023 Simon Johnston <johnstonskj@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords incremental parsing tree-sitter sdml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Tree-Sitter grammar for SDML

![SDML Logo Text](https://raw.githubusercontent.com/sdm-lang/.github/main/profile/horizontal-text.svg)

A [tree-sitter](https://tree-sitter.github.io/tree-sitter/) grammar for the Simple Domain Modeling Language (SDML). For more information on the language, see the
[documentation](https://sdml.io/).

## Example

```sdml
module Campaign base <https://advertising.amazon.com/api-model> is

  import [dc skos xsd]

  @skos:prefLabel = "Campaign sub-domain"@en
  @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 id -> CampaignId

    name -> Name is
      @skos:definition = "the name of the campaign"@en
    end

    tag -> {0..} Tag

    target -> {1..} Target
  end

  entity Target

end
```

## License

This package is released under the Apache License, Version 2.0. See LICENSE file for details.

## Changes

**Version: 0.3.2**

- Feature: change ``module`` rule to include a choice between the existing `module_body` and a new `library_body`.
  - the rules `rdf_def` and `type_class_def` from `module_body` to `library_body`.
* Feature: simplify rule `property_def` to simply be `member`.
- Feature: simplified entity identity member to be the same as all other members.
* Feature: remove the rule `feature_reference` entirely.

**Version: 0.3.1**

* Fix: regular expression for characters inside a string.
  * Added `examples/escaped_strings.sdm` file for basic testing.
  * Added `test/corpus/escaped_strings.sdm` file for more complete testing.

**Version: 0.3.0**

* Feature: simplified property definitions.
  * Removed notion of role, a `property_def` is singular.
  * Removed "in" keyword, `property_ref` uses "ref".
  * Removed inverse names.

```js
property_def: $ => seq(
    keyword('property'),
    $.member_def
),
```

* Feature: unified single definition of `member`.
  * Changed member, is now *either* `property_ref` or `member_def`.
  * Changed `property_def` to simply be `member_def`.
  * Changed `entity_identity` to be `member`.
  * Expect to add warning for unbounded cardinality for entity identities.

```js
entity_identity: $ => seq(
    keyword('identity'),
    $.member
),

member: $ => choice(
    $.member_def,
    $.property_ref,             
),

member_def: $ => seq(
    field('name', $.identifier),
    $._type_expression_to,
    optional(field('body', $.annotation_only_body))               
),

property_ref: $ => seq(
    keyword('ref'),
    field('property', $.identifier_reference),
),
```

**Version: 0.2.14-16**

* Feature: simplified form of `rdf_def`.

**Version: 0.2.13**

* Feature: add `rdf_super_types` optional rule to `rdf_def`.

**Version: 0.2.12**

* Refactor: simplify the `rdf_thing_def` rule into `rdf_def`.

**Version: 0.2.11**

* Fix: rename field `uri` to `version_uri` on rule `module_import`.
* Refactor: clean-up test case names to match those in sdml-parse Rust crate.

**Version: 0.2.10**

* Feature: add version support to modules.
  * Remove `base` keyword.
  * Add optional `version` keyword and string/IRI version information.
  * Add optional IRI after identifier for module imports.

**Version: 0.2.8/0.2.9**

* Feature: better support for RDF generation.
  * Add direct support for RDF structures and properties rather than using SDML structures.
    * see file `examples/rdf_schema.sdm`
  * Remove keyword `"base"`, add new version clause on module definitions.
    * see file `test/corpus/module_empty_with_version.sdm`

**Version: 0.2.7**

* Remove member group from grammar, can't find a use that isn't better done by moving members to a structure of their
  own.

**Version: 0.2.6**

* Fix: test case typos.

**Version: 0.2.5**

* Feature: Inline type variables in type classes.

**Version: 0.2.4**

* Fix: tidy grammar for type classes.

**Version: 0.2.3**

* Feature: expand rule `sequence_of_predicate_values` to match `sequence_of_values` with value constructor, mapping value,
  and identifier reference choices.
* Feature: simplify rule `value_variant` to remove the assignment to an unsigned value.
* Feature: change rule `feature_reference` to contain the identifier reference, update the rule `_type_expression_to` to
  have a choice of `feature_reference` *or* `type_reference`.
* Fix: add field `byte` to rule `binary` to aid in parser and highlighting.

Along with minor changes in highlighting and examples.

**Version: 0.2.2**

* Feature: add rule `optional` for the operator "?" to allow for optional values. Also added to type reference rules.
* Fix: minor updates to type classes:
  * Add: name `parameters` to the rule reference `type_class_parameters` in rule `type_class_def`.
  * Rename: rule `type_variable_subtype` to `type_variable_restriction`.
  * Remove: wildcard from top of rule `type_variable_restriction`.
  * Add: ability to have multiple types in a restriction separated by "+".

**Version: 0.2.1**

This release is primarily to implement *type classes* that allow a better description of the standard library for
constraints. Adding this support identified some simplifications in functional terms and sequence builders.

``` sdml
module example is
  class Typed(T) is
    def has_type(v -> T) → Type is
      @skos:definition = "Returns the SDML type of the passed value."@en
      @skos:example = "~type_of(rentals:Customer) = sdml:Entity~"
    end
  end
end

```

* Feature: add type classes for managing the constraint language library.
  * Add: rule `type_class_def` and list it as an alternative in `definition`.
  * Add: rule `method_def` and include as member of `type_class_def`.
  * Remove: choice `wildcard` from rule `function_type_reference`, wildcards are only allowed on type class parameters.
* Feature: simplify the rule `quantified_sentence` to only have a single quantified variable binding.
  * Alter: field `binding` in `quantified_sentence` to remove the repeat.
  * Alter: field `body` from `_quantified_body` to `constraint_sentence`.
  * Rename: rule `quantifier_bound_names` to `quantified_variable` to denote singular.
  * Alter: field `source` in `quantified_variable` to use existing `term`.
  * Remove: rules `type_iterator` and `sequence_iterator`.
* Feature: simplify the structure of sequence builder to use `quantified_sentence` as body.
  * Alter: field `body` in rule `sequence_builder` from `_variable_binding` to `sequence_builder_body`.
  * Remove: rule `_variable_binding`.
  * Add: rule `sequence_builder_body` which is simply a reference to rule `quantified_sentence`.
* Feature: add rule `actual_aruments` for use in rules `atomic_sentence` and `functional_term`.
* Refactor: rename boolean constants.
  * Rename: `_boolean_true` to `boolean_truth`.
  * Rename: `_boolean_false` to `boolean_falsity`.

**Version: 0.2.0**

This is a significant refactor intended to simplify the grammar, and reduce the number of constructs used where the
differentiation is not as significant as it looked previously.

* Refactor: simplify model overall, especially members and features.
  * Refactor: combine by-value and by-reference member types.
    * Remove: rules `member_by_value` and `role_by_value`.
    * Rename: rule `member_by_reference` to `member` and `role_by_reference` to `member_role`.
    * Remove: keyword the `ref` from rules `member` and `member_role`.
    * Rename: rule `identity_member` to `entity_identity`.
  * Refactor: combine structured type groups.
    * Rename: rule `structure_body` to `structured_body`.
    * Rename: rule `structure_group` to `member_group`.
    * Move: common parts of structure and entity bodies into common `_structured_body_inner` rule.
  * Refactor: move feature from a definition to a member modifier.
    * Remove: rule `feature_set_def`, and update `definition` accordingly.
    * Add: optional keyword `features` into the rule `_type_expression_to`.
* Feature: add new keyword `opaque` to datatype definition.
* Style: Use `:=` throughout for assignment /by definition/.
  * Add: silent rule `_by_definition`.
  * Alter: rules `value_variant`, `function_def`, and `constant_def` to use `_by_definition`.
* Style: rename rule `_property_member` to `_property_reference`.

**Version: 0.1.42**

* Feature: simplified `features` definition to be or/xor only.
  * Replace: separate bodies with `UnionBody`.
  * Add: cardinality now used to determine or/xor.

``` ebnf
FeatureSetDef
    ::= "features" Identifier Cardinality? UnionBody?
```

**Version: 0.1.41**

* Feature: add support for features from Product Line Engineering.
  * Add new definition rule `feature_set_def` to rule `definition`.
  * Add *and*, *or*, *xor* bodies to  `feature_set_def`.
  * Add basic documentation to book.
* Feature: updates to builtin simple types.
  * Add the new type `unsigned`.
  * Add the new type `binary`.
  * Rename type `iri_reference` to `iri`.

**Version: 0.1.40**

* Feature: add the Unicode character `↦` to the rule `_has_type` which works better for some typesetting.
* Feature: add rule for `inequation` alongside `equation`.
  * Add new rule `inequation` and make it a choice within `simple_sentence`.
  * Add new rules for inequality relations; `not_equal`, `less_than`, `less_than_or_equal`, `greater_than`, and `greater_than_or_equal`.
* Refactor: restructure rule `boolean_sentence` into a choice of `unary_boolean_sentence` and `binary_boolean_sentence`.
  * Add rule `unary_boolean_sentence` for negation only.
  * Add rule `binary_boolean_sentence` for logical connectives.
  * Add rules for each logical connective keyword/operator symbols.
* Refactor: rename field `variable_binding` to ``binding` in rule `quantieid_sentence`.
* Refactor: use the same rule for empty set in value sequences.
* Refactor: rename rule `_function_type_expression_to` to `_function_type`.
* Refactor: add rules `_has_type` and `_type_restriction` and allow both ascii and Unicode arrows.
  * Add rule `_has_type` for values `->` and `→`.
  * Add rule `_type_restriction` for values `<-` and `←`.
* Fix: rules for new shared bindings had confusing names.
  * Add rule `quantified_variable_binding`.
  * Rename rule `quantifier_binding` to `quantifier_bound_names`.
* Docs: add appendix with details of Unicode usage.

**Version: 0.1.39**

* Feature: allow multiple bindings at the head of quantified sentences.
* Feature: made progress on local scopes in highlighting.
  * Rename rule `_constant_def` to `constant_def`.
  * To-do: currently references are not picking up their definition formatting.
* Refactor: rename rule `name_path` to `function_composition`.
* Refactor: combine components of the two rules `quantified_sentence` and `sequence_builder`.
  * Add new shared rule `quantifier_binding` (along with `_bound_name_set`) now used in both sentence and builder.
  * Add the ability to have more than one name in a binding.
  * Add the ability for sequence builders to have more than one quantified binding.
  * Change the field `expression` into a field named `body` of type `constraint_sentence`.
  * Remove rules `expression` and `conjunctive_expression`.
* Style: change the order of choices in rule `predicate_value` to match `value` and corresponding sequences.

**Version: 0.1.38**

* Feature: Update naming for iterators to make them consistent.
  * Rename rule `iterator_target` to `iterator_source`.
  * Rename field `from` in `type_iterator` to `source`.
  * Rename field `from` in `sequence_iterator` to `source`.

**Version: 0.1.37**

* Feature: update rule `function_cardinality_expression` to allow sequence constraints.
  * Rename rule `any_type` to `wildcard`.
  * Remove rule `any_cardinality` and replace with `wildcard`.
* Feature: rename lists to sequences.
  * Rename rule `list_of_predicate_values` to `sequence_of_predicate_values`.
  * Rename rule `list_of_values` to `sequence_of_values`.
* Feature: make rule `property_role` private as `_property_role`.
* Feature: allow sequence constraints on sequence values.
  * Add rule `_sequence_value_constraints`.
  * Add optional `_sequence_value_constraints` to rule `sequence_of_predicate_values`.
  * Add optional `_sequence_value_constraints` to rule `sequence_of_values`.

**Version: 0.1.36**

* Feature: alter the rule `sequence_comprehension` to be more flexible.
  * Rename rule `sequence_comprehension` to  `sequence_builder`.
  * Rename rule `returned_value` to `variables` and re-write as a choice of:
  * Add rule `tuple_variable` to return distinct variables.
  * Add rule `sequence_variable` to return distinct variables as a sequence.
  * Add rule `mapping_variable` to return two variables as a mapping.

**Version: 0.1.35**

* Feature: alter the rule `_property_member` to allow property names to be `identifier_reference`.
  * New interpretation, field `name` in a member will be the name of a role.
  * Renamed keyword `in`, not `as`.
  * Renamed field `role` to `property` and made it's type `identifier_reference`.

**Version: 0.1.34**

* Feature: update property definitions to look more like members.
  * Update rule `property_role` to be a choice of three new rules.
  * Add rule `identity_role` which is a subset of `identity_member`.
  * Add rule `role_by_value` which is a subset of `member_by_value`.
  * Add rule `role_by_reference` which is a subset of `member_by_reference`.

**Version: 0.1.33**

* Feature: renamed quantifier binding targets to be more consistent.
  * Rename rule `binding_target` to `iterator_target`.
  * Rename rule `binding_type_reference` to `type_iterator` and field name `from_type` to `from`.
  * Rename rule `binding_seq_iterator` to `sequence_iterator` and field name `from_sequence` to `from`.
* Feature: simplified the rule `environment_definition` and made naming more consistent.
  * Remove optional `signature` field
  * Remove assignment operators
  * Rename field name `rhs` to `body` and change to a choice of `function_def` or `_value_def`.
  * Add rule `function_def` to hold the signature and operators removed from the environment definition.
  * Rename rule `fn_parameter` to `function_parameter`.
  * Rename rule `_fn_type` to `_function_type_expression_to`.
  * Add rules `function_cardinality_expression` and `any_cardinality` to capture cardinality or wildcard.
  * Add rule `function_type_reference` to allow wildcards.
* Feature: update queries `highlights`, `locals`, and `tags` for all changes above.
* Docs: update BNF syntax and diagrams for all changes above.
  
**Version: 0.1.32**

* Feature: update environment definition sequence types to use the same syntax as member type and cardinality.

**Version: 0.1.31**

* Feature: update highlighting queries for constraints with support for locals.
* Feature: add a `locals.scm` file with scopes for formal constraints.
* Feature: add `∅` (empty set) as a synonym for `[]` in constraints.
* Fix: update the mapping value test case to use domain/range field names.

**Version: 0.1.30**

* Feature (minor): added field names for the domain and range of mapping types and values.

**Version: 0.1.29**

* Fix: an apparent regression, the value for a constructor changed from `simple_value` to `value`. This changes it back.

**Version: 0.1.28**

* Feature: add a mapping type and corresponding value syntax.

**Version: 0.1.27**

* Feature: add *ordering* and *uniqueness* constraints into the cardinality expression. Used to constrain the sequence
  type of a member.

**Version: 0.1.26**

* Feature: applied same change as 0.1.25 but for property roles as well.

**Version: 0.1.25**

* Feature: changed grammar for reference members:
  * The production `source_cardinality` has been removed.
  * The production `member_inverse_name` has been added.

**Version: 0.1.24**

* Feature: constraint changes
  * Add a *language-tag* to informal constraints.
  * Add a *wildcard type* for the constraint language.

**Version: 0.1.23**

* Feature: add highlighting test for constraints, had to tweak a few things.

**Version: 0.1.22**

* Feature: clarify rules and associated meaning.
  * Rename the grammar rule `type_definition` to `definition` to address the fact that property definitions aren't types.
  * Rename the grammar rule `enum_variant` to `value_variant` to align with `type_variant` on unions.

**Version: 0.1.21**

* Feature: add support for sequence builder support(set builder) syntax.
* Fix: highlighting/indent/fold updated for constraints.
* Style: a number of cosmetic changes to formal constraints.

**Version: 0.1.19/0.1.20**

* Fix: minor change to add a field name to the '..' range operator.

**Version: 0.1.18**

* Feature: add a constraint assertion construct. This allows for specific constraints to be documented for any model element.
  * The grammar rule `annotation` has been renamed `annotation_property`
  * The grammar rule `constraint` has been added.
  * A new grammar rule named `annotation` is defined as a choice of `annotation_property` or `constraint`.
  * This allows the use of the old rule to be subsumed by the new definition.
* Constraints can be written in informal unstructured fashion or an embedded formalism.
  * The informal representation is simply a string.
  * The formal representation is a syntax that maps to a subset of [ISO/IEC 24707:2018](https://www.iso.org/standard/66249.html) Common Logic.
* More documentation added on the RDF mapping and the domain modeling process.

``` sdml
module example is

    import tag

    structure Thing is
    
      inner -> {0..} InnerThing is
        ;; informal
        assert same_tags = "All inner tags contain a tag value \"This\"."
        ;; formal
        assert same_tags_formal is
          forall self ( not_empty(self) and contains(self.tags "This") )
        end
      end
      
    end
    
    structure InnerThing is
      tags -> {0..} tag:Tag
    end
    
end
```

**Version: 0.1.17**

* Fixed highlighting for properties.

**Version: 0.1.16**

* Adjusted property grammar.
* Started on property documentation.

``` sdml
module ddict is
  import account
  
  property accountId is
    @skos:prefLabel = "accountId"@en
    @skos:altLabel = "account_id"@en
    
    identifier -> {1} account:AccountId is
      @skos:definition = "Used as an identifier for account-scoped things"@en
    end
    
    reference ref {1} -> {1} account:AccountId
  end
  
  structure Account is
    accountId as identifier
    name -> string
  end

end
```

**Version: 0.1.15**

* Added new structure to the grammar to allow data-dictionary style reusable property definitions.

``` 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**

* Added new rule named `builtin_simple_type` (choice of `string`, `double`, `decimal`, `integer`, `boolean`, and `iri`):
  * replaced `identifier_reference` with new rule `data_type_base` for `data_type_def`,
  * added to the `type_reference` choice used for the member `target` field.
  
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**

* Added explicit `base` grammar for module rather than using `xml:base` as an attribute.
* Expanded grammar for `Identifier` to allow decimal digits in any position *after* the first.
* Clarified the grammar for `TypeVariant`.

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**

* Fixed highlight issue for annotations with `IdentifierReference` values
* Added field for `TypeVariant` name

**Version: 0.1.11**

* Added a rename to optional value to `TypeVariant`
* Fixed `annotation` and `language_tag` grammar rule conflict

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**

* Cleaned up queries.

**Version: 0.1.9**

* Simplified the disjoint `UnionDef` type.

**Version: 0.1.8**

* Added a disjoint `UnionDef` type.

**Version: 0.1.7**

* Made field name `sourceCardinality` into `source_cardinality`.
* Made field name `targetCardinality` into `target_cardinality`.
* Added versioning annotations

**Version: 0.1.6**

* Made `_simple_value` into `simple_value` named rule.
* Made `_type_reference` into `type_reference` named rule.
  
# Additional Links

* Node bindings -- [npm.js](https://www.npmjs.com/package/tree-sitter-sdml)
* Rust bindings -- [crates.io](https://crates.io/crates/tree-sitter-sdml)
* Emacs -- [sdml-mode](https://github.com/johnstonskj/emacs-sdml-mode)
* Command-line tool -- [rust-sdml](https://github.com/johnstonskj/rust-sdml)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tree-sitter-sdml",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "incremental, parsing, tree-sitter, sdml",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/db/b2/bb9ba3f45455de19433dac4772359e66fc109cfb62f3f8204dacdd0aa384/tree_sitter_sdml-0.3.2.tar.gz",
    "platform": null,
    "description": "# Tree-Sitter grammar for SDML\n\n![SDML Logo Text](https://raw.githubusercontent.com/sdm-lang/.github/main/profile/horizontal-text.svg)\n\nA [tree-sitter](https://tree-sitter.github.io/tree-sitter/) grammar for the Simple Domain Modeling Language (SDML). For more information on the language, see the\n[documentation](https://sdml.io/).\n\n## Example\n\n```sdml\nmodule Campaign base <https://advertising.amazon.com/api-model> is\n\n  import [dc skos xsd]\n\n  @skos:prefLabel = \"Campaign sub-domain\"@en\n  @skos:version = xsd:decimal(2)\n\n  datatype Name <- xsd:string is\n    @xsd:minLength = 5\n    @xsd:maxLength = 25\n  end\n\n  datatype CampaignId <- xsd:string is\n    @skos:prefLabel = [\n      \"Campaign Identifier\"@en\n      \"Identified de campagne\"@fr\n    ]\n  end\n\n  structure Tag is\n    key -> xsd:NMTOKEN\n    value -> {0..} rdfs:langStrings\n  end\n\n  entity campaign is\n    identity id -> CampaignId\n\n    name -> Name is\n      @skos:definition = \"the name of the campaign\"@en\n    end\n\n    tag -> {0..} Tag\n\n    target -> {1..} Target\n  end\n\n  entity Target\n\nend\n```\n\n## License\n\nThis package is released under the Apache License, Version 2.0. See LICENSE file for details.\n\n## Changes\n\n**Version: 0.3.2**\n\n- Feature: change ``module`` rule to include a choice between the existing `module_body` and a new `library_body`.\n  - the rules `rdf_def` and `type_class_def` from `module_body` to `library_body`.\n* Feature: simplify rule `property_def` to simply be `member`.\n- Feature: simplified entity identity member to be the same as all other members.\n* Feature: remove the rule `feature_reference` entirely.\n\n**Version: 0.3.1**\n\n* Fix: regular expression for characters inside a string.\n  * Added `examples/escaped_strings.sdm` file for basic testing.\n  * Added `test/corpus/escaped_strings.sdm` file for more complete testing.\n\n**Version: 0.3.0**\n\n* Feature: simplified property definitions.\n  * Removed notion of role, a `property_def` is singular.\n  * Removed \"in\" keyword, `property_ref` uses \"ref\".\n  * Removed inverse names.\n\n```js\nproperty_def: $ => seq(\n    keyword('property'),\n    $.member_def\n),\n```\n\n* Feature: unified single definition of `member`.\n  * Changed member, is now *either* `property_ref` or `member_def`.\n  * Changed `property_def` to simply be `member_def`.\n  * Changed `entity_identity` to be `member`.\n  * Expect to add warning for unbounded cardinality for entity identities.\n\n```js\nentity_identity: $ => seq(\n    keyword('identity'),\n    $.member\n),\n\nmember: $ => choice(\n    $.member_def,\n    $.property_ref,             \n),\n\nmember_def: $ => seq(\n    field('name', $.identifier),\n    $._type_expression_to,\n    optional(field('body', $.annotation_only_body))               \n),\n\nproperty_ref: $ => seq(\n    keyword('ref'),\n    field('property', $.identifier_reference),\n),\n```\n\n**Version: 0.2.14-16**\n\n* Feature: simplified form of `rdf_def`.\n\n**Version: 0.2.13**\n\n* Feature: add `rdf_super_types` optional rule to `rdf_def`.\n\n**Version: 0.2.12**\n\n* Refactor: simplify the `rdf_thing_def` rule into `rdf_def`.\n\n**Version: 0.2.11**\n\n* Fix: rename field `uri` to `version_uri` on rule `module_import`.\n* Refactor: clean-up test case names to match those in sdml-parse Rust crate.\n\n**Version: 0.2.10**\n\n* Feature: add version support to modules.\n  * Remove `base` keyword.\n  * Add optional `version` keyword and string/IRI version information.\n  * Add optional IRI after identifier for module imports.\n\n**Version: 0.2.8/0.2.9**\n\n* Feature: better support for RDF generation.\n  * Add direct support for RDF structures and properties rather than using SDML structures.\n    * see file `examples/rdf_schema.sdm`\n  * Remove keyword `\"base\"`, add new version clause on module definitions.\n    * see file `test/corpus/module_empty_with_version.sdm`\n\n**Version: 0.2.7**\n\n* Remove member group from grammar, can't find a use that isn't better done by moving members to a structure of their\n  own.\n\n**Version: 0.2.6**\n\n* Fix: test case typos.\n\n**Version: 0.2.5**\n\n* Feature: Inline type variables in type classes.\n\n**Version: 0.2.4**\n\n* Fix: tidy grammar for type classes.\n\n**Version: 0.2.3**\n\n* Feature: expand rule `sequence_of_predicate_values` to match `sequence_of_values` with value constructor, mapping value,\n  and identifier reference choices.\n* Feature: simplify rule `value_variant` to remove the assignment to an unsigned value.\n* Feature: change rule `feature_reference` to contain the identifier reference, update the rule `_type_expression_to` to\n  have a choice of `feature_reference` *or* `type_reference`.\n* Fix: add field `byte` to rule `binary` to aid in parser and highlighting.\n\nAlong with minor changes in highlighting and examples.\n\n**Version: 0.2.2**\n\n* Feature: add rule `optional` for the operator \"?\" to allow for optional values. Also added to type reference rules.\n* Fix: minor updates to type classes:\n  * Add: name `parameters` to the rule reference `type_class_parameters` in rule `type_class_def`.\n  * Rename: rule `type_variable_subtype` to `type_variable_restriction`.\n  * Remove: wildcard from top of rule `type_variable_restriction`.\n  * Add: ability to have multiple types in a restriction separated by \"+\".\n\n**Version: 0.2.1**\n\nThis release is primarily to implement *type classes* that allow a better description of the standard library for\nconstraints. Adding this support identified some simplifications in functional terms and sequence builders.\n\n``` sdml\nmodule example is\n  class Typed(T) is\n    def has_type(v -> T) \u2192 Type is\n      @skos:definition = \"Returns the SDML type of the passed value.\"@en\n      @skos:example = \"~type_of(rentals:Customer) = sdml:Entity~\"\n    end\n  end\nend\n\n```\n\n* Feature: add type classes for managing the constraint language library.\n  * Add: rule `type_class_def` and list it as an alternative in `definition`.\n  * Add: rule `method_def` and include as member of `type_class_def`.\n  * Remove: choice `wildcard` from rule `function_type_reference`, wildcards are only allowed on type class parameters.\n* Feature: simplify the rule `quantified_sentence` to only have a single quantified variable binding.\n  * Alter: field `binding` in `quantified_sentence` to remove the repeat.\n  * Alter: field `body` from `_quantified_body` to `constraint_sentence`.\n  * Rename: rule `quantifier_bound_names` to `quantified_variable` to denote singular.\n  * Alter: field `source` in `quantified_variable` to use existing `term`.\n  * Remove: rules `type_iterator` and `sequence_iterator`.\n* Feature: simplify the structure of sequence builder to use `quantified_sentence` as body.\n  * Alter: field `body` in rule `sequence_builder` from `_variable_binding` to `sequence_builder_body`.\n  * Remove: rule `_variable_binding`.\n  * Add: rule `sequence_builder_body` which is simply a reference to rule `quantified_sentence`.\n* Feature: add rule `actual_aruments` for use in rules `atomic_sentence` and `functional_term`.\n* Refactor: rename boolean constants.\n  * Rename: `_boolean_true` to `boolean_truth`.\n  * Rename: `_boolean_false` to `boolean_falsity`.\n\n**Version: 0.2.0**\n\nThis is a significant refactor intended to simplify the grammar, and reduce the number of constructs used where the\ndifferentiation is not as significant as it looked previously.\n\n* Refactor: simplify model overall, especially members and features.\n  * Refactor: combine by-value and by-reference member types.\n    * Remove: rules `member_by_value` and `role_by_value`.\n    * Rename: rule `member_by_reference` to `member` and `role_by_reference` to `member_role`.\n    * Remove: keyword the `ref` from rules `member` and `member_role`.\n    * Rename: rule `identity_member` to `entity_identity`.\n  * Refactor: combine structured type groups.\n    * Rename: rule `structure_body` to `structured_body`.\n    * Rename: rule `structure_group` to `member_group`.\n    * Move: common parts of structure and entity bodies into common `_structured_body_inner` rule.\n  * Refactor: move feature from a definition to a member modifier.\n    * Remove: rule `feature_set_def`, and update `definition` accordingly.\n    * Add: optional keyword `features` into the rule `_type_expression_to`.\n* Feature: add new keyword `opaque` to datatype definition.\n* Style: Use `:=` throughout for assignment /by definition/.\n  * Add: silent rule `_by_definition`.\n  * Alter: rules `value_variant`, `function_def`, and `constant_def` to use `_by_definition`.\n* Style: rename rule `_property_member` to `_property_reference`.\n\n**Version: 0.1.42**\n\n* Feature: simplified `features` definition to be or/xor only.\n  * Replace: separate bodies with `UnionBody`.\n  * Add: cardinality now used to determine or/xor.\n\n``` ebnf\nFeatureSetDef\n    ::= \"features\" Identifier Cardinality? UnionBody?\n```\n\n**Version: 0.1.41**\n\n* Feature: add support for features from Product Line Engineering.\n  * Add new definition rule `feature_set_def` to rule `definition`.\n  * Add *and*, *or*, *xor* bodies to  `feature_set_def`.\n  * Add basic documentation to book.\n* Feature: updates to builtin simple types.\n  * Add the new type `unsigned`.\n  * Add the new type `binary`.\n  * Rename type `iri_reference` to `iri`.\n\n**Version: 0.1.40**\n\n* Feature: add the Unicode character `\u21a6` to the rule `_has_type` which works better for some typesetting.\n* Feature: add rule for `inequation` alongside `equation`.\n  * Add new rule `inequation` and make it a choice within `simple_sentence`.\n  * Add new rules for inequality relations; `not_equal`, `less_than`, `less_than_or_equal`, `greater_than`, and `greater_than_or_equal`.\n* Refactor: restructure rule `boolean_sentence` into a choice of `unary_boolean_sentence` and `binary_boolean_sentence`.\n  * Add rule `unary_boolean_sentence` for negation only.\n  * Add rule `binary_boolean_sentence` for logical connectives.\n  * Add rules for each logical connective keyword/operator symbols.\n* Refactor: rename field `variable_binding` to ``binding` in rule `quantieid_sentence`.\n* Refactor: use the same rule for empty set in value sequences.\n* Refactor: rename rule `_function_type_expression_to` to `_function_type`.\n* Refactor: add rules `_has_type` and `_type_restriction` and allow both ascii and Unicode arrows.\n  * Add rule `_has_type` for values `->` and `\u2192`.\n  * Add rule `_type_restriction` for values `<-` and `\u2190`.\n* Fix: rules for new shared bindings had confusing names.\n  * Add rule `quantified_variable_binding`.\n  * Rename rule `quantifier_binding` to `quantifier_bound_names`.\n* Docs: add appendix with details of Unicode usage.\n\n**Version: 0.1.39**\n\n* Feature: allow multiple bindings at the head of quantified sentences.\n* Feature: made progress on local scopes in highlighting.\n  * Rename rule `_constant_def` to `constant_def`.\n  * To-do: currently references are not picking up their definition formatting.\n* Refactor: rename rule `name_path` to `function_composition`.\n* Refactor: combine components of the two rules `quantified_sentence` and `sequence_builder`.\n  * Add new shared rule `quantifier_binding` (along with `_bound_name_set`) now used in both sentence and builder.\n  * Add the ability to have more than one name in a binding.\n  * Add the ability for sequence builders to have more than one quantified binding.\n  * Change the field `expression` into a field named `body` of type `constraint_sentence`.\n  * Remove rules `expression` and `conjunctive_expression`.\n* Style: change the order of choices in rule `predicate_value` to match `value` and corresponding sequences.\n\n**Version: 0.1.38**\n\n* Feature: Update naming for iterators to make them consistent.\n  * Rename rule `iterator_target` to `iterator_source`.\n  * Rename field `from` in `type_iterator` to `source`.\n  * Rename field `from` in `sequence_iterator` to `source`.\n\n**Version: 0.1.37**\n\n* Feature: update rule `function_cardinality_expression` to allow sequence constraints.\n  * Rename rule `any_type` to `wildcard`.\n  * Remove rule `any_cardinality` and replace with `wildcard`.\n* Feature: rename lists to sequences.\n  * Rename rule `list_of_predicate_values` to `sequence_of_predicate_values`.\n  * Rename rule `list_of_values` to `sequence_of_values`.\n* Feature: make rule `property_role` private as `_property_role`.\n* Feature: allow sequence constraints on sequence values.\n  * Add rule `_sequence_value_constraints`.\n  * Add optional `_sequence_value_constraints` to rule `sequence_of_predicate_values`.\n  * Add optional `_sequence_value_constraints` to rule `sequence_of_values`.\n\n**Version: 0.1.36**\n\n* Feature: alter the rule `sequence_comprehension` to be more flexible.\n  * Rename rule `sequence_comprehension` to  `sequence_builder`.\n  * Rename rule `returned_value` to `variables` and re-write as a choice of:\n  * Add rule `tuple_variable` to return distinct variables.\n  * Add rule `sequence_variable` to return distinct variables as a sequence.\n  * Add rule `mapping_variable` to return two variables as a mapping.\n\n**Version: 0.1.35**\n\n* Feature: alter the rule `_property_member` to allow property names to be `identifier_reference`.\n  * New interpretation, field `name` in a member will be the name of a role.\n  * Renamed keyword `in`, not `as`.\n  * Renamed field `role` to `property` and made it's type `identifier_reference`.\n\n**Version: 0.1.34**\n\n* Feature: update property definitions to look more like members.\n  * Update rule `property_role` to be a choice of three new rules.\n  * Add rule `identity_role` which is a subset of `identity_member`.\n  * Add rule `role_by_value` which is a subset of `member_by_value`.\n  * Add rule `role_by_reference` which is a subset of `member_by_reference`.\n\n**Version: 0.1.33**\n\n* Feature: renamed quantifier binding targets to be more consistent.\n  * Rename rule `binding_target` to `iterator_target`.\n  * Rename rule `binding_type_reference` to `type_iterator` and field name `from_type` to `from`.\n  * Rename rule `binding_seq_iterator` to `sequence_iterator` and field name `from_sequence` to `from`.\n* Feature: simplified the rule `environment_definition` and made naming more consistent.\n  * Remove optional `signature` field\n  * Remove assignment operators\n  * Rename field name `rhs` to `body` and change to a choice of `function_def` or `_value_def`.\n  * Add rule `function_def` to hold the signature and operators removed from the environment definition.\n  * Rename rule `fn_parameter` to `function_parameter`.\n  * Rename rule `_fn_type` to `_function_type_expression_to`.\n  * Add rules `function_cardinality_expression` and `any_cardinality` to capture cardinality or wildcard.\n  * Add rule `function_type_reference` to allow wildcards.\n* Feature: update queries `highlights`, `locals`, and `tags` for all changes above.\n* Docs: update BNF syntax and diagrams for all changes above.\n  \n**Version: 0.1.32**\n\n* Feature: update environment definition sequence types to use the same syntax as member type and cardinality.\n\n**Version: 0.1.31**\n\n* Feature: update highlighting queries for constraints with support for locals.\n* Feature: add a `locals.scm` file with scopes for formal constraints.\n* Feature: add `\u2205` (empty set) as a synonym for `[]` in constraints.\n* Fix: update the mapping value test case to use domain/range field names.\n\n**Version: 0.1.30**\n\n* Feature (minor): added field names for the domain and range of mapping types and values.\n\n**Version: 0.1.29**\n\n* Fix: an apparent regression, the value for a constructor changed from `simple_value` to `value`. This changes it back.\n\n**Version: 0.1.28**\n\n* Feature: add a mapping type and corresponding value syntax.\n\n**Version: 0.1.27**\n\n* Feature: add *ordering* and *uniqueness* constraints into the cardinality expression. Used to constrain the sequence\n  type of a member.\n\n**Version: 0.1.26**\n\n* Feature: applied same change as 0.1.25 but for property roles as well.\n\n**Version: 0.1.25**\n\n* Feature: changed grammar for reference members:\n  * The production `source_cardinality` has been removed.\n  * The production `member_inverse_name` has been added.\n\n**Version: 0.1.24**\n\n* Feature: constraint changes\n  * Add a *language-tag* to informal constraints.\n  * Add a *wildcard type* for the constraint language.\n\n**Version: 0.1.23**\n\n* Feature: add highlighting test for constraints, had to tweak a few things.\n\n**Version: 0.1.22**\n\n* Feature: clarify rules and associated meaning.\n  * Rename the grammar rule `type_definition` to `definition` to address the fact that property definitions aren't types.\n  * Rename the grammar rule `enum_variant` to `value_variant` to align with `type_variant` on unions.\n\n**Version: 0.1.21**\n\n* Feature: add support for sequence builder support(set builder) syntax.\n* Fix: highlighting/indent/fold updated for constraints.\n* Style: a number of cosmetic changes to formal constraints.\n\n**Version: 0.1.19/0.1.20**\n\n* Fix: minor change to add a field name to the '..' range operator.\n\n**Version: 0.1.18**\n\n* Feature: add a constraint assertion construct. This allows for specific constraints to be documented for any model element.\n  * The grammar rule `annotation` has been renamed `annotation_property`\n  * The grammar rule `constraint` has been added.\n  * A new grammar rule named `annotation` is defined as a choice of `annotation_property` or `constraint`.\n  * This allows the use of the old rule to be subsumed by the new definition.\n* Constraints can be written in informal unstructured fashion or an embedded formalism.\n  * The informal representation is simply a string.\n  * The formal representation is a syntax that maps to a subset of [ISO/IEC 24707:2018](https://www.iso.org/standard/66249.html) Common Logic.\n* More documentation added on the RDF mapping and the domain modeling process.\n\n``` sdml\nmodule example is\n\n    import tag\n\n    structure Thing is\n    \n      inner -> {0..} InnerThing is\n        ;; informal\n        assert same_tags = \"All inner tags contain a tag value \\\"This\\\".\"\n        ;; formal\n        assert same_tags_formal is\n          forall self ( not_empty(self) and contains(self.tags \"This\") )\n        end\n      end\n      \n    end\n    \n    structure InnerThing is\n      tags -> {0..} tag:Tag\n    end\n    \nend\n```\n\n**Version: 0.1.17**\n\n* Fixed highlighting for properties.\n\n**Version: 0.1.16**\n\n* Adjusted property grammar.\n* Started on property documentation.\n\n``` sdml\nmodule ddict is\n  import account\n  \n  property accountId is\n    @skos:prefLabel = \"accountId\"@en\n    @skos:altLabel = \"account_id\"@en\n    \n    identifier -> {1} account:AccountId is\n      @skos:definition = \"Used as an identifier for account-scoped things\"@en\n    end\n    \n    reference ref {1} -> {1} account:AccountId\n  end\n  \n  structure Account is\n    accountId as identifier\n    name -> string\n  end\n\nend\n```\n\n**Version: 0.1.15**\n\n* Added new structure to the grammar to allow data-dictionary style reusable property definitions.\n\n``` sdml\nmodule ddict is\n  import account\n  \n  property accountId -> account:AccountId is\n    @skos:prefLabel = \"accountId\"@en\n    @skos:altLabel = \"account_id\"@en\n    \n    identifier is\n      @skos:definition = \"Used as ...\"@en\n    end\n    \n    default = {1..1}\n  end\n  \n  structure Account is\n    accountId as default\n    name -> string\n  end\n\nend\n\n```\n\n**Version: 0.1.14**\n\n* Added new rule named `builtin_simple_type` (choice of `string`, `double`, `decimal`, `integer`, `boolean`, and `iri`):\n  * replaced `identifier_reference` with new rule `data_type_base` for `data_type_def`,\n  * added to the `type_reference` choice used for the member `target` field.\n  \nAllows both:\n\n``` sdml\nmodule example is\n\n  datatype mystring <- string\n  \n  structure Person is\n    name -> string\n    age -> integer\n  end\nend\n```\n\nWhere the keywords `string` and `integer` will be expanded into the qualified identifiers `sdml:string` and\n`sdml:integer` respectively.\n\n**Version: 0.1.13**\n\n* Added explicit `base` grammar for module rather than using `xml:base` as an attribute.\n* Expanded grammar for `Identifier` to allow decimal digits in any position *after* the first.\n* Clarified the grammar for `TypeVariant`.\n\nIntroduces:\n\n```sdml\nmodule example base <https://example.org/v/example> is\nend\n```\n\nWhich replaces the annotation form:\n\n```sdml\nmodule example is\n  import xml\n  \n  @xml:base = <https://example.org/v/example>\nend\n```\n\n**Version: 0.1.12**\n\n* Fixed highlight issue for annotations with `IdentifierReference` values\n* Added field for `TypeVariant` name\n\n**Version: 0.1.11**\n\n* Added a rename to optional value to `TypeVariant`\n* Fixed `annotation` and `language_tag` grammar rule conflict\n\nIntroduces:\n\n```sdml\nmodule example is\n\n  union Example is\n    Variant1\n    Variant1 as Alternative\n  end\nend\n```\n\nThis allows the use of the same type as a variant more than once if the new identifier is unique within the same `union`.\n\n**Version: 0.1.10**\n\n* Cleaned up queries.\n\n**Version: 0.1.9**\n\n* Simplified the disjoint `UnionDef` type.\n\n**Version: 0.1.8**\n\n* Added a disjoint `UnionDef` type.\n\n**Version: 0.1.7**\n\n* Made field name `sourceCardinality` into `source_cardinality`.\n* Made field name `targetCardinality` into `target_cardinality`.\n* Added versioning annotations\n\n**Version: 0.1.6**\n\n* Made `_simple_value` into `simple_value` named rule.\n* Made `_type_reference` into `type_reference` named rule.\n  \n# Additional Links\n\n* Node bindings -- [npm.js](https://www.npmjs.com/package/tree-sitter-sdml)\n* Rust bindings -- [crates.io](https://crates.io/crates/tree-sitter-sdml)\n* Emacs -- [sdml-mode](https://github.com/johnstonskj/emacs-sdml-mode)\n* Command-line tool -- [rust-sdml](https://github.com/johnstonskj/rust-sdml)\n",
    "bugtrack_url": null,
    "license": "Copyright 2023 Simon Johnston <johnstonskj@gmail.com>  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ",
    "summary": "SDML grammar for tree-sitter",
    "version": "0.3.2",
    "project_urls": {
        "Homepage": "https://github.com/tree-sitter/tree-sitter-sdml"
    },
    "split_keywords": [
        "incremental",
        " parsing",
        " tree-sitter",
        " sdml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "64d95d733ff7aabb5771043bc934822ff7302dc6f627c44bbf02c4a6b14d84a1",
                "md5": "f68ef1b9865916165e9c894e8db92b3e",
                "sha256": "671d4133f61ed051a1b3976228ca01e73ac0ece98bb543532699de3709a71c76"
            },
            "downloads": -1,
            "filename": "tree_sitter_sdml-0.3.2-cp38-abi3-macosx_14_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "f68ef1b9865916165e9c894e8db92b3e",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 53675,
            "upload_time": "2024-07-02T18:20:36",
            "upload_time_iso_8601": "2024-07-02T18:20:36.003090Z",
            "url": "https://files.pythonhosted.org/packages/64/d9/5d733ff7aabb5771043bc934822ff7302dc6f627c44bbf02c4a6b14d84a1/tree_sitter_sdml-0.3.2-cp38-abi3-macosx_14_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dbb2bb9ba3f45455de19433dac4772359e66fc109cfb62f3f8204dacdd0aa384",
                "md5": "0cb5bf6934a5d6d952ae5230a981b075",
                "sha256": "26c817f5f747985e689daa8ff231e04820827e4ddf38a1c60f4fcfe61f93303d"
            },
            "downloads": -1,
            "filename": "tree_sitter_sdml-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "0cb5bf6934a5d6d952ae5230a981b075",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 54573,
            "upload_time": "2024-07-02T18:22:21",
            "upload_time_iso_8601": "2024-07-02T18:22:21.559316Z",
            "url": "https://files.pythonhosted.org/packages/db/b2/bb9ba3f45455de19433dac4772359e66fc109cfb62f3f8204dacdd0aa384/tree_sitter_sdml-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-02 18:22:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tree-sitter",
    "github_project": "tree-sitter-sdml",
    "github_not_found": true,
    "lcname": "tree-sitter-sdml"
}
        
Elapsed time: 0.31841s