sysmledgraph 0.7.0
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.
- package/README.md +71 -0
- package/dist/bin/cli.d.ts +6 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +61 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +8 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/src/cli/commands.d.ts +22 -0
- package/dist/src/cli/commands.d.ts.map +1 -0
- package/dist/src/cli/commands.js +87 -0
- package/dist/src/cli/commands.js.map +1 -0
- package/dist/src/discovery/find-sysml.d.ts +16 -0
- package/dist/src/discovery/find-sysml.d.ts.map +1 -0
- package/dist/src/discovery/find-sysml.js +30 -0
- package/dist/src/discovery/find-sysml.js.map +1 -0
- package/dist/src/discovery/load-order.d.ts +11 -0
- package/dist/src/discovery/load-order.d.ts.map +1 -0
- package/dist/src/discovery/load-order.js +85 -0
- package/dist/src/discovery/load-order.js.map +1 -0
- package/dist/src/graph/connection.d.ts +6 -0
- package/dist/src/graph/connection.d.ts.map +1 -0
- package/dist/src/graph/connection.js +7 -0
- package/dist/src/graph/connection.js.map +1 -0
- package/dist/src/graph/graph-store.d.ts +37 -0
- package/dist/src/graph/graph-store.d.ts.map +1 -0
- package/dist/src/graph/graph-store.js +108 -0
- package/dist/src/graph/graph-store.js.map +1 -0
- package/dist/src/graph/schema.d.ts +13 -0
- package/dist/src/graph/schema.d.ts.map +1 -0
- package/dist/src/graph/schema.js +21 -0
- package/dist/src/graph/schema.js.map +1 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +14 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/indexer/indexer.d.ts +20 -0
- package/dist/src/indexer/indexer.d.ts.map +1 -0
- package/dist/src/indexer/indexer.js +56 -0
- package/dist/src/indexer/indexer.js.map +1 -0
- package/dist/src/indexer/pipeline-phases.d.ts +8 -0
- package/dist/src/indexer/pipeline-phases.d.ts.map +1 -0
- package/dist/src/indexer/pipeline-phases.js +14 -0
- package/dist/src/indexer/pipeline-phases.js.map +1 -0
- package/dist/src/mcp/resources/context.d.ts +6 -0
- package/dist/src/mcp/resources/context.d.ts.map +1 -0
- package/dist/src/mcp/resources/context.js +45 -0
- package/dist/src/mcp/resources/context.js.map +1 -0
- package/dist/src/mcp/resources/schema.d.ts +6 -0
- package/dist/src/mcp/resources/schema.d.ts.map +1 -0
- package/dist/src/mcp/resources/schema.js +14 -0
- package/dist/src/mcp/resources/schema.js.map +1 -0
- package/dist/src/mcp/server.d.ts +8 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +175 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/tools/clean-index.d.ts +12 -0
- package/dist/src/mcp/tools/clean-index.d.ts.map +1 -0
- package/dist/src/mcp/tools/clean-index.js +22 -0
- package/dist/src/mcp/tools/clean-index.js.map +1 -0
- package/dist/src/mcp/tools/context.d.ts +14 -0
- package/dist/src/mcp/tools/context.d.ts.map +1 -0
- package/dist/src/mcp/tools/context.js +51 -0
- package/dist/src/mcp/tools/context.js.map +1 -0
- package/dist/src/mcp/tools/cypher.d.ts +13 -0
- package/dist/src/mcp/tools/cypher.d.ts.map +1 -0
- package/dist/src/mcp/tools/cypher.js +25 -0
- package/dist/src/mcp/tools/cypher.js.map +1 -0
- package/dist/src/mcp/tools/generate-map.d.ts +13 -0
- package/dist/src/mcp/tools/generate-map.d.ts.map +1 -0
- package/dist/src/mcp/tools/generate-map.js +96 -0
- package/dist/src/mcp/tools/generate-map.js.map +1 -0
- package/dist/src/mcp/tools/impact.d.ts +14 -0
- package/dist/src/mcp/tools/impact.d.ts.map +1 -0
- package/dist/src/mcp/tools/impact.js +47 -0
- package/dist/src/mcp/tools/impact.js.map +1 -0
- package/dist/src/mcp/tools/index-db-graph.d.ts +14 -0
- package/dist/src/mcp/tools/index-db-graph.d.ts.map +1 -0
- package/dist/src/mcp/tools/index-db-graph.js +32 -0
- package/dist/src/mcp/tools/index-db-graph.js.map +1 -0
- package/dist/src/mcp/tools/list-indexed.d.ts +9 -0
- package/dist/src/mcp/tools/list-indexed.d.ts.map +1 -0
- package/dist/src/mcp/tools/list-indexed.js +14 -0
- package/dist/src/mcp/tools/list-indexed.js.map +1 -0
- package/dist/src/mcp/tools/query.d.ts +14 -0
- package/dist/src/mcp/tools/query.d.ts.map +1 -0
- package/dist/src/mcp/tools/query.js +47 -0
- package/dist/src/mcp/tools/query.js.map +1 -0
- package/dist/src/mcp/tools/rename.d.ts +19 -0
- package/dist/src/mcp/tools/rename.d.ts.map +1 -0
- package/dist/src/mcp/tools/rename.js +46 -0
- package/dist/src/mcp/tools/rename.js.map +1 -0
- package/dist/src/parser/lsp-client.d.ts +52 -0
- package/dist/src/parser/lsp-client.d.ts.map +1 -0
- package/dist/src/parser/lsp-client.js +230 -0
- package/dist/src/parser/lsp-client.js.map +1 -0
- package/dist/src/parser/lsp-server-path.d.ts +10 -0
- package/dist/src/parser/lsp-server-path.d.ts.map +1 -0
- package/dist/src/parser/lsp-server-path.js +29 -0
- package/dist/src/parser/lsp-server-path.js.map +1 -0
- package/dist/src/parser/symbols.d.ts +13 -0
- package/dist/src/parser/symbols.d.ts.map +1 -0
- package/dist/src/parser/symbols.js +150 -0
- package/dist/src/parser/symbols.js.map +1 -0
- package/dist/src/parser/sysml-mcp-client.d.ts +109 -0
- package/dist/src/parser/sysml-mcp-client.d.ts.map +1 -0
- package/dist/src/parser/sysml-mcp-client.js +185 -0
- package/dist/src/parser/sysml-mcp-client.js.map +1 -0
- package/dist/src/storage/clean.d.ts +15 -0
- package/dist/src/storage/clean.d.ts.map +1 -0
- package/dist/src/storage/clean.js +44 -0
- package/dist/src/storage/clean.js.map +1 -0
- package/dist/src/storage/list.d.ts +9 -0
- package/dist/src/storage/list.d.ts.map +1 -0
- package/dist/src/storage/list.js +12 -0
- package/dist/src/storage/list.js.map +1 -0
- package/dist/src/storage/location.d.ts +22 -0
- package/dist/src/storage/location.d.ts.map +1 -0
- package/dist/src/storage/location.js +36 -0
- package/dist/src/storage/location.js.map +1 -0
- package/dist/src/storage/registry.d.ts +14 -0
- package/dist/src/storage/registry.d.ts.map +1 -0
- package/dist/src/storage/registry.js +59 -0
- package/dist/src/storage/registry.js.map +1 -0
- package/dist/src/symbol-to-graph/mapping.d.ts +17 -0
- package/dist/src/symbol-to-graph/mapping.d.ts.map +1 -0
- package/dist/src/symbol-to-graph/mapping.js +102 -0
- package/dist/src/symbol-to-graph/mapping.js.map +1 -0
- package/dist/src/types.d.ts +40 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +35 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/worker/client.d.ts +21 -0
- package/dist/src/worker/client.d.ts.map +1 -0
- package/dist/src/worker/client.js +126 -0
- package/dist/src/worker/client.js.map +1 -0
- package/dist/src/worker/gateway.d.ts +79 -0
- package/dist/src/worker/gateway.d.ts.map +1 -0
- package/dist/src/worker/gateway.js +93 -0
- package/dist/src/worker/gateway.js.map +1 -0
- package/dist/src/worker/graph-worker.d.ts +7 -0
- package/dist/src/worker/graph-worker.d.ts.map +1 -0
- package/dist/src/worker/graph-worker.js +91 -0
- package/dist/src/worker/graph-worker.js.map +1 -0
- package/dist/src/worker/protocol.d.ts +21 -0
- package/dist/src/worker/protocol.d.ts.map +1 -0
- package/dist/src/worker/protocol.js +9 -0
- package/dist/src/worker/protocol.js.map +1 -0
- package/docs/INSTALL.md +16 -0
- package/docs/MCP_CLIENT_TEMPLATE_ANALYSIS.md +196 -0
- package/docs/MCP_INTERACTION_GUIDE.md +201 -0
- package/docs/MCP_SERVER_FOR_CURSOR.md +124 -0
- package/docs/PLAN.md +58 -0
- package/docs/PLAN_INDEPENDENT_LSP.md +145 -0
- package/docs/SKILL_DESIGN_PATTERNS.md +305 -0
- package/docs/TOOLS.md +317 -0
- package/lsp/README.md +41 -0
- package/lsp/node_modules/.bin/sysml-mcp +12 -0
- package/lsp/node_modules/.bin/sysml-mcp.cmd +9 -0
- package/lsp/node_modules/.bin/sysml-mcp.ps1 +16 -0
- package/lsp/node_modules/.package-lock.json +22 -0
- package/lsp/node_modules/sysml-v2-lsp/CHANGELOG.md +188 -0
- package/lsp/node_modules/sysml-v2-lsp/LICENSE +21 -0
- package/lsp/node_modules/sysml-v2-lsp/README.md +172 -0
- package/lsp/node_modules/sysml-v2-lsp/dist/server/mcpServer.js +167 -0
- package/lsp/node_modules/sysml-v2-lsp/dist/server/server.js +142 -0
- package/lsp/node_modules/sysml-v2-lsp/index.cjs +23 -0
- package/lsp/node_modules/sysml-v2-lsp/package.json +131 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/.project +17 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/.settings/org.eclipse.jdt.core.prefs +11 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/.meta.json +10 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/.project.json +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml +34 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml +119 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml +143 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml +171 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/.meta.json +8 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/.project.json +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml +83 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml +81 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/.meta.json +8 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/.project.json +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml +899 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml +168 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/.meta.json +10 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/.project.json +19 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml +78 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml +143 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml +39 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml +100 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/.meta.json +29 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/.project.json +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml +42 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml +439 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml +2726 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml +206 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml +1353 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml +1223 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml +2333 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml +958 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml +1537 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml +1564 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml +1169 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml +1256 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml +30 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml +526 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml +107 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml +70 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/SI.sysml +378 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml +48 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml +50 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/Time.sysml +274 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml +260 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml +62 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/.meta.json +8 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/.project.json +19 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml +63 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml +39 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/.meta.json +9 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +11 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/Collections.kerml +147 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/VectorValues.kerml +64 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/.meta.json +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +15 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/BaseFunctions.kerml +80 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/BooleanFunctions.kerml +22 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/CollectionFunctions.kerml +68 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ComplexFunctions.kerml +47 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ControlFunctions.kerml +117 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/DataFunctions.kerml +43 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/IntegerFunctions.kerml +43 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/NaturalFunctions.kerml +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/NumericalFunctions.kerml +43 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/OccurrenceFunctions.kerml +154 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/RationalFunctions.kerml +49 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/RealFunctions.kerml +56 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ScalarFunctions.kerml +33 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/SequenceFunctions.kerml +111 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/StringFunctions.kerml +25 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/TrigFunctions.kerml +35 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/VectorFunctions.kerml +273 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/.meta.json +22 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +15 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml +95 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Clocks.kerml +156 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml +135 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/FeatureReferencingPerformances.kerml +190 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/KerML.kerml +483 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Links.kerml +67 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Metaobjects.kerml +58 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Objects.kerml +212 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Observation.kerml +161 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Occurrences.kerml +992 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Performances.kerml +293 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/SpatialFrames.kerml +197 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/StatePerformances.kerml +145 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Transfers.kerml +281 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/TransitionPerformances.kerml +66 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Triggers.kerml +188 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/.meta.json +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/.project.json +19 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Actions.sysml +552 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Allocations.sysml +29 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/AnalysisCases.sysml +38 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Attributes.sysml +25 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Calculations.sysml +37 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Cases.sysml +71 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Connections.sysml +60 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Constraints.sysml +44 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Flows.sysml +126 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Interfaces.sysml +89 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Items.sysml +153 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Metadata.sysml +32 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Parts.sysml +81 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Ports.sysml +54 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Requirements.sysml +194 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/StandardViewDefinitions.sysml +123 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/States.sysml +103 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/SysML.sysml +539 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/UseCases.sysml +57 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/VerificationCases.sysml +103 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Views.sysml +164 -0
- package/lsp/package-lock.json +30 -0
- package/lsp/package.json +15 -0
- package/lsp/test-server.mjs +120 -0
- package/package.json +61 -0
- package/scripts/access-sysml-mcp.mjs +45 -0
- package/scripts/check-sysml-v2-lsp-version.mjs +39 -0
- package/scripts/clean.mjs +14 -0
- package/scripts/compare-mcp-vs-lsp-symbols.mjs +76 -0
- package/scripts/debug-index.mjs +23 -0
- package/scripts/debug-lsp-symbols.mjs +62 -0
- package/scripts/deploy-skills.mjs +43 -0
- package/scripts/example-sysml-mcp.mjs +27 -0
- package/scripts/export-graph.mjs +80 -0
- package/scripts/generate-map.mjs +110 -0
- package/scripts/index-and-map.mjs +43 -0
- package/scripts/index-and-query.mjs +39 -0
- package/scripts/query-one.mjs +34 -0
- package/scripts/setup-lsp.mjs +36 -0
- package/scripts/test-lsp.mjs +55 -0
- package/scripts/test-mcp-debug.mjs +32 -0
- package/scripts/test-mcp-sysml.mjs +75 -0
- package/scripts/test-mcp-tools.mjs +185 -0
- package/scripts/test-sysml-mcp-from-node_modules.mjs +56 -0
- package/scripts/validate-sysml-file.mjs +69 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
standard library package MeasurementRefCalculations {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package package defines calculations on MeasurementUnits and CoordinateFrames.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
private import ScalarValues::String;
|
|
8
|
+
private import ScalarValues::Real;
|
|
9
|
+
private import MeasurementReferences::MeasurementUnit;
|
|
10
|
+
private import MeasurementReferences::ScalarMeasurementReference;
|
|
11
|
+
private import MeasurementReferences::CoordinateFrame;
|
|
12
|
+
|
|
13
|
+
/* MeasurementUnit operations */
|
|
14
|
+
calc def '*' specializes DataFunctions::'*' { in x: MeasurementUnit[1]; in y: MeasurementUnit[1]; return : MeasurementUnit[1]; }
|
|
15
|
+
calc def '/' specializes DataFunctions::'/' { in x: MeasurementUnit[1]; in y: MeasurementUnit[1]; return : MeasurementUnit[1]; }
|
|
16
|
+
calc def '**' specializes DataFunctions::'**' { in x: MeasurementUnit[1]; in y: Real[1]; return : MeasurementUnit[1]; }
|
|
17
|
+
calc def '^' specializes DataFunctions::'^' { in x: MeasurementUnit[1]; in y: Real[1]; return : MeasurementUnit[1]; }
|
|
18
|
+
|
|
19
|
+
/* CoordinateFrame and MeasurementUnit operations */
|
|
20
|
+
calc def 'CoordinateFrame*' specializes DataFunctions::'*' { in x: CoordinateFrame[1]; in y: MeasurementUnit[1]; return : CoordinateFrame[1]; }
|
|
21
|
+
calc def 'CoordinateFrame/' specializes DataFunctions::'/' { in x: CoordinateFrame[1]; in y: MeasurementUnit[1]; return : CoordinateFrame[1]; }
|
|
22
|
+
|
|
23
|
+
calc def ToString specializes BaseFunctions::ToString {
|
|
24
|
+
doc
|
|
25
|
+
/*
|
|
26
|
+
* Returns the Unicode string symbol representing a scalar measurement reference.
|
|
27
|
+
*/
|
|
28
|
+
in x: ScalarMeasurementReference[1]; return : String[1];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
standard library package MeasurementReferences {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package defines the representations for measurement references.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
private import Collections::Array;
|
|
8
|
+
private import Collections::List;
|
|
9
|
+
private import ScalarValues::*;
|
|
10
|
+
private import VectorValues::ThreeVectorValue;
|
|
11
|
+
|
|
12
|
+
private import SequenceFunctions::size;
|
|
13
|
+
private import SequenceFunctions::equals;
|
|
14
|
+
private import ControlFunctions::forAll;
|
|
15
|
+
private import Quantities::QuantityDimension;
|
|
16
|
+
private import Quantities::VectorQuantityValue;
|
|
17
|
+
private import Quantities::scalarQuantities;
|
|
18
|
+
private import Quantities::ScalarQuantityValue;
|
|
19
|
+
private import Quantities::SystemOfQuantities;
|
|
20
|
+
private import ISQSpaceTime::angularMeasure;
|
|
21
|
+
|
|
22
|
+
attribute def TensorMeasurementReference :> Array {
|
|
23
|
+
doc
|
|
24
|
+
/*
|
|
25
|
+
* TensorMeasurementReference is the most general AttributeDefinition to represent measurement references.
|
|
26
|
+
*
|
|
27
|
+
* The concept "measurement reference" is defined in [VIM] "quantity" NOTE 2 as "A reference can be a measurement unit,
|
|
28
|
+
* a measurement procedure, a reference material, or a combination of such.", see https://jcgm.bipm.org/vim/en/1.1.html .
|
|
29
|
+
* In addition [VIM] "quantity" NOTE 5 states that "A quantity as defined here is a scalar. However, a vector or a tensor,
|
|
30
|
+
* the components of which are quantities, is also considered to be a quantity". However, the rest of [VIM] does not explicitly
|
|
31
|
+
* define how tensor and vector quantities can be or should be supported.
|
|
32
|
+
*
|
|
33
|
+
* In this package, in line with TensorQuantityValue in package Quantities, the most general kind of measurement reference
|
|
34
|
+
* is TensorMeasurementReference that represents a measurement reference for any order of tensor quantity. Since the order can
|
|
35
|
+
* also be one or zero, this includes vector and scalar quantities. The specializations VectorMeasurementReference and
|
|
36
|
+
* ScalarMeasurementReference are defined to specifically represent measurement references for vector and scalar quantities.
|
|
37
|
+
*
|
|
38
|
+
* TensorMeasurementReference specializes Array, which provides its multi-dimensional structure. The order of a tensor is equivalent
|
|
39
|
+
* to the rank of an Array.
|
|
40
|
+
*
|
|
41
|
+
* Attribute isBound specifies whether the vector space product is bound (isBound is true) or free (isBound is false).
|
|
42
|
+
*
|
|
43
|
+
* Attribute mRefs specifies the scalar measurement references for all dimensions of a tensor quantity.
|
|
44
|
+
*
|
|
45
|
+
* The short name of a TensorMeasurementReference is the unique symbol by which the measurement reference is known.
|
|
46
|
+
* The name of a TensorMeasurementReference is spelled-out human readable name of the measurement reference.
|
|
47
|
+
*
|
|
48
|
+
* For example, typical measurement references for (scalar) quantity speed are declared with the following humanId and name:
|
|
49
|
+
* <'m/s'> and 'metre per second',
|
|
50
|
+
* <'km/h'> and 'kilometre per hour',
|
|
51
|
+
* <'mi/h'> and 'mile per hour'.
|
|
52
|
+
*
|
|
53
|
+
* A measurement reference can have zero or more definitionalQuantityValues that allow to specify
|
|
54
|
+
* quantity values that carry a particular meaning or relevance for the measurement reference.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
attribute isBound: Boolean[1] default false;
|
|
58
|
+
attribute order :>> rank;
|
|
59
|
+
attribute mRefs: ScalarMeasurementReference[1..*] nonunique :>> elements;
|
|
60
|
+
attribute definitionalQuantityValues: DefinitionalQuantityValue[0..*];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
attribute def VectorMeasurementReference :> TensorMeasurementReference {
|
|
64
|
+
doc
|
|
65
|
+
/*
|
|
66
|
+
* A VectorMeasurementReference is a specialization of TensorMeasurementReference for vector quantities that are
|
|
67
|
+
* typed by a VectorQuantityValue. Its order is one. Implicitly, it defines a vector space of dimension `n` = dimensions[1].
|
|
68
|
+
* The magnitudes of the `n` basis unit vectors that span the vector space are defined by the mRefs which each are
|
|
69
|
+
* a ScalarMeasurementReference, typically a MeasurementUnit or an IntervalScale.
|
|
70
|
+
*
|
|
71
|
+
* Attribute isOrthogonal declares whether the basis vectors of the vector space are orthogonal, i.e., whether all
|
|
72
|
+
* inner products of any pair of basis vectors are equal to zero.
|
|
73
|
+
*
|
|
74
|
+
* A pair of a specialization of VectorQuantityValue and a specialization of VectorMeasurementReference can also be used to
|
|
75
|
+
* define a vector space for state vectors as used in state-space representation models.
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
attribute :>> dimensions: Positive[0..1];
|
|
79
|
+
attribute isOrthogonal: Boolean[1] default true;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
abstract attribute def ScalarMeasurementReference :> VectorMeasurementReference {
|
|
83
|
+
doc
|
|
84
|
+
/*
|
|
85
|
+
* A ScalarMeasurementReference is a specialization of VectorMeasurementReference for scalar quantities
|
|
86
|
+
* that are typed by a ScalarQuantityValue and for components of tensor or vector quantities.
|
|
87
|
+
* Its order is zero. A ScalarMeasurementReference is also a generalization of MeasurementUnit and MeasurementScale.
|
|
88
|
+
* It establishes how to interpret the numerical value (num) of a ScalarQuantityValue or a component of
|
|
89
|
+
* a tensor or vector quantity value, and establishes its actual quantity dimension.
|
|
90
|
+
*
|
|
91
|
+
* Attribute mRefs is bound to self for a ScalarMeasurementReference, for consistency with tensor and vector measurement references,
|
|
92
|
+
* as the dimension or component of a scalar quantity is itself.
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
attribute :>> dimensions = ();
|
|
96
|
+
attribute :>> isOrthogonal = true;
|
|
97
|
+
attribute :>> mRefs = self;
|
|
98
|
+
attribute quantityDimension: QuantityDimension[1];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
attribute def CoordinateFrame :> VectorMeasurementReference {
|
|
102
|
+
doc
|
|
103
|
+
/*
|
|
104
|
+
* CoordinateFrame is a VectorMeasurementReference with the specific purpose to quantify (i.e., coordinatize) a vector space,
|
|
105
|
+
* and locate and orient it with respect to another CoordinateFrame.
|
|
106
|
+
*
|
|
107
|
+
* Optional attribute transformation enables specification of the location and orientation of this CoordinateFrame as dependent
|
|
108
|
+
* and nested with respect to another (reference) coordinate frame. Typically the other CoordinateFrame is the frame of
|
|
109
|
+
* the next higher element (Object, Item or Part) in a composite structure.
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
attribute transformation: CoordinateTransformation[0..1] {
|
|
113
|
+
attribute :>> target = that;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
attribute def '3dCoordinateFrame' :> CoordinateFrame {
|
|
118
|
+
doc
|
|
119
|
+
/*
|
|
120
|
+
* Most general 3-dimensional coordinate frame
|
|
121
|
+
*/
|
|
122
|
+
attribute :>> dimensions = 3;
|
|
123
|
+
}
|
|
124
|
+
alias ThreeDCoordinateFrame for '3dCoordinateFrame';
|
|
125
|
+
|
|
126
|
+
abstract attribute def CoordinateTransformation {
|
|
127
|
+
doc
|
|
128
|
+
/*
|
|
129
|
+
* CoordinateTransformation is the most general representation of the transformation of a target VectorMeasurementReference
|
|
130
|
+
* with respect to a source VectorMeasurementReference.
|
|
131
|
+
*/
|
|
132
|
+
attribute source: VectorMeasurementReference[1];
|
|
133
|
+
attribute target: VectorMeasurementReference[1];
|
|
134
|
+
assert constraint validSourceTargetDimensions { source.dimensions == target.dimensions }
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
attribute def CoordinateFramePlacement :> CoordinateTransformation {
|
|
138
|
+
doc
|
|
139
|
+
/*
|
|
140
|
+
* CoordinateFramePlacement is a CoordinateTransformation by placement of the target frame in the source frame.
|
|
141
|
+
*
|
|
142
|
+
* Attribute origin specifies the location of the origin of the target frame as a vector in the source frame.
|
|
143
|
+
*
|
|
144
|
+
* Attribute basisDirections specifies the orientation of the target frame by specifying the directions of
|
|
145
|
+
* the respective basis vectors of the target frame via direction vectors in the source frame. An empty sequence of
|
|
146
|
+
* basisDirections signifies no change of orientation of the target coordinate frame.
|
|
147
|
+
*/
|
|
148
|
+
|
|
149
|
+
attribute origin : VectorQuantityValue[1];
|
|
150
|
+
attribute basisDirections : VectorQuantityValue[0..*] ordered nonunique;
|
|
151
|
+
assert constraint validOriginDimensions { origin.dimensions == source.dimensions }
|
|
152
|
+
assert constraint { size(basisDirections) == 0 or size(basisDirections) == source.dimensions#(1)}
|
|
153
|
+
assert constraint validateBasisDirections { basisDirections->forAll { in basisDirection : VectorQuantityValue;
|
|
154
|
+
basisDirection.dimensions->equals(source.dimensions) }
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
abstract attribute def TranslationOrRotation {
|
|
159
|
+
doc
|
|
160
|
+
/*
|
|
161
|
+
* TranslationOrRotation is an abstract union of Translation and Rotation
|
|
162
|
+
*/
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
attribute def Translation :> TranslationOrRotation {
|
|
166
|
+
doc
|
|
167
|
+
/*
|
|
168
|
+
* Representation of a translation with respect to a coordinate frame
|
|
169
|
+
*
|
|
170
|
+
* Attribute translationVector specifies the displacement vector that constitutes the translation.
|
|
171
|
+
*/
|
|
172
|
+
|
|
173
|
+
attribute translationVector : VectorQuantityValue[1];
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
attribute def Rotation :> TranslationOrRotation {
|
|
177
|
+
doc
|
|
178
|
+
/*
|
|
179
|
+
* Representation of a rotation about an axis over an angle
|
|
180
|
+
*
|
|
181
|
+
* Attribute axisDirection specifies the direction of the rotation axis.
|
|
182
|
+
* Attribute angle specifies the angle of rotation, where a positive value implies right-handed rotation.
|
|
183
|
+
* Attribute isIntrinsic asserts whether the intermediate coordinate frame moves with the rotation or not,
|
|
184
|
+
* i.e. whether an instrinsic or extrinsic rotation is specified.
|
|
185
|
+
*
|
|
186
|
+
* See https://en.wikipedia.org/wiki/Davenport_chained_rotations for details.
|
|
187
|
+
*/
|
|
188
|
+
|
|
189
|
+
attribute axisDirection : VectorQuantityValue[1];
|
|
190
|
+
attribute angle :>> angularMeasure;
|
|
191
|
+
attribute isIntrinsic : Boolean[1] default true;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
attribute def TranslationRotationSequence :> CoordinateTransformation, List {
|
|
195
|
+
doc
|
|
196
|
+
/*
|
|
197
|
+
* Coordinate frame transformation specified by a sequence of translations and/or rotations
|
|
198
|
+
*
|
|
199
|
+
* Note: This is a coordinate transformation that is convenient for interpretation by humans.
|
|
200
|
+
* In particular a sequence of rotations about the principal axes of a coordinate frame is much more easy understandable
|
|
201
|
+
* than a rotation about an arbitrary axis.
|
|
202
|
+
* Any sequence can be reduced to a single combination of a translation and a rotation about a particular axis, but in general
|
|
203
|
+
* the original sequence cannot be retrieved as there are infinitely many sequences representing the reduced transformation.
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
attribute :>> elements : TranslationOrRotation[1..*] ordered nonunique;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
attribute def AffineTransformationMatrix3d :> CoordinateTransformation, Array {
|
|
210
|
+
doc
|
|
211
|
+
/*
|
|
212
|
+
* AffineTransformationMatrix3d is a three dimensional CoordinateTransformation specified via an affine transformation matrix
|
|
213
|
+
*
|
|
214
|
+
* The interpretation of the matrix is as follows:
|
|
215
|
+
* - the upper left 3x3 matrix represents the rotation matrix
|
|
216
|
+
* - the uper right 3x1 column vector represents the translation vector
|
|
217
|
+
* - the bottom row must be the row vector (0, 0, 0, 1).
|
|
218
|
+
*
|
|
219
|
+
* I.e. the matrix has the following form:
|
|
220
|
+
* ( R, R, R, T,
|
|
221
|
+
* R, R, R, T,
|
|
222
|
+
* R, R, R, T,
|
|
223
|
+
* 0, 0, 0, 1 )
|
|
224
|
+
* where the cells marked R form the rotation matrix and the cells marked T form the translation vector.
|
|
225
|
+
*
|
|
226
|
+
* Note: See https://en.wikipedia.org/wiki/Transformation_matrix, under affine transformations for a general explanation.
|
|
227
|
+
*/
|
|
228
|
+
|
|
229
|
+
attribute rotationMatrix : Array {
|
|
230
|
+
attribute :>> elements : Real[9] ordered nonunique;
|
|
231
|
+
attribute :>> dimensions = (3, 3);
|
|
232
|
+
}
|
|
233
|
+
attribute translationVector : ThreeVectorValue[1] { :>> elements : Real[3]; }
|
|
234
|
+
attribute :>> dimensions = (4, 4);
|
|
235
|
+
attribute :>> elements : Real[16] ordered nonunique = (
|
|
236
|
+
rotationMatrix.elements#(1), rotationMatrix.elements#(2), rotationMatrix.elements#(3), translationVector#(1),
|
|
237
|
+
rotationMatrix.elements#(4), rotationMatrix.elements#(5), rotationMatrix.elements#(6), translationVector#(2),
|
|
238
|
+
rotationMatrix.elements#(7), rotationMatrix.elements#(8), rotationMatrix.elements#(9), translationVector#(3),
|
|
239
|
+
0, 0, 0, 1);
|
|
240
|
+
assert constraint validSourceDimensions { source.dimensions == 3 }
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
attribute def NullTransformation :> AffineTransformationMatrix3d {
|
|
244
|
+
doc
|
|
245
|
+
/*
|
|
246
|
+
* NullTransformation is a three dimensional CoordinateTransformation that places the target CoordinateFrame at the
|
|
247
|
+
* same position and orientation as the source CoordinateFrame.
|
|
248
|
+
*/
|
|
249
|
+
attribute :>> rotationMatrix {
|
|
250
|
+
attribute :>> elements = (1, 0, 0, 0, 1, 0, 0, 0, 1);
|
|
251
|
+
}
|
|
252
|
+
attribute :>> translationVector {
|
|
253
|
+
attribute :>> elements = (0, 0, 0);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
attribute nullTransformation : NullTransformation [1];
|
|
258
|
+
|
|
259
|
+
abstract attribute def MeasurementUnit :> ScalarMeasurementReference {
|
|
260
|
+
doc
|
|
261
|
+
/*
|
|
262
|
+
* Representation of a measurement unit.
|
|
263
|
+
*
|
|
264
|
+
* Note: MeasurementUnit directly specializes ScalarMeasurementReference in order to allow for efficient and intuitive definition of a ratio scale.
|
|
265
|
+
*
|
|
266
|
+
* A MeasurementUnit can be used in two ways:
|
|
267
|
+
* 1. Directly as the mRef in a ScalarQuantityValue, which implies that the effective measurement reference is a ratio scale defined by the unit.
|
|
268
|
+
* 2. As the unit of a MeasurementScale.
|
|
269
|
+
*
|
|
270
|
+
* A MeasurementUnit specifies one or more UnitPowerFactors.
|
|
271
|
+
*/
|
|
272
|
+
|
|
273
|
+
attribute :>> isBound = false;
|
|
274
|
+
attribute unitPowerFactors: UnitPowerFactor[0..*] ordered;
|
|
275
|
+
attribute unitConversion: UnitConversion[0..1];
|
|
276
|
+
assert constraint hasValidUnitPowerFactors : VerifyUnitPowerFactors {
|
|
277
|
+
in unitPowerFactors = MeasurementUnit::unitPowerFactors;
|
|
278
|
+
in quantityDimension = MeasurementUnit::quantityDimension;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
abstract attribute def SimpleUnit :> MeasurementUnit {
|
|
284
|
+
doc
|
|
285
|
+
/*
|
|
286
|
+
* Representation of a measurement unit that does not depend on any other measurement unit.
|
|
287
|
+
*/
|
|
288
|
+
|
|
289
|
+
private attribute simpleUnitSelf: SimpleUnit = self;
|
|
290
|
+
attribute :>> unitPowerFactors: UnitPowerFactor[1] {
|
|
291
|
+
attribute unit :>> UnitPowerFactor::unit = simpleUnitSelf;
|
|
292
|
+
attribute exponent :>> UnitPowerFactor::exponent = 1;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
abstract attribute def DerivedUnit :> MeasurementUnit {
|
|
298
|
+
doc
|
|
299
|
+
/*
|
|
300
|
+
* Representation of a derived measurement unit that depends on one or more powers of other measurement units.
|
|
301
|
+
*
|
|
302
|
+
* VIM defines "derived unit" as "measurement unit for a derived quantity", see https://jcgm.bipm.org/vim/en/1.11.html .
|
|
303
|
+
*/
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
attribute def UnitPowerFactor {
|
|
308
|
+
doc
|
|
309
|
+
/*
|
|
310
|
+
* Representation of a measurement unit power factor, which is a tuple
|
|
311
|
+
* of a referenced measurement unit and an exponent.
|
|
312
|
+
*/
|
|
313
|
+
|
|
314
|
+
attribute unit: MeasurementUnit;
|
|
315
|
+
attribute exponent: Real;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
abstract attribute def UnitConversion {
|
|
319
|
+
doc
|
|
320
|
+
/*
|
|
321
|
+
* Representation of the linear conversion relationship between one measurement unit and another measurement unit, that acts as a reference.
|
|
322
|
+
*
|
|
323
|
+
* Attribute isExact asserts whether the conversionFactor is exact or not. By default it is set true.
|
|
324
|
+
*/
|
|
325
|
+
|
|
326
|
+
attribute referenceUnit: MeasurementUnit;
|
|
327
|
+
attribute conversionFactor: Real;
|
|
328
|
+
attribute isExact: Boolean default true;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
attribute def ConversionByConvention :> UnitConversion {
|
|
332
|
+
doc
|
|
333
|
+
/*
|
|
334
|
+
* Representation of a UnitConversion that is defined according to some convention.
|
|
335
|
+
*/
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
attribute def ConversionByPrefix :> UnitConversion {
|
|
339
|
+
doc
|
|
340
|
+
/*
|
|
341
|
+
* Representation of a UnitConversion that is defined through reference to a named unit prefix,
|
|
342
|
+
* that in turn represents a decimal or binary multiple or sub-multiple, as defined in ISO/IEC 80000-1.
|
|
343
|
+
*
|
|
344
|
+
* Note: The actual value of the conversion factor is derived from the definition of the unit prefix.
|
|
345
|
+
*
|
|
346
|
+
* Examples: kilometre for conversion factor 1000 with reference unit metre, nanofarad for 1E-9 farad.
|
|
347
|
+
*/
|
|
348
|
+
|
|
349
|
+
attribute prefix: UnitPrefix[1];
|
|
350
|
+
attribute conversionFactor redefines UnitConversion::conversionFactor = prefix.conversionFactor;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
attribute def UnitPrefix {
|
|
354
|
+
doc
|
|
355
|
+
/*
|
|
356
|
+
* Representation of a multiple or sub-multiple measurement unit prefix as defined in ISO/IEC 80000-1.
|
|
357
|
+
*/
|
|
358
|
+
|
|
359
|
+
attribute longName: String;
|
|
360
|
+
attribute symbol: String;
|
|
361
|
+
attribute conversionFactor: Real;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
abstract attribute def MeasurementScale :> ScalarMeasurementReference {
|
|
366
|
+
doc
|
|
367
|
+
/*
|
|
368
|
+
* Representation of a non-ratio measurement scale as opposed to a ratio measurement scale defined by a MeasurementUnit.
|
|
369
|
+
*
|
|
370
|
+
* Note: A ratio scale is implied by direct use of a MeasurementUnit as the mRef in a ScalarQuantityValue.
|
|
371
|
+
*/
|
|
372
|
+
|
|
373
|
+
attribute unit: MeasurementUnit;
|
|
374
|
+
attribute quantityValueMapping: QuantityValueMapping[0..1];
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
attribute def OrdinalScale :> MeasurementScale {
|
|
378
|
+
doc
|
|
379
|
+
/*
|
|
380
|
+
* Representation of an ordinal measurement scale.
|
|
381
|
+
*/
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
attribute def IntervalScale :> MeasurementScale, CoordinateFrame {
|
|
385
|
+
doc
|
|
386
|
+
/*
|
|
387
|
+
* Representation of an interval measurement scale.
|
|
388
|
+
*
|
|
389
|
+
* An IntervalScale is also a CoordinateFrame
|
|
390
|
+
* The offset of one interval measurement scale w.r.t. another interval or ratio scale is defined through a quantityValueMapping, see MeasurementReference.
|
|
391
|
+
*/
|
|
392
|
+
|
|
393
|
+
attribute :>> isBound = true;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
attribute def CyclicRatioScale :> MeasurementScale {
|
|
397
|
+
doc
|
|
398
|
+
/*
|
|
399
|
+
* Representation of a ratio measurement scale with a periodic cycle.
|
|
400
|
+
*
|
|
401
|
+
* Note: The magnitude of the periodic cycle is defined by the modulus of the scale.
|
|
402
|
+
* Example: Planar angle with modulus 360 degrees, therefore on such a cyclic ratio scale,
|
|
403
|
+
* an angle of 450 degrees is equivalent to an angle of 90 degrees, and -60 degrees is equivalent to 300 degrees.
|
|
404
|
+
*/
|
|
405
|
+
|
|
406
|
+
attribute modulus: Number;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
attribute def LogarithmicScale :> MeasurementScale {
|
|
410
|
+
doc
|
|
411
|
+
/*
|
|
412
|
+
* Representation of a logarithmic measurement scale
|
|
413
|
+
*
|
|
414
|
+
* The magnitude v of a ratio quantity value expressed on a logarithmic scale
|
|
415
|
+
* for a magnitude x of a quantity value expressed on a ratio scale is computed as follows:
|
|
416
|
+
* v = f * log_base( (x / x_ref )^a )
|
|
417
|
+
* where:
|
|
418
|
+
* f is a multiplication factor,
|
|
419
|
+
* log_base is the log function for the given logarithm base,
|
|
420
|
+
* x is the actual quantity,
|
|
421
|
+
* x_ref is a reference quantity,
|
|
422
|
+
* a is an exponent.
|
|
423
|
+
*/
|
|
424
|
+
|
|
425
|
+
attribute logarithmBase: Number;
|
|
426
|
+
attribute factor: Number;
|
|
427
|
+
attribute exponent: Number;
|
|
428
|
+
attribute referenceQuantity: ScalarQuantityValue[0..1];
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
attribute def QuantityValueMapping {
|
|
432
|
+
doc
|
|
433
|
+
/*
|
|
434
|
+
* Representation of the mapping of equivalent quantity values expressed on two different MeasurementReferences
|
|
435
|
+
*
|
|
436
|
+
* A QuantityValueMapping specifies a mapping from a given mappedQuantityValue owned by the MeasurementReference
|
|
437
|
+
* that owns the QuantityValueMapping to a referenceQuantityValue owned by another MeasurementReference.
|
|
438
|
+
*
|
|
439
|
+
* Example: The mapping between the temperature value of 0.01 degree Celsius on the celsius temperature scale
|
|
440
|
+
* to the equivalent temperature value of 273.16 K on the kelvin temperature scale,
|
|
441
|
+
* would specify a mappedQuantityValue referencing the
|
|
442
|
+
* the DefinitionalQuantityValue (0.01, "absolute thermodynamic temperature of the triple point of water")
|
|
443
|
+
* of the celsius interval scale, and a referenceQuantityValue referencing the
|
|
444
|
+
* DefinitionalQuantityValue (273.16, "absolute thermodynamic temperature of the triple point of water")
|
|
445
|
+
* of the kelvin ratio scale.
|
|
446
|
+
*/
|
|
447
|
+
|
|
448
|
+
attribute mappedQuantityValue: DefinitionalQuantityValue;
|
|
449
|
+
attribute referenceQuantityValue: DefinitionalQuantityValue;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
attribute def DefinitionalQuantityValue {
|
|
453
|
+
doc
|
|
454
|
+
/*
|
|
455
|
+
* Representation of a particular quantity value that is used in the definition of a TensorMeasurementReference
|
|
456
|
+
*
|
|
457
|
+
* Typically such a particular value is defined by convention. It can be used to define a selected reference value,
|
|
458
|
+
* such as the meaning of zero on a measurement scale or the origin of a top-level coordinate frame.
|
|
459
|
+
*
|
|
460
|
+
* Example: The 'kelvin' MeasurementReference for thermodynamic temperature could have a
|
|
461
|
+
* DefinitionalQuantityValue {
|
|
462
|
+
* :>> num = 273.16;
|
|
463
|
+
* :>> definition = "thermodynamic temperature of the triple point of Vienna Standard Mean Ocean Water in kelvin";
|
|
464
|
+
* }
|
|
465
|
+
* that is value of the definition of the scale.
|
|
466
|
+
*/
|
|
467
|
+
|
|
468
|
+
attribute num: Number[1..*];
|
|
469
|
+
attribute definition: String;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
attribute def DimensionOneUnit :> DerivedUnit {
|
|
473
|
+
doc
|
|
474
|
+
/*
|
|
475
|
+
* Explicit definition of "unit of dimension one", also known as "dimensionless unit".
|
|
476
|
+
*/
|
|
477
|
+
|
|
478
|
+
attribute :>> unitPowerFactors = ();
|
|
479
|
+
}
|
|
480
|
+
attribute def DimensionOneValue :> ScalarQuantityValue {
|
|
481
|
+
doc
|
|
482
|
+
/*
|
|
483
|
+
* A ScalarQuantityValue with a DimensionOneUnit.
|
|
484
|
+
*/
|
|
485
|
+
attribute :>> num: Real;
|
|
486
|
+
attribute :>> mRef: DimensionOneUnit;
|
|
487
|
+
}
|
|
488
|
+
attribute dimensionOneQuantities : DimensionOneValue[*] nonunique :> scalarQuantities;
|
|
489
|
+
|
|
490
|
+
attribute one : DimensionOneUnit[1] = new DimensionOneUnit();
|
|
491
|
+
|
|
492
|
+
attribute def CountValue :> DimensionOneValue {
|
|
493
|
+
doc
|
|
494
|
+
/*
|
|
495
|
+
* Explicit definition of a generic "count" quantity as a DimensionOneValue.
|
|
496
|
+
*/
|
|
497
|
+
}
|
|
498
|
+
attribute countQuantities : CountValue[*] nonunique :> dimensionOneQuantities;
|
|
499
|
+
|
|
500
|
+
attribute def SystemOfUnits {
|
|
501
|
+
doc
|
|
502
|
+
/*
|
|
503
|
+
* A SystemOfUnits represents the essentials of [VIM] concept "system of units" (https://jcgm.bipm.org/vim/en/1.13.html), defined as a
|
|
504
|
+
* "set of base units and derived units, together with their multiples and submultiples, defined in accordance with given rules,
|
|
505
|
+
* for a given system of quantities".
|
|
506
|
+
* The base units are a particular selection of measurement units for each of the base quantities of a system of quantities,
|
|
507
|
+
* that form the basis on top of which all other (derived) units are defined.
|
|
508
|
+
*
|
|
509
|
+
* Attribute systemOfQuantities speficies the associated SystemOfQuantities.
|
|
510
|
+
*/
|
|
511
|
+
|
|
512
|
+
attribute longName: String[1];
|
|
513
|
+
attribute systemOfQuantities : SystemOfQuantities[1];
|
|
514
|
+
attribute baseUnits: SimpleUnit[1..*] ordered;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
constraint def VerifyUnitPowerFactors {
|
|
518
|
+
doc
|
|
519
|
+
/*
|
|
520
|
+
* Constraint definition to verify that the given unit power factors comply with the required quantity dimension
|
|
521
|
+
*/
|
|
522
|
+
|
|
523
|
+
in unitPowerFactors: UnitPowerFactor[*] ordered;
|
|
524
|
+
in quantityDimension: QuantityDimension[1];
|
|
525
|
+
}
|
|
526
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
standard library package Quantities {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package defines the root representations for quantities and their values.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
private import Collections::*;
|
|
8
|
+
private import ScalarValues::NumericalValue;
|
|
9
|
+
private import ScalarValues::Number;
|
|
10
|
+
private import ScalarValues::Real;
|
|
11
|
+
private import ScalarValues::Natural;
|
|
12
|
+
private import ScalarValues::Boolean;
|
|
13
|
+
private import ScalarValues::String;
|
|
14
|
+
private import VectorValues::NumericalVectorValue;
|
|
15
|
+
private import VectorValues::ThreeVectorValue;
|
|
16
|
+
|
|
17
|
+
abstract attribute def TensorQuantityValue :> Array {
|
|
18
|
+
doc
|
|
19
|
+
/*
|
|
20
|
+
* The value of a quantity is a tuple of one or more numbers (i.e. mathematical number values) and a reference to a measurement reference.
|
|
21
|
+
* The most general case is a multi-dimensional, tensor quantity of any order. In engineering, the majority of quantities used are
|
|
22
|
+
* scalar and vector quantities, that are tensor quantities of order 0 and 1 respectively.
|
|
23
|
+
* The measurement reference used to express a quantity value must have a type, dimensions and order that match the quantity, i.e.,
|
|
24
|
+
* a TensorQuantityValue must use a TensorMeasurementReference, a VectorQuantityValue a VectorMeasurementReference,
|
|
25
|
+
* and a ScalarQuantityValue a ScalarMeasurementReference. See package MeasurementReferences for details.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
attribute isBound: Boolean;
|
|
29
|
+
attribute num: Number[1..*] ordered nonunique :>> elements;
|
|
30
|
+
attribute mRef: MeasurementReferences::TensorMeasurementReference;
|
|
31
|
+
attribute :>> dimensions = mRef.dimensions;
|
|
32
|
+
attribute order :>> rank;
|
|
33
|
+
attribute contravariantOrder: Natural;
|
|
34
|
+
attribute covariantOrder: Natural;
|
|
35
|
+
|
|
36
|
+
assert constraint orderSum { contravariantOrder + covariantOrder == order }
|
|
37
|
+
assert constraint boundMatch { (isBound == mRef.isBound) or (not isBound and mRef.isBound) }
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
abstract attribute def VectorQuantityValue :> TensorQuantityValue, NumericalVectorValue {
|
|
41
|
+
attribute :>> mRef: MeasurementReferences::VectorMeasurementReference;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
abstract attribute def ScalarQuantityValue :> VectorQuantityValue, NumericalValue {
|
|
45
|
+
attribute :>> mRef: MeasurementReferences::ScalarMeasurementReference;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
abstract attribute tensorQuantities: TensorQuantityValue[*] nonunique {
|
|
49
|
+
doc
|
|
50
|
+
/*
|
|
51
|
+
* Quantities are defined as self-standing features that can be used to consistently specify quantities as
|
|
52
|
+
* features of occurrences. Each single quantity feature is subsetting the root feature tensorQuantities.
|
|
53
|
+
* In other words, the codomain of a quantity feature is a suitable specialization of TensorQuantityValue.
|
|
54
|
+
*/
|
|
55
|
+
}
|
|
56
|
+
abstract attribute vectorQuantities: VectorQuantityValue[*] nonunique :> tensorQuantities;
|
|
57
|
+
abstract attribute scalarQuantities: ScalarQuantityValue[*] nonunique :> vectorQuantities;
|
|
58
|
+
|
|
59
|
+
abstract attribute def '3dVectorQuantityValue' :> VectorQuantityValue, ThreeVectorValue {
|
|
60
|
+
doc
|
|
61
|
+
/*
|
|
62
|
+
* Most general representation of real 3-vector quantities
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
attribute :>> num: Real[3];
|
|
66
|
+
}
|
|
67
|
+
alias ThreeDVectorQuantityValue for '3dVectorQuantityValue';
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
* Define generic aliases QuantityValue and quantities for the top level quantity attribute def and attribute.
|
|
71
|
+
*/
|
|
72
|
+
alias QuantityValue for TensorQuantityValue;
|
|
73
|
+
alias quantities for tensorQuantities;
|
|
74
|
+
|
|
75
|
+
attribute def SystemOfQuantities {
|
|
76
|
+
doc
|
|
77
|
+
/*
|
|
78
|
+
* A SystemOfQuantities represents the essentials of [VIM] concept "system of quantities" (https://jcgm.bipm.org/vim/en/1.3.html), defined as a
|
|
79
|
+
* "set of quantities together with a set of noncontradictory equations relating those quantities".
|
|
80
|
+
* In order to establish such a set of noncontradictory equations a set of base quantities is selected. Subsequently the system of quantities is
|
|
81
|
+
* completed by adding derived quantities which are products of powers of the base quantities.
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
attribute baseQuantities: ScalarQuantityValue[*] ordered :> scalarQuantities;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
attribute def QuantityPowerFactor {
|
|
88
|
+
doc
|
|
89
|
+
/*
|
|
90
|
+
* Representation of a quantity power factor, being the combination of a quantity and an exponent.
|
|
91
|
+
*
|
|
92
|
+
* A sequence of QuantityPowerFactors for the baseQuantities of a SystemOfQuantities define the QuantityDimension of a scalar quantity.
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
attribute quantity: ScalarQuantityValue[1];
|
|
96
|
+
attribute exponent: Real[1];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
attribute def QuantityDimension {
|
|
100
|
+
doc
|
|
101
|
+
/*
|
|
102
|
+
* Representation of quantity dimension, which is the product of powers of the set of base quantities defined for a particular system of quantities, units and scales.
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
attribute quantityPowerFactors: QuantityPowerFactor[*] ordered;
|
|
106
|
+
}
|
|
107
|
+
}
|