opensysml 0.12.2.dev20261119__tar.gz → 0.12.2.dev20261122__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.
Files changed (135) hide show
  1. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/PKG-INFO +1 -1
  2. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/__init__.py +8 -2
  3. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/_version.py +1 -1
  4. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/capabilities.py +9 -0
  5. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/connection.py +35 -8
  6. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/document.py +16 -0
  7. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/element_properties.py +23 -3
  8. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/errors.py +48 -4
  9. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/model.py +17 -6
  10. opensysml-0.12.2.dev20261122/opensysml/proto/sysml_pb2.py +549 -0
  11. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/proto/sysml_pb2.pyi +162 -14
  12. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/query.py +15 -2
  13. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/release-digests.json +6 -6
  14. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/values.py +282 -1
  15. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml.egg-info/PKG-INFO +1 -1
  16. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml.egg-info/SOURCES.txt +1 -0
  17. opensysml-0.12.2.dev20261122/tests/test_coordinate_frame.py +169 -0
  18. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_document.py +90 -0
  19. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_element_properties.py +49 -1
  20. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_runtime_integration.py +40 -0
  21. opensysml-0.12.2.dev20261119/opensysml/proto/sysml_pb2.py +0 -523
  22. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/README.md +0 -0
  23. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/_dist.py +0 -0
  24. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/action_run.py +0 -0
  25. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/binary.py +0 -0
  26. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/check.py +0 -0
  27. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/conversion.py +0 -0
  28. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/diagnostic.py +0 -0
  29. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/edit.py +0 -0
  30. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/engines.py +0 -0
  31. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/enumeration.py +0 -0
  32. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/exploration.py +0 -0
  33. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/fmi_runner.py +0 -0
  34. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/generate.py +0 -0
  35. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/importcompare.py +0 -0
  36. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/instance.py +0 -0
  37. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/metamodel/__init__.py +0 -0
  38. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/metamodel/_generated.py +0 -0
  39. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/metamodel/_reader.py +0 -0
  40. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/metamodel/_runtime.py +0 -0
  41. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/proto/__init__.py +0 -0
  42. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/proto/sysml_pb2_grpc.py +0 -0
  43. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/py.typed +0 -0
  44. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/runs.py +0 -0
  45. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/signing.py +0 -0
  46. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/sources.py +0 -0
  47. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/symbol.py +0 -0
  48. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/typed.py +0 -0
  49. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/typefacts.py +0 -0
  50. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml/verdict.py +0 -0
  51. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml.egg-info/dependency_links.txt +0 -0
  52. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml.egg-info/entry_points.txt +0 -0
  53. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml.egg-info/requires.txt +0 -0
  54. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/opensysml.egg-info/top_level.txt +0 -0
  55. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/pyproject.toml +0 -0
  56. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/setup.cfg +0 -0
  57. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_analysis_integration.py +0 -0
  58. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_annotating_metadata.py +0 -0
  59. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_api.py +0 -0
  60. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_api_reference.py +0 -0
  61. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_auth.py +0 -0
  62. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_big_integer.py +0 -0
  63. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_binary.py +0 -0
  64. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_capabilities.py +0 -0
  65. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_check.py +0 -0
  66. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_check_version.py +0 -0
  67. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_complex.py +0 -0
  68. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_connection.py +0 -0
  69. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_connector_ends.py +0 -0
  70. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_conversion.py +0 -0
  71. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_diagnostic.py +0 -0
  72. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_edit.py +0 -0
  73. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_engines.py +0 -0
  74. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_enumeration.py +0 -0
  75. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_errors.py +0 -0
  76. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_evaluate_subject.py +0 -0
  77. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_explore.py +0 -0
  78. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_feature_values.py +0 -0
  79. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_feature_values_capability.py +0 -0
  80. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_fmi_runner.py +0 -0
  81. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_function.py +0 -0
  82. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_generate.py +0 -0
  83. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_generate_golden.py +0 -0
  84. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_generate_sources.py +0 -0
  85. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_import_compare.py +0 -0
  86. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_infinity.py +0 -0
  87. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_instance.py +0 -0
  88. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_integration.py +0 -0
  89. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_legacy_pysysml_placeholder.py +0 -0
  90. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_lifecycle.py +0 -0
  91. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_measurement_ref.py +0 -0
  92. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_metamodel.py +0 -0
  93. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_metamodel_reader.py +0 -0
  94. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_metamodel_toolkit.py +0 -0
  95. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_metamodel_typing.py +0 -0
  96. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_metaobject.py +0 -0
  97. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_metaobject_identity.py +0 -0
  98. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_migration.py +0 -0
  99. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_model.py +0 -0
  100. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_model_surface_integration.py +0 -0
  101. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_parse_sources.py +0 -0
  102. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_parser_warnings.py +0 -0
  103. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_performed_action_pin_shape.py +0 -0
  104. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_performed_action_unbound_input.py +0 -0
  105. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_performer.py +0 -0
  106. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_pin_release_checksums.py +0 -0
  107. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_quantity.py +0 -0
  108. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_query.py +0 -0
  109. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_rational.py +0 -0
  110. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_refresh_diagnostics.py +0 -0
  111. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_response_compression.py +0 -0
  112. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_runs.py +0 -0
  113. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_runtime.py +0 -0
  114. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_schedule.py +0 -0
  115. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_set_tensor.py +0 -0
  116. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_signing.py +0 -0
  117. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_snapshot_version.py +0 -0
  118. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_stale_service.py +0 -0
  119. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_strict_and_lookup.py +0 -0
  120. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_strict_conformance.py +0 -0
  121. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_structured.py +0 -0
  122. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_sweep_integration.py +0 -0
  123. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_symbol.py +0 -0
  124. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_target.py +0 -0
  125. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_tool_dry_run.py +0 -0
  126. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_typed.py +0 -0
  127. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_undetermined.py +0 -0
  128. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_unnamed_children.py +0 -0
  129. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_unset.py +0 -0
  130. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_variation_metadata.py +0 -0
  131. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_verification.py +0 -0
  132. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_verification_arguments.py +0 -0
  133. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_verification_questions.py +0 -0
  134. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_version.py +0 -0
  135. {opensysml-0.12.2.dev20261119 → opensysml-0.12.2.dev20261122}/tests/test_wire_compat.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opensysml
3
- Version: 0.12.2.dev20261119
3
+ Version: 0.12.2.dev20261122
4
4
  Summary: Python client library for OpenSysML, a SysML v2 parser and execution runtime
5
5
  Author: Open-MBEE
6
6
  License-Expression: Apache-2.0
@@ -34,6 +34,7 @@ from opensysml.typefacts import (
34
34
  from opensysml.capabilities import (
35
35
  CAPABILITY_ELEMENT_PROPERTIES,
36
36
  CAPABILITY_INLINE_DOCUMENT_QUERY,
37
+ CAPABILITY_QUERY_RESULT_VIEW,
37
38
  CAPABILITY_RECORD_RUN,
38
39
  CAPABILITY_RUNS,
39
40
  CAPABILITY_SELF_CHECK,
@@ -55,6 +56,8 @@ from opensysml.capabilities import (
55
56
  from opensysml.values import (
56
57
  UNSET, Array, Function, InstanceRef, MeasurementRef, Metaobject, SetValue, TensorQuantity,
57
58
  Undetermined, UnsetType,
59
+ AffineTransformation3d, CoordinateFrame, CoordinateTransformation, FramePlacement, FramePose,
60
+ FrameRotation, FrameStep, MeasurementScale,
58
61
  Vector, VectorQuantity,
59
62
  )
60
63
  from opensysml.importcompare import (
@@ -79,14 +82,14 @@ from opensysml.runs import (
79
82
  SelfCheckFinding,
80
83
  SelfCheckResult,
81
84
  )
82
- from opensysml.query import QueryElement, QueryError
85
+ from opensysml.query import QueryElement, QueryElements, QueryError
83
86
  from opensysml.element_properties import ElementIdentity, ElementProperties, ElementProperty
84
87
  from opensysml.sources import SourceDocument
85
88
  from opensysml.document import (
86
89
  DocumentEvent, DocumentQueryError, DocumentQueryResult, DocumentRow, DocumentState,
87
90
  DocumentVerdict, ElementRef, Graphs, INFINITY, ObjectRef, RenderCanvas, RenderEdge,
88
91
  RenderFrame, RenderGeometry, RenderNode, RenderNote, RenderPoint, RenderPort, RenderRow,
89
- RenderSpan, RenderStyle, RenderedView,
92
+ RenderHeaderField, RenderSpan, RenderStyle, RenderedView,
90
93
  )
91
94
  from opensysml.conversion import (
92
95
  FORMAT_API_JSON, FORMAT_SYSML, FORMAT_TURTLE, ID_FORM_QUALIFIED, ID_FORM_UUID, Conversion,
@@ -137,6 +140,8 @@ __all__ = [
137
140
  "AttributeFacts",
138
141
  "ServerInfo",
139
142
  "UNSET", "UnsetType", "Undetermined",
143
+ "CoordinateFrame", "CoordinateTransformation", "MeasurementScale", "FramePlacement", "FrameStep",
144
+ "FrameRotation", "AffineTransformation3d", "FramePose",
140
145
  "Array", "Vector", "VectorQuantity", "MeasurementRef", "Function", "Metaobject", "SetValue",
141
146
  "TensorQuantity", "InstanceRef",
142
147
  "Conversion", "FORMAT_API_JSON", "FORMAT_SYSML", "FORMAT_TURTLE", "LibraryReference",
@@ -152,6 +157,7 @@ __all__ = [
152
157
  "Bound", "EngineInfo", "Standing",
153
158
  "QueryElement", "QueryError",
154
159
  "ElementIdentity", "ElementProperties", "ElementProperty", "CAPABILITY_ELEMENT_PROPERTIES", "CAPABILITY_INLINE_DOCUMENT_QUERY",
160
+ "CAPABILITY_QUERY_RESULT_VIEW", "QueryElements", "RenderHeaderField",
155
161
  "SourceDocument",
156
162
  "DocumentEvent", "DocumentQueryError", "DocumentQueryResult", "DocumentRow",
157
163
  "DocumentState", "DocumentVerdict", "ElementRef", "INFINITY", "ObjectRef",
@@ -6,4 +6,4 @@ neither is a second copy that can drift. `scripts/check_version.py` compares
6
6
  this value with the release tag before anything is uploaded.
7
7
  """
8
8
 
9
- VERSION = "0.12.2.dev20261119"
9
+ VERSION = "0.12.2.dev20261122"
@@ -73,6 +73,10 @@ CAPABILITY_DOCUMENT_QUERY = "document_query"
73
73
  #: the field with ``UNIMPLEMENTED``.
74
74
  CAPABILITY_INLINE_DOCUMENT_QUERY = "inline_document_query"
75
75
 
76
+ #: A query's answer as a ``QVTS::QueryResult`` view (``as_view``) and such a view
77
+ #: rendered as a document (``form``); without it the service ignores both fields.
78
+ CAPABILITY_QUERY_RESULT_VIEW = "query_result_view"
79
+
76
80
  #: The ``RenderDocument`` RPC, which renders a named document to Markdown.
77
81
  #: Without it the service refuses with ``UNIMPLEMENTED``.
78
82
  CAPABILITY_RENDER_DOCUMENT = "render_document"
@@ -322,6 +326,11 @@ CAPABILITY_ENGINES = "engines"
322
326
  #: :class:`opensysml.Undetermined`; without it such a result crosses as an unsupported null.
323
327
  CAPABILITY_UNDETERMINED_VALUE = "undetermined_value"
324
328
 
329
+ #: A coordinate frame as ``Value.coordinate_frame`` and a coordinate transformation as
330
+ #: ``Value.coordinate_transformation``, read as :class:`opensysml.CoordinateFrame` and
331
+ #: :class:`opensysml.CoordinateTransformation`; without it each crosses as an unsupported null.
332
+ CAPABILITY_COORDINATE_FRAME_VALUES = "coordinate_frame_values"
333
+
325
334
  #: An Integer beyond int64 as ``Value.big_int_value``, ``Quantity.big_int_magnitude`` and
326
335
  #: ``DocumentValue.big_int_value``; a service without it reads one sent to it as null.
327
336
  CAPABILITY_BIG_INT_VALUES = "big_int_values"
@@ -18,6 +18,7 @@ from opensysml.binary import ensure_binary, resolve_latest_version
18
18
  from opensysml.capabilities import (
19
19
  CAPABILITY_ELEMENT_PROPERTIES,
20
20
  CAPABILITY_INLINE_DOCUMENT_QUERY,
21
+ CAPABILITY_QUERY_RESULT_VIEW,
21
22
  CAPABILITY_CONVERT_CHECK_DIAGNOSTICS,
22
23
  CAPABILITY_CONVERT_COMPACT,
23
24
  CAPABILITY_CONVERT_INHERITED_MEMBERS,
@@ -1620,8 +1621,9 @@ class Connection:
1620
1621
  inherited_members (bool): For api-json, also write on every
1621
1622
  Namespace and Type the derived lists that repeat its inherited
1622
1623
  and imported members (``membership``, ``member``,
1623
- ``inheritedMembership``, ``featureMembership``, ``feature``,
1624
- ``inheritedFeature``); by default an element carries its owned
1624
+ ``inheritedMembership``, ``importedMembership``,
1625
+ ``featureMembership``, ``feature``, ``inheritedFeature``); by
1626
+ default an element carries its owned
1625
1627
  structure. Needs the ``convert_inherited_members`` capability.
1626
1628
  compact (bool): For notation converted to api-json, write the
1627
1629
  compact document (``api-json-compact/1``) in place of the
@@ -1952,7 +1954,7 @@ class Connection:
1952
1954
  return result_of(response)
1953
1955
 
1954
1956
  def query(self, model_hash, payload=None, scope=None, select=None, where=None,
1955
- order_by=None, oslc=None):
1957
+ order_by=None, oslc=None, as_view=False):
1956
1958
  """Run a SysML v2 API & Services Query over a loaded model.
1957
1959
 
1958
1960
  The query is the standard's JSON object, so a cookbook payload works
@@ -1973,9 +1975,13 @@ class Connection:
1973
1975
  place of the standard's Query; not combined with the others.
1974
1976
  An empty string is no OSLC at all, so the structured query
1975
1977
  (empty, answering every element) is sent instead
1978
+ as_view (bool): Also answer the selection as a ``QVTS::QueryResult``
1979
+ view, the answer's ``result_view``; a query that ends in a
1980
+ path error then raises with the view as the error's
1981
+ ``result_view``. Needs the ``query_result_view`` capability
1976
1982
 
1977
1983
  Returns:
1978
- list[QueryElement]: The elements selected, in ``order_by`` order,
1984
+ QueryElements: The elements selected, a list in ``order_by`` order,
1979
1985
  or declaration order without one
1980
1986
 
1981
1987
  Raises:
@@ -1994,9 +2000,11 @@ class Connection:
1994
2000
  "Provide either oslc or the standard's Query (payload or keywords), not both"
1995
2001
  )
1996
2002
  needed = (CAPABILITY_QUERY, CAPABILITY_OSLC_QUERY)
2003
+ if as_view:
2004
+ needed += (CAPABILITY_QUERY_RESULT_VIEW,)
1997
2005
  for capability in needed:
1998
2006
  require(self.server_info(), capability, upgrade_remedy(capability))
1999
- request = sysml_pb2.QueryRequest(model_hash=model_hash, oslc_query=oslc)
2007
+ request = sysml_pb2.QueryRequest(model_hash=model_hash, oslc_query=oslc, as_view=as_view)
2000
2008
  with translate_rpc_errors(
2001
2009
  unimplemented=self._capability_refusal(needed)
2002
2010
  ):
@@ -2006,9 +2014,11 @@ class Connection:
2006
2014
  order_by=order_by)
2007
2015
  needed = (CAPABILITY_QUERY, CAPABILITY_QUERY_ORDER_BY) if query.order_by \
2008
2016
  else (CAPABILITY_QUERY,)
2017
+ if as_view:
2018
+ needed += (CAPABILITY_QUERY_RESULT_VIEW,)
2009
2019
  for capability in needed:
2010
2020
  require(self.server_info(), capability, upgrade_remedy(capability))
2011
- request = sysml_pb2.QueryRequest(model_hash=model_hash, query=query)
2021
+ request = sysml_pb2.QueryRequest(model_hash=model_hash, query=query, as_view=as_view)
2012
2022
  with translate_rpc_errors(
2013
2023
  unimplemented=self._capability_refusal(needed)
2014
2024
  ):
@@ -2066,10 +2076,14 @@ class Connection:
2066
2076
  if response.error:
2067
2077
  if response.error.startswith("element not found"):
2068
2078
  raise SymbolNotFoundError(asked)
2069
- raise ConversionError(response.error)
2079
+ raise ConversionError(
2080
+ response.error,
2081
+ excluded_documents=[(d.document, d.error) for d in response.excluded_documents],
2082
+ )
2070
2083
  return element_properties_of(response)
2071
2084
 
2072
- def run_document_query(self, model_hash, query_id=None, bindings=None, inline_query=None):
2085
+ def run_document_query(self, model_hash, query_id=None, bindings=None, inline_query=None,
2086
+ as_view=False):
2073
2087
  """Run a document query, named or written in place, and answer its typed rows.
2074
2088
 
2075
2089
  The query is the model's own — a calc def specializing
@@ -2090,6 +2104,10 @@ class Connection:
2090
2104
  "PartUsage"), ("name", "mass"))`` — with the
2091
2105
  ``DocumentQueries`` library in scope and the model's own names
2092
2106
  reachable; needs the ``inline_document_query`` capability
2107
+ as_view (bool): Also answer as a ``QVTS::QueryResult`` view, the
2108
+ result's ``result_view``; a query that ends in a path or model
2109
+ error then raises with the view as the error's
2110
+ ``result_view``. Needs the ``query_result_view`` capability
2093
2111
 
2094
2112
  Returns:
2095
2113
  DocumentQueryResult: Projected columns and typed rows, in the
@@ -2120,11 +2138,18 @@ class Connection:
2120
2138
  CAPABILITY_INLINE_DOCUMENT_QUERY,
2121
2139
  upgrade_remedy(CAPABILITY_INLINE_DOCUMENT_QUERY),
2122
2140
  )
2141
+ if as_view:
2142
+ require(
2143
+ self.server_info(),
2144
+ CAPABILITY_QUERY_RESULT_VIEW,
2145
+ upgrade_remedy(CAPABILITY_QUERY_RESULT_VIEW),
2146
+ )
2123
2147
  request = sysml_pb2.RunDocumentQueryRequest(
2124
2148
  model_hash=model_hash,
2125
2149
  query_id=query_id or "",
2126
2150
  inline_query=inline_query or "",
2127
2151
  bindings=build_bindings(bindings),
2152
+ as_view=as_view,
2128
2153
  )
2129
2154
  if any(binding_holds_big_int(binding) for binding in request.bindings):
2130
2155
  require(
@@ -2250,6 +2275,8 @@ class Connection:
2250
2275
  capabilities = [CAPABILITY_RENDER_VIEW]
2251
2276
  if written:
2252
2277
  capabilities.append(CAPABILITY_RENDER_VIEW_FORM)
2278
+ if form in ("html", "asciidoc"):
2279
+ capabilities.append(CAPABILITY_QUERY_RESULT_VIEW)
2253
2280
  for capability in capabilities:
2254
2281
  require(self.server_info(), capability, upgrade_remedy(capability))
2255
2282
  request = sysml_pb2.RenderViewRequest(
@@ -381,6 +381,17 @@ class RenderedView:
381
381
  frame: Optional[RenderFrame] = None
382
382
  #: The rendering written in the form asked for; empty when none was.
383
383
  text: str = ""
384
+ #: A ``QVTS::QueryResult`` view's query, source, outcome and provenance, in
385
+ #: that order; empty for any other view.
386
+ header: tuple = ()
387
+
388
+
389
+ @dataclass(frozen=True)
390
+ class RenderHeaderField:
391
+ """One attribute a ``QVTS::QueryResult`` view binds."""
392
+
393
+ name: str
394
+ value: str
384
395
 
385
396
 
386
397
  def _render_span(span):
@@ -450,6 +461,7 @@ def render_view_result(response):
450
461
  response.view, response.kind, response.stated, nodes, edges, tuple(response.columns),
451
462
  rows, canvas, notes, tuple(response.notices), tuple(response.shown), frame,
452
463
  response.text,
464
+ tuple(RenderHeaderField(field.name, field.value) for field in response.header),
453
465
  )
454
466
  #: What a binding value or an answered cell value may be.
455
467
  DocumentValue = Union[
@@ -505,6 +517,9 @@ class DocumentQueryResult:
505
517
 
506
518
  columns: tuple
507
519
  rows: tuple
520
+ #: The answer as a ``QVTS::QueryResult`` view, SysML text exposing the
521
+ #: selected elements; ``""`` unless the call asked ``as_view``.
522
+ result_view: str = ""
508
523
 
509
524
  def __iter__(self):
510
525
  return iter(self.rows)
@@ -642,6 +657,7 @@ def result_of(response):
642
657
  _row_of(row)
643
658
  for row in response.rows
644
659
  ),
660
+ result_view=response.result_view,
645
661
  )
646
662
 
647
663
 
@@ -86,9 +86,20 @@ class ElementProperty:
86
86
  return bool(self.values)
87
87
 
88
88
 
89
+ @dataclass(frozen=True)
90
+ class ExcludedDocument:
91
+ """A document the read left out of the model: one the parser could not read
92
+ whole, or one declaring a top-level name another document already declares."""
93
+
94
+ document: str
95
+ error: str
96
+
97
+
89
98
  class ElementProperties:
90
99
  """What one read answered: the element and its properties, in the order
91
- asked for, or the element form's order when none was named.
100
+ asked for, or the element form's order when none was named, and the
101
+ documents the model was read without (``excluded_documents``), empty when
102
+ the whole model was read.
92
103
 
93
104
  Behaves as a mapping from property name to :class:`ElementProperty`::
94
105
 
@@ -97,9 +108,15 @@ class ElementProperties:
97
108
  ['Demo::Unit::p', ...]
98
109
  """
99
110
 
100
- def __init__(self, element: ElementIdentity, properties: Sequence[ElementProperty]):
111
+ def __init__(
112
+ self,
113
+ element: ElementIdentity,
114
+ properties: Sequence[ElementProperty],
115
+ excluded_documents: Sequence[ExcludedDocument] = (),
116
+ ):
101
117
  self.element = element
102
118
  self.properties = list(properties)
119
+ self.excluded_documents = list(excluded_documents)
103
120
  self._by_name = {p.name: p for p in self.properties}
104
121
 
105
122
  def __getitem__(self, name: str) -> ElementProperty:
@@ -158,4 +175,7 @@ def element_properties_of(response: sysml_pb2.GetElementPropertiesResponse) -> E
158
175
  )
159
176
  for p in response.properties
160
177
  ]
161
- return ElementProperties(element_identity_of(response.element), properties)
178
+ excluded = [
179
+ ExcludedDocument(document=d.document, error=d.error) for d in response.excluded_documents
180
+ ]
181
+ return ElementProperties(element_identity_of(response.element), properties, excluded)
@@ -207,12 +207,16 @@ class ConversionError(OpenSysMLError):
207
207
  message (str): Error description reported by the service
208
208
  diagnostics (list): Diagnostic objects behind the failure, when the
209
209
  source was notation the parser could not read
210
+ excluded_documents (list): ``(document, error)`` pairs for the documents
211
+ an element read left out of the model, when the requested element's
212
+ own document is one of them
210
213
  """
211
214
 
212
- def __init__(self, message, diagnostics=None):
215
+ def __init__(self, message, diagnostics=None, excluded_documents=None):
213
216
  super().__init__(message)
214
217
  self.message = message
215
218
  self.diagnostics = diagnostics or []
219
+ self.excluded_documents = list(excluded_documents or [])
216
220
 
217
221
 
218
222
  class MigrationError(OpenSysMLError):
@@ -639,6 +643,43 @@ def from_rpc_error(exc, not_found=ModelNotFoundError, unimplemented=None):
639
643
  return cls(message, code=code)
640
644
 
641
645
 
646
+ _RESULT_VIEW_TYPE = "type.googleapis.com/sysml.QueryResultView"
647
+
648
+
649
+ def result_view_of(exc):
650
+ """The ``QVTS::QueryResult`` view a refused query carries, or ``""``.
651
+
652
+ The service attaches it as a ``QueryResultView`` status detail when the
653
+ call asked for the view and the query ended in a path or model error.
654
+ """
655
+ from google.protobuf import any_pb2
656
+ from google.protobuf.internal.decoder import _DecodeVarint
657
+
658
+ from opensysml.proto import sysml_pb2
659
+
660
+ if not isinstance(exc, grpc.Call):
661
+ return ""
662
+ status = next(
663
+ (value for key, value in exc.trailing_metadata() or () if key == "grpc-status-details-bin"), b""
664
+ )
665
+ # google.rpc.Status: details are field 3, each a length-delimited Any.
666
+ position = 0
667
+ while position < len(status):
668
+ tag, position = _DecodeVarint(status, position)
669
+ if tag & 7 == 0:
670
+ _, position = _DecodeVarint(status, position)
671
+ continue
672
+ if tag & 7 != 2:
673
+ return ""
674
+ size, position = _DecodeVarint(status, position)
675
+ if tag >> 3 == 3:
676
+ detail = any_pb2.Any.FromString(status[position:position + size])
677
+ if detail.type_url == _RESULT_VIEW_TYPE:
678
+ return sysml_pb2.QueryResultView.FromString(detail.value).text
679
+ position += size
680
+ return ""
681
+
682
+
642
683
  @contextmanager
643
684
  def translate_rpc_errors(not_found=ModelNotFoundError, unimplemented=None):
644
685
  """Re-raise any ``grpc.RpcError`` raised in the block as a OpenSysMLError.
@@ -657,9 +698,12 @@ def translate_rpc_errors(not_found=ModelNotFoundError, unimplemented=None):
657
698
  try:
658
699
  yield
659
700
  except grpc.RpcError as exc:
660
- raise from_rpc_error(
661
- exc, not_found=not_found, unimplemented=unimplemented
662
- ) from exc
701
+ error = from_rpc_error(exc, not_found=not_found, unimplemented=unimplemented)
702
+ view = result_view_of(exc)
703
+ if view:
704
+ # A query that ended in a path or model error, asked for as a view.
705
+ error.result_view = view
706
+ raise error from exc
663
707
 
664
708
 
665
709
  __all__ = [
@@ -443,7 +443,7 @@ class Model:
443
443
  return self._client.get_element_properties(self._hash, element, properties, name=name, id=id)
444
444
 
445
445
  def query(self, payload=None, scope=None, select=None, where=None, order_by=None,
446
- oslc=None):
446
+ oslc=None, as_view=False):
447
447
  """Run a SysML v2 API & Services Query over this model.
448
448
 
449
449
  Takes the standard's ``Query`` JSON, so a payload written for the
@@ -463,9 +463,13 @@ class Model:
463
463
  ``sysml:name="vehicle"``, evaluated in place of the standard's
464
464
  Query; not combined with the others. An empty string is no
465
465
  OSLC at all, so the structured query is sent instead
466
+ as_view (bool): Also answer the selection as a ``QVTS::QueryResult``
467
+ view, the answer's ``result_view``; a path error then raises
468
+ with the view as the error's ``result_view``. Needs the
469
+ ``query_result_view`` capability
466
470
 
467
471
  Returns:
468
- list[QueryElement]: The elements selected, in ``order_by`` order,
472
+ QueryElements: The elements selected, a list in ``order_by`` order,
469
473
  or declaration order without one
470
474
 
471
475
  Raises:
@@ -484,10 +488,10 @@ class Model:
484
488
  """
485
489
  return self.connection.query(
486
490
  self._hash, payload, scope=scope, select=select, where=where, order_by=order_by,
487
- oslc=oslc,
491
+ oslc=oslc, as_view=as_view,
488
492
  )
489
493
 
490
- def run_document_query(self, query_id=None, bindings=None, inline_query=None):
494
+ def run_document_query(self, query_id=None, bindings=None, inline_query=None, as_view=False):
491
495
  """Run one of this model's named document queries, or a query expression.
492
496
 
493
497
  The query is the model's own — a calc def specializing
@@ -506,6 +510,10 @@ class Model:
506
510
  Named("Vehicles")), "PartUsage"), ("name", "mass"))`` — with
507
511
  the ``DocumentQueries`` library in scope; needs the
508
512
  ``inline_document_query`` capability
513
+ as_view (bool): Also answer as a ``QVTS::QueryResult`` view, the
514
+ result's ``result_view``; a path or model error then raises
515
+ with the view as the error's ``result_view``. Needs the
516
+ ``query_result_view`` capability
509
517
 
510
518
  Returns:
511
519
  DocumentQueryResult: Projected columns and typed rows, in the
@@ -530,7 +538,7 @@ class Model:
530
538
  ('name',)
531
539
  """
532
540
  return self.connection.run_document_query(
533
- self._hash, query_id, bindings=bindings, inline_query=inline_query,
541
+ self._hash, query_id, bindings=bindings, inline_query=inline_query, as_view=as_view,
534
542
  )
535
543
 
536
544
  def render_document(self, document_id, form="markdown"):
@@ -596,7 +604,10 @@ class Model:
596
604
  ``sysml -render <view> -render-form <form>`` writes: ``"text"``,
597
605
  ``"mermaid"``, ``"markdown"``, ``"dot"``, ``"plantuml"``,
598
606
  ``"d2"``, ``"drawio"``, ``"csv"`` or ``"tsv"``; ``None`` (the
599
- default) writes none
607
+ default) writes none. A ``QVTS::QueryResult`` view is written
608
+ as a document of its header and rows in ``"markdown"``,
609
+ ``"html"`` or ``"asciidoc"``, which needs the
610
+ ``query_result_view`` capability too
600
611
  palette (str | None): Palette a graph form fills nodes from, as
601
612
  ``-render-palette`` names them; ``None`` draws in black and white
602
613
  style (str | None): Drawing style of the DOT or Mermaid form, as