sysml 0.0.1__tar.gz → 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
sysml-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Planetary Utilities
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
sysml-0.1.0/NOTICE ADDED
@@ -0,0 +1,7 @@
1
+ SysML v2 SDK
2
+ Copyright 2026 Planetary Utilities
3
+
4
+ Licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Contributors:
7
+ Vince Molnár
sysml-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,85 @@
1
+ Metadata-Version: 2.4
2
+ Name: sysml
3
+ Version: 0.1.0
4
+ Summary: Spec-shaped SysML v2 SDK: generated metaclass surface over the SysML Toolkit, or over interchange payloads
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/Open-MBEE/sysml-sdk
7
+ Project-URL: Repository, https://github.com/Open-MBEE/sysml-sdk
8
+ Project-URL: Issues, https://github.com/Open-MBEE/sysml-sdk/issues
9
+ Requires-Python: >=3.10
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ License-File: NOTICE
13
+ Provides-Extra: dev
14
+ Requires-Dist: pytest>=7; extra == "dev"
15
+ Dynamic: license-file
16
+
17
+ # sysml
18
+
19
+ Read SysML v2 and KerML models from Python. Every metaclass of the specification is a Python class,
20
+ and every property and operation keeps its specification name (`ownedFeature`, `qualifiedName`,
21
+ `effectiveName()`). A model is read through one of two backends, with the same classes over both:
22
+
23
+ - **the OpenMBEE SysML Toolkit** reads your `.sysml` and `.kerml` files, resolves names and computes
24
+ derived properties;
25
+ - **a payload** is a model exported as full-form interchange JSON by any SysML v2 tool.
26
+
27
+ ```sh
28
+ pip install sysml
29
+ ```
30
+
31
+ Python 3.10 or newer. The wheels for Windows x64, Linux x64 (glibc 2.28 or later), and macOS on Apple
32
+ silicon (11 or later) and on Intel (10.12 or later) carry the SysML Toolkit's binding library and the
33
+ standard library models. On other platforms pip installs the source distribution, which reads
34
+ payloads only.
35
+
36
+ ## First: the standard library
37
+
38
+ Most models refer to the KerML and SysML standard library (`ScalarValues::Real`, `ISQ::mass`, and
39
+ implicitly `Parts::parts` and the like). Get it once, at the start of your program:
40
+
41
+ ```python
42
+ from sysml import standard_library, standard_library_json
43
+
44
+ library_dir = standard_library() # the library models the wheel carries, for the SysML Toolkit
45
+ library_json = standard_library_json() # the library as JSON, for payloads
46
+ ```
47
+
48
+ `standard_library_json()` downloads the JSON (about 11 MB) from this version's GitHub release on its
49
+ first call, checks it against the SHA-256 GitHub states for the file, and keeps it in your user cache;
50
+ later calls read the cache. Where GitHub cannot be reached, download `sysml_library-<version>.zip`
51
+ from the release yourself and set `SYSML_LIBRARY_JSON` to the `sysml.library.full.json` it holds.
52
+
53
+ ## Read a model through the SysML Toolkit
54
+
55
+ ```python
56
+ from sysml import Model, standard_library
57
+
58
+ model = Model.from_toolkit("model.sysml", library_dir=standard_library())
59
+ vehicle = model.resolve("Vehicles::Vehicle")
60
+ print(vehicle.qualifiedName, [f.declaredName for f in vehicle.ownedFeature])
61
+ ```
62
+
63
+ ## Read a payload
64
+
65
+ ```python
66
+ import json
67
+ from sysml import Model, PayloadLibrary, standard_library_json
68
+
69
+ with open(standard_library_json(), encoding="utf-8") as f:
70
+ library = PayloadLibrary(json.load(f)) # read once, share it
71
+ with open("model.json", encoding="utf-8") as f:
72
+ model = Model.from_full_json(json.load(f), library=library)
73
+ ```
74
+
75
+ ## More
76
+
77
+ - The Python guide: <https://github.com/Open-MBEE/sysml-sdk/blob/main/examples/python/README.md>
78
+ - The SDK, its other languages (JavaScript/TypeScript, Java, C#, C++) and its documentation:
79
+ <https://github.com/Open-MBEE/sysml-sdk>
80
+ - What is new, and what the SysML Toolkit does not answer yet:
81
+ <https://github.com/Open-MBEE/sysml-sdk/blob/main/CHANGELOG.md>
82
+
83
+ The SDK is licensed under the Apache License 2.0. The standard library models the wheels carry, and the
84
+ library JSON, are licensed under the Eclipse Public License 2.0: see `sysml/stdlib/LICENSE` and
85
+ `sysml/stdlib/NOTICE` in the installed package.
sysml-0.1.0/README.md ADDED
@@ -0,0 +1,317 @@
1
+ # sysml-sdk
2
+
3
+ The SysML v2 SDK: read SysML v2 and KerML models from Python, JavaScript/TypeScript, Java, C# and
4
+ C++, through an API that has the shape of the OMG specification. Every class, property and
5
+ operation of the KerML and SysML metamodels is there under its specification name
6
+ (`ownedFeature`, `qualifiedName`, `effectiveName()`), and the generated classes form the metaclass
7
+ hierarchy, so `isinstance`, `instanceof` and their equivalents follow the specification's
8
+ generalizations.
9
+
10
+ A model is read through one of two backends, with the same classes over both:
11
+
12
+ - **the SysML Toolkit**: the OpenMBEE SysML Toolkit
13
+ ([Open-MBEE/sysml-toolkit](https://github.com/Open-MBEE/sysml-toolkit), release `v0.10.0`),
14
+ reached through this SDK's binding library. It reads `.sysml` and `.kerml` text, resolves names,
15
+ computes derived properties and evaluates specification operations;
16
+ - **a payload**: a model exported as full-form interchange JSON by any SysML v2 tool, read with no
17
+ native code at all.
18
+
19
+ The SDK never guesses. A property read returns what the SysML Toolkit computed or what the payload
20
+ holds. A member the SysML Toolkit does not answer raises `NotImplementedInToolkit` with the
21
+ SysML Toolkit's reason, and a reference that does not resolve raises `UnresolvedReference`; nothing
22
+ is silently empty.
23
+
24
+ This is release 0.1.0, a preview. The payload backend is the dependable path; the SysML Toolkit
25
+ backend is a preview of the SysML Toolkit's own coverage. What the SysML Toolkit does not answer yet
26
+ is listed under **Known limitations** in [CHANGELOG.md](CHANGELOG.md); [STATUS.md](STATUS.md) has
27
+ the numbers.
28
+
29
+ ## Get started
30
+
31
+ Each guide shows how to install the package, the code that reads a model through the SysML Toolkit
32
+ and the code that reads a JSON export, ready to copy with your file names, and the first queries.
33
+ The code in the guides is run against the release packages before every release.
34
+
35
+ | Language | Guide | Runnable tutorial | Skill for coding agents |
36
+ |---|---|---|---|
37
+ | Python | [examples/python](examples/python/README.md) | [tutorial.py](examples/python/tutorial.py) | [sysml-sdk-python](skills/sysml-sdk-python/SKILL.md) |
38
+ | JavaScript / TypeScript | [examples/typescript](examples/typescript/README.md) | [tutorial.mjs](examples/typescript/tutorial.mjs) | [sysml-sdk-typescript](skills/sysml-sdk-typescript/SKILL.md) |
39
+ | Java | [examples/java](examples/java/README.md) | [Tutorial.java](examples/java/Tutorial.java) | [sysml-sdk-java](skills/sysml-sdk-java/SKILL.md) |
40
+ | C# | [examples/csharp](examples/csharp/README.md) | [Tutorial.cs](examples/csharp/Tutorial.cs) | [sysml-sdk-csharp](skills/sysml-sdk-csharp/SKILL.md) |
41
+ | C++ | [examples/cpp](examples/cpp/README.md) | [tutorial.cpp](examples/cpp/tutorial.cpp) | [sysml-sdk-cpp](skills/sysml-sdk-cpp/SKILL.md) |
42
+
43
+ In Python, the whole thing is:
44
+
45
+ ```python
46
+ from sysml import Model, standard_library
47
+
48
+ model = Model.from_toolkit("model.sysml", library_dir=standard_library())
49
+ vehicle = model.resolve("Vehicles::Vehicle")
50
+ print([feature.declaredName for feature in vehicle.ownedFeature])
51
+ ```
52
+
53
+ [examples/queries/](examples/queries/README.md) goes further: parametric queries over whole models
54
+ (reachable states with trigger sequences, bills of materials, roll-ups, connectivity, requirement
55
+ checks), the same in every language and printing the same report.
56
+
57
+ ## Install
58
+
59
+ Python is on PyPI: `pip install sysml`. The release assets of each version carry one package per
60
+ language (the Python wheels too), the binding library for each platform, and the standard library.
61
+ How the Python packages are published: [PUBLISHING.md](PUBLISHING.md).
62
+
63
+ | Language | Asset | Install | SysML Toolkit backend |
64
+ |---|---|---|---|
65
+ | Python 3.10+ | `sysml-0.1.0-py3-none-<platform>.whl` | `pip install sysml` (or the wheel's file) | included in the wheel |
66
+ | JavaScript / TypeScript (Node 20+, browsers) | `sysml-0.1.0.tgz` | `npm install ./sysml-0.1.0.tgz` | included, as WebAssembly |
67
+ | Java 21+ | `sysml-sdk-0.1.0.jar` | put it on the class path | included in the jar |
68
+ | C# (.NET 8) | `OpenMBEE.SysML.0.1.0.nupkg` | `dotnet add package OpenMBEE.SysML --version 0.1.0 --source <folder with the .nupkg>` | included in the package |
69
+ | C++17 | `sysml-sdk-cpp-0.1.0.zip` | put its `include/` on the include path (header-only) | included in the archive (`lib/<target>/`): copy it beside your program |
70
+
71
+ - **The standard library.** Most models refer to it (`ScalarValues::Real`, `ISQ::mass`, and
72
+ implicitly `Parts::parts` and the like), so a program gets it first, as each language's guide
73
+ shows. Every package carries its models, for the SysML Toolkit: `standard_library()` (Python),
74
+ `standardLibrary()` (JavaScript), `StandardLibrary.directory()` (Java),
75
+ `StandardLibrary.Directory()` (C#), and in C++ `sysml::standard_library()` finds the archive's
76
+ `sysml.library/` copied beside the program. The same library as JSON, for payloads, is too large
77
+ for a package: `standard_library_json()` and its counterparts download it from the release on
78
+ their first call (checked against the SHA-256 GitHub states, kept in the user cache, shared by all
79
+ languages; C++ reads that cache but does not download). `sysml_library-0.1.0.zip` on the release
80
+ has both, for machines without access to GitHub (`SYSML_LIBRARY_JSON` names its JSON). It is the
81
+ SysML v2 release's library, under the Eclipse Public License 2.0.
82
+ - **The binding library** comes with every package: the wheel carries the one for its platform,
83
+ the npm package the WebAssembly build, and the jar, the NuGet package and the C++ archive one for
84
+ each of Windows x64, Linux x64, and macOS on Apple silicon and on Intel. The jar copies its library out on first use and loads it; .NET finds the
85
+ NuGet package's; a C++ program finds the one beside its executable. `SYSMLV2_ABI` (and
86
+ `SYSMLV2_ABI_WASM` for JavaScript) overrides it with another build. The release also has each
87
+ platform's library on its own, `sysmlv2_abi-0.1.0-<target>.zip` (Windows) and `.tar.gz` (others),
88
+ each with a README.
89
+
90
+ | Platform | Target | Wheel tag |
91
+ |---|---|---|
92
+ | Windows x64 | `x86_64-pc-windows-msvc` | `win_amd64` |
93
+ | Linux x64 (glibc 2.28 or later) | `x86_64-unknown-linux-gnu` | `manylinux_2_28_x86_64` |
94
+ | macOS, Apple silicon (11 or later) | `aarch64-apple-darwin` | `macosx_11_0_arm64` |
95
+ | macOS, Intel (10.12 or later) | `x86_64-apple-darwin` | `macosx_10_12_x86_64` |
96
+ | Anywhere JavaScript runs | `wasm32-unknown-unknown` | (in the npm package) |
97
+
98
+ Java: on JDK 21 run with `--enable-preview`, because the foreign function API the SysML Toolkit
99
+ backend uses is a preview there; from JDK 22 on nothing is needed. The jar serves both. Add
100
+ `--enable-native-access=ALL-UNNAMED` to silence the JDK's warning about native access. On macOS, a
101
+ library downloaded through a web browser is quarantined and will not load until the attribute is
102
+ removed: `xattr -d com.apple.quarantine libsysmlv2_abi.dylib`.
103
+
104
+ ## The two backends
105
+
106
+ **The SysML Toolkit** answers from the model itself, through its checked reader: a property is
107
+ read by its specification name, owned or derived, and the SysML Toolkit answers only what it can
108
+ derive completely. Where it cannot yet, it refuses, and the SDK raises `NotImplementedInToolkit`
109
+ with the SysML Toolkit's reason rather than pass on a value that might be wrong. The relationships
110
+ a derived property is computed from belong to the model and are answered, so the guides show both:
111
+ catching a refusal, and reading what the model states (a feature's `ownedTyping` for its `type`, a
112
+ definition's `ownedSubclassification` for its supertypes).
113
+
114
+ Specification operations go through the SysML Toolkit's operation entry point by their
115
+ declaration, with the specification's parameter and result types. The SysML Toolkit has a body for
116
+ a part of them (`effectiveName()`, `resolve`, `resolveGlobal`, `visibleMemberships(...)`,
117
+ `supertypes(...)`, `evaluate(...)`, ...) and answers a call only where its evidence for the model
118
+ at hand is complete; it refuses the others, like a property read.
119
+
120
+ The SysML Toolkit reads the standard library from a directory given when the session opens:
121
+ `library_dir` in Python, the last argument of
122
+ `ToolkitBackend.open(library, paths, sources, libraryDir)` in Java and of `ToolkitBackend.Open(...)`
123
+ in C#, and of `ToolkitBackend::open(paths, sources, library_dir)` in C++. The WebAssembly build
124
+ reads no files itself: in JavaScript pass `libraryDir` in Node, or the library's files as
125
+ `librarySources` (each file's name, without its directories, to its text), which works in a
126
+ browser too. The library loads as a library: its elements are not listed as the model's, and they
127
+ report `isLibraryElement`. The packages' standard library helpers (see [Install](#install)) give the
128
+ directory.
129
+
130
+ The SysML Toolkit also writes the model back out as full-form JSON: `full_json()` in Python,
131
+ `fullJson()` in JavaScript and Java, `FullJson()` in C#, `full_json()` in C++. By default the
132
+ export is written at the closure level, with inherited and imported members filled in; `closures`
133
+ false writes the owned side only, as the SysML Toolkit's command-line tool does.
134
+
135
+ **A payload** answers with what its writer wrote, and nothing else: it needs no native code, and it
136
+ cannot tell a computed value from a stand-in its writer put where it had none. Operations cannot be
137
+ evaluated on a payload and raise `NotImplementedInToolkit`. A reference to an element the payload
138
+ does not contain raises `UnresolvedReference`.
139
+
140
+ A payload refers to the standard library's elements without containing them, by the element ids
141
+ KerML 9.1 and SysML 9.1 prescribe for the library. Read the release's library JSON once as a
142
+ `PayloadLibrary` and pass it with each payload model: the model's references into the library then
143
+ resolve against it. The library's elements are not the model's, so `all`, `roots` and
144
+ `elements_of_type` list the payload's own, as the SysML Toolkit does with its library, and a
145
+ qualified name is looked up in the payload first. The library JSON holds each library element's own
146
+ side: its inherited members are not listed. A model exported without the library loaded refers to
147
+ library names by ids that resolve nowhere; export with the library.
148
+
149
+ Every language has the same three errors: `NotImplementedInToolkit` (a member not answered),
150
+ `UnresolvedReference` (a reference that does not resolve), `Gone` (an element that is no longer
151
+ there); in Java and C# they end in `Exception`, in C++ they are `not_implemented_in_toolkit`,
152
+ `unresolved_reference` and `gone`.
153
+
154
+ ## Names
155
+
156
+ Each language follows its own conventions for package names.
157
+
158
+ | Language | Package | In your code |
159
+ |---|---|---|
160
+ | Python | `sysml` | `import sysml` |
161
+ | JavaScript / TypeScript | `sysml` | `import { Model } from "sysml";` |
162
+ | Java | `sysml-sdk` jar | `org.openmbee.sysml` and `org.openmbee.sysml.classes` |
163
+ | C# | `OpenMBEE.SysML` | `using OpenMBEE.SysML;` |
164
+ | C++ | header-only | namespace `sysml` |
165
+
166
+ In the specification, properties and operations are separate members of a class, and every
167
+ language shows at the call site which one it uses.
168
+
169
+ - Java and C++ read every property through a getter: `get` followed by the specification name
170
+ with its first letter capitalized (`getQualifiedName()`, `getOwnedFeature()`, and for Booleans
171
+ `getIsAbstract()`). Operations keep their specification names (`effectiveName()`,
172
+ `specializes(...)`).
173
+ - Python, C# and TypeScript read properties with property syntax under the specification name
174
+ (`el.qualifiedName`) and call operations by theirs (`el.effectiveName()`). Where an operation
175
+ shares its name with a property of the same class, the operation takes a suffix:
176
+ `instantiatedType` is a property of `InstantiationExpression` and its subclasses, and the
177
+ operation of that name is `instantiatedType_op()` in Python and `instantiatedTypeOp()` in C#
178
+ and TypeScript. TypeScript also suffixes the one operation whose name JavaScript reserves for
179
+ its own protocols: `MultiplicityRange.valueOf` is `valueOfOp()`.
180
+
181
+ Every class carries every member it has, whether it declares it or inherits it. The members of the
182
+ metaclass `Element` itself (`name`, `owner`, `qualifiedName`, `documentation`, `isLibraryElement`,
183
+ `effectiveName()`, ...) are on the runtime element type too, so an element held without its class
184
+ (what `owner` returns) answers them without being narrowed first. Runtime members that are not in the
185
+ specification are spelled so they can never collide with it: `element_id` and `metaclass_name` in
186
+ Python, `$id` and `$metaclass` in Java and TypeScript, `ElementId` and `MetaclassName` in C#,
187
+ `element_id()` and `metaclass_name()` in C++.
188
+
189
+ Every model offers the same helpers: its elements (`all()`, `All()`), those of one metaclass
190
+ (`elements_of_type`, `elementsOfType`, `ElementsOfType<T>()`), and its top-level namespaces
191
+ (`roots`). Elements compare, and hash, by their element id.
192
+
193
+ ## Skills for coding agents
194
+
195
+ [skills/](skills/) holds one skill per language (`sysml-sdk-python`, `sysml-sdk-typescript`,
196
+ `sysml-sdk-java`, `sysml-sdk-csharp`, `sysml-sdk-cpp`), in the Agent Skills format. A skill
197
+ gives a coding agent what it needs to write working code against the SDK from a one-line request
198
+ ("which parts does this model's vehicle have?"): how to load a model with either backend, the shape
199
+ of the API, navigation recipes for common SysML questions (parts, typing, connections and ports,
200
+ states, requirements, multiplicities, attribute roll-ups, expressions), tested helper functions for
201
+ the reads the SysML Toolkit refuses, and how to check the result.
202
+
203
+ To use one, copy its folder into your agent's skills directory; for Claude Code that is
204
+ `.claude/skills/` in a project, or `~/.claude/skills/` for all projects:
205
+
206
+ ```sh
207
+ cp -r skills/sysml-sdk-python ~/.claude/skills/
208
+ ```
209
+
210
+ ## Building from source
211
+
212
+ The binding library (`abi/`) is a Rust crate that depends on the SysML Toolkit by path: clone it
213
+ beside this repository, under its own name `sysml-toolkit`, at the tag
214
+ `vendor/sysml-toolkit/PIN.json` names under `toolkit` (`v0.10.0`). [abi/README.md](abi/README.md)
215
+ has the build, the WebAssembly build, and how to move to a newer SysML Toolkit release.
216
+
217
+ ```sh
218
+ git clone --branch v0.10.0 https://github.com/Open-MBEE/sysml-toolkit
219
+ git -C sysml-toolkit submodule update --init --depth 1 spec-refs/SysML-v2-Release # the standard library, for the tests
220
+ cd sysml-sdk/abi && cargo build --release # the native library, into abi/target/release
221
+ cargo build --release --target wasm32-unknown-unknown # the WebAssembly build
222
+ ```
223
+
224
+ The payload backend needs nothing but each language's own toolchain.
225
+
226
+ ### Layout
227
+
228
+ | Path | What |
229
+ |---|---|
230
+ | `metamodel.json` | The table every language is generated from: the metaclass hierarchy, every class's properties with their types and redefinitions, and its operations with their parameters. |
231
+ | `python/sysml/` | Python: the runtime (`base.py`), the SysML Toolkit backend over `ctypes` (`toolkit.py`), the generated classes. |
232
+ | `ts/` | JavaScript and TypeScript: the runtime, the SysML Toolkit backend over the WebAssembly build (`toolkit.mjs`, Node and browser alike), the generated declarations and metadata. |
233
+ | `java/` | Java, with no dependencies and no build tool: the runtime, the SysML Toolkit backend over the foreign function API, the generated interfaces, and checks. |
234
+ | `csharp/` | C#: the library (runtime, SysML Toolkit backend over P/Invoke, generated interfaces) and a checks project. |
235
+ | `cpp/` | C++17, header-only: the runtime, the SysML Toolkit backend loading the library at run time, the generated structs, and checks. JSON through the vendored nlohmann/json. |
236
+ | `abi/` | The binding library: the C interface over the SysML Toolkit that every language uses. |
237
+ | `tools/` | The extractor, the generators, the packaging and package-check scripts, and the naming tools. |
238
+ | `vendor/` | Pinned inputs: the specification's XMI and the SysML Toolkit's property tables, the naming table of the binding library, nlohmann/json. Each `PIN.json` records provenance and hashes. |
239
+ | `examples/` | The guides and tutorials, one per language, and the query examples (`examples/queries/`): the same parametric queries in every language, printing the same report. |
240
+ | `skills/` | One skill per language for coding agents that write code against the SDK. |
241
+ | `data/`, `python/tests/`, `*/checks` | Test payloads, tests, and the generated conformance checks per language. |
242
+
243
+ ### Regenerate
244
+
245
+ ```sh
246
+ python tools/extract_metamodel.py # vendored XMI and property tables -> metamodel.json
247
+ python tools/gen_toolkit_table.py # the dispatch table of each SysML Toolkit backend (also
248
+ # _java, _cs, _cpp, _js), from vendor/naming-table/
249
+ python tools/gen_classes.py # the Python classes (also _ts, _cs, _java, _cpp)
250
+ python tools/gen_conformance.py # the conformance checks of every language
251
+ python tools/gen_abi.py # abi/src/generated.rs
252
+ python tools/export_example.py --library <sysml.library>
253
+ # the example JSON, through the SysML Toolkit: the payloads
254
+ # (examples/vehicle.full.json, examples/queries/models/*.full.json)
255
+ # and the standard library (examples/sysml.library.full.json)
256
+ ```
257
+
258
+ Generated files are never edited by hand; CI regenerates them and fails on any difference. The
259
+ example JSON is not committed at all: CI generates it once per SysML Toolkit pin and every job that
260
+ reads payloads downloads it, and `tools/package_library.py` packages the library archive as a
261
+ release asset. `tools/naming.py` holds every naming rule and the package names; `tools/rename.py`
262
+ changes those names across the repository.
263
+
264
+ ### Test
265
+
266
+ ```sh
267
+ python -m pytest -q # runtime, conformance, the SysML Toolkit (Annex A needs the
268
+ # sysml-toolkit checkout's spec-refs/SysML-v2-Release)
269
+ python python/demo.py
270
+ node ts/demo.mjs && node ts/conformance.generated.mjs && node ts/toolkit_checks.mjs
271
+ dotnet run --project csharp/OpenMBEE.SysML.Checks -c Release
272
+ javac --enable-preview --release 21 -d java/out $(find java/src -name '*.java')
273
+ java --enable-preview -cp java/out org.openmbee.sysml.checks.Checks
274
+ java --enable-preview -cp java/out org.openmbee.sysml.checks.ToolkitChecks
275
+ g++ -std=c++17 -Wall -Werror -O0 -I cpp/include -I vendor cpp/checks/checks.cpp cpp/checks/conformance.g.cpp -o cpp/out/checks && cpp/out/checks
276
+ g++ -std=c++17 -Wall -Werror -I cpp/include -I vendor cpp/checks/toolkit_checks.cpp -o cpp/out/toolkit_checks && cpp/out/toolkit_checks
277
+ cd abi && cargo test --release --lib && python smoke.py ../examples/vehicle.sysml
278
+ ```
279
+
280
+ The query examples print one report in every language; each run is compared with
281
+ `examples/queries/expected/` (see [examples/queries/README.md](examples/queries/README.md)).
282
+
283
+ Where the SysML Toolkit does not answer a member yet, the tests that need it are expected failures,
284
+ not passes and not failures. `python/tests/toolkit_gaps.py` lists each with the member the
285
+ SysML Toolkit refuses and why; pytest reports them as `xfailed`, a listed test that starts to pass
286
+ fails until its row is removed, and one that stops on anything else fails. The SysML Toolkit check
287
+ programs of the other languages mark theirs the same way (`expected failure: ...`). A query report
288
+ read through the SysML Toolkit stops where the SysML Toolkit refuses a read;
289
+ `tools/compare_report.py` accepts it only at a refusal the same module lists, and only when what the
290
+ report printed up to there equals the expected report:
291
+
292
+ ```sh
293
+ python examples/queries/python/demo.py | python tools/compare_report.py examples/queries/expected/report.txt
294
+ ```
295
+
296
+ The SysML Toolkit checks skip themselves when the binding library is not built; with
297
+ `SYSML_REQUIRE_TOOLKIT=1` a skip is a failure, which is how CI runs them. On Windows with MinGW,
298
+ add `-static` to the C++ commands, and `-Wa,-mbig-obj` for the conformance file. On Linux, add
299
+ `-ldl` to the SysML Toolkit checks.
300
+
301
+ The packages are built with `python tools/package.py <python|sdist|npm|java|csharp|cpp>` and
302
+ checked with `python tools/check_packages.py <python|npm|java|csharp|cpp> --dist <folder>`, which
303
+ installs each one somewhere empty, reads the example model through it, and runs the language's
304
+ guide against it.
305
+
306
+ ## License
307
+
308
+ Copyright 2026 Planetary Utilities. Apache-2.0, see [LICENSE](LICENSE); the contributors are listed
309
+ in [NOTICE](NOTICE), which every package carries. The C++ package includes nlohmann/json, under the
310
+ MIT license (`vendor/nlohmann/LICENSE.MIT`). The packages that carry the binding library also carry
311
+ the notices of the Rust crates compiled into it (`THIRD-PARTY-NOTICES.txt`,
312
+ `RUST-STANDARD-LIBRARY-NOTICES.html`).
313
+
314
+ The standard library archive (`sysml_library-<version>.zip`) is not covered by the SDK's license.
315
+ It holds the SysML v2 release's library models, and a JSON form made from them, both under the
316
+ Eclipse Public License 2.0; the archive carries that license and a NOTICE with the models' source
317
+ and copyright holders.
@@ -0,0 +1,33 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "sysml"
7
+ version = "0.1.0"
8
+ description = "Spec-shaped SysML v2 SDK: generated metaclass surface over the SysML Toolkit, or over interchange payloads"
9
+ requires-python = ">=3.10"
10
+ readme = "python/PYPI.md"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE", "NOTICE"]
13
+
14
+ [project.urls]
15
+ Homepage = "https://github.com/Open-MBEE/sysml-sdk"
16
+ Repository = "https://github.com/Open-MBEE/sysml-sdk"
17
+ Issues = "https://github.com/Open-MBEE/sysml-sdk/issues"
18
+
19
+ [project.optional-dependencies]
20
+ dev = ["pytest>=7"]
21
+
22
+ [tool.setuptools]
23
+ packages = ["sysml"]
24
+ package-dir = {"" = "python"}
25
+
26
+ # A platform wheel carries the binding library in _native/ and the standard library models in
27
+ # stdlib/ (tools/package.py puts them there; the globs skip dot-files, hence the project files).
28
+ [tool.setuptools.package-data]
29
+ sysml = ["*.pyi", "_native/*", "stdlib/**/*", "stdlib/**/.project.json", "stdlib/**/.meta.json"]
30
+
31
+ [tool.pytest.ini_options]
32
+ testpaths = ["python/tests"]
33
+ pythonpath = ["python"]