Repository navigation
Description
Problem
OpenSysML has no per-element client API shaped like the KerML/SysML abstract syntax.
A client that wants inheritedFeature, connectorEnd, relatedFeature, directedFeature,
portDefinition, payloadType, subjectParameter, entryAction, isComposite, the
FeatureValue behind a feature, the operands of an expression, … has three routes and none
of them answers per element over gRPC:
GetSymbol(SymbolInfo) is a curated surface: id, name, kind, metadata map, owned
child_ids,attributes, type/multiplicity/specializations and, since feat(grpc): enumerate a symbol's members with provenance; Python member methods agree #1974,members.
Each metamodel property it lacks is a new field, a new proto message and four client
bindings (feat(grpc): enumerate a symbol's members with provenance; Python member methods agree #1974, fix(symbols,grpc,python): unnamed members get positional ids and a #M prefix declares its metadata usage #1978, feat(grpc): say how each instance was reached and list every path to an object #1979, feat(client): expose the expression a feature is bound to as Symbol.valuation, on the gRPC surface and as query properties #1981, fix(semantics): derive connector related features from the ends' reference subsettings #1983, fix(semantics): a send action is a SendActionUsage with its payload, sender and receiver on every surface #1992, feat(symbol): report isComposite and isReference on symbols and in queries #1993, fix(semantics): a positional parameter redefinition masks the redefined parameter; a nameless feature's name follows its naming feature on both structure readers (develop drift #2014 × #2016) #1994 each add one or two).Queryadmits exactly the 22 queryable properties of the SysML v2 API & Services
projection (internal/semantic/queryPropertyNames):@id,@type,body,
declaredName,declaredShortName,documentation,elementId,general,isAbstract,
isIndividual,language,locale,multiplicityLower,multiplicityUpper,name,
owner,qualifiedName,satisfiedRequirement,satisfyingFeature,shortName,
textualRepresentation,type. Anything else isINVALID_ARGUMENT: unknown query property.Converttoapi-jsonexports the whole model as API element JSON with the derived
properties completed, but that is a model-level export, not an element read.
The derivation itself already exists and is the most carefully measured part of the
metamodel in the tree:
internal/semantic/metamodel(Evaluator.Property(element, definingClass, name))
serves 297 derived properties by specification clause and omits 58
(Omitted(), each with the engine fact it would need). It covers every property named
above, plusConnector::sourceFeature/targetFeature,Feature::isComposite/isReference,
FeatureValue::value,OperatorExpression::operand/operator,
InvocationExpression::argument,SendActionUsage::payloadArgument/senderArgument/
receiverArgument,StateDefinition::entryAction/doAction/exitAction,
ConjugatedPortTyping::portDefinition,ConjugatedPortDefinition::originalPortDefinition.- It is refereed against the pinned pilot's JSON export over 935 corpus files
(docs/project/api-json-differential.md): 1,925,327 properties equal, 125,740 different,
321,317 missing on our side, bucketed per (metaclass, property). - The in-model
queryexecutor (internal/doc/queryexecmetaclassPropertyValues) and
metareflection already answer metaclass properties on a live model through
semantics.ReflectiveElements/ReflectiveFeatureValues.
An external conformance suite (hideo67/sysmlv2-tests, 1,630 static reads of exactly these
properties, pilot EMF as oracle) scores the gRPC surface at 504 pass / 364 fail /
753 unsupported, against 1,527 / 53 / 50 for sysml-toolkit's ResolvedModel.derived(element, "<spec name>") and 1,580 / 0 / 50 for the pilot. The 753 are properties the surface has no
route to; 87 of the 364 are inherited members the suite's adapter does not yet read from
members. The gap is the surface, not the derivation.
Proposal
1. One RPC: element properties by specification name
rpc GetElementProperties(GetElementPropertiesRequest) returns (GetElementPropertiesResponse);
message GetElementPropertiesRequest {
string model_id = 1;
string element_id = 2; // qualified name, or a positional id for an unnamed member (#1978)
repeated string properties = 3; // spec names; empty = every property the metaclass declares
bool include_library = 4; // library-inherited members etc., as `members` does
}
message GetElementPropertiesResponse {
string metaclass = 1; // "ConnectionUsage"
repeated ElementProperty properties = 2;
}
message ElementProperty {
string name = 1; // "connectorEnd"
string defining_class = 2; // "Connector"
bool many = 3; // ordered list vs single
repeated PropertyValue values = 4;
string unsupported_reason = 5; // set when OpenSysML does not derive it; from Evaluator.Explain / Omitted
}
message PropertyValue {
oneof value {
string element_id = 1; // qualified or positional id
string literal = 2; // string / integer / real / boolean spelled as the API JSON spells it
string enumeration = 3; // "in", "public", …
}
}Backing: metamodel.Evaluator over the model, resolving the metaclass and the declared
property set from internal/translate/rdf/ontology (so an unknown name is an error, a
declared-but-underived name is unsupported_reason, and a derived one is a value). Element
values are returned as the ids GetSymbol accepts, positional ids included, so a client can
walk the graph (feature → ownedRelationship → FeatureValue::value → operand) without a
second vocabulary.
2. Structure for a live model
Evaluator reads containment and owned attributes through a metamodel.Structure. Two
routes, in order:
- Reuse the API-JSON graph structure (
internal/translate/exportnewAPIJSONEvaluation):
build the model's graph once per model revision and cache it on the service's model
entry. This is the path the differential measures today, so its fidelity is known. - If the per-model graph is too expensive for editor-sized models, implement
metamodel.Structuredirectly oversymbols/semantics side tables and run the
differential over both to prove they agree.
3. Clients
client/opensysml (Go), Python, Rust, TypeScript and WASM each gain
ElementProperties(id, names...) returning name → values | reason, mirroring the Go
Query row shape. The Python Symbol gets .property("connectorEnd").
4. What stays as it is
SymbolInforemains the curated editor/client surface and stops growing metamodel fields.Querykeeps the API & Services projection. A later step may admit metaclass property
names inselectthrough the same evaluator; not part of this issue.Convert api-jsonis unchanged; the RPC and the export must agree per property, and the
differential baseline is the gate for both.
Effect on open pull requests
| PR | What it changes | Under this proposal |
|---|---|---|
| #1978 unnamed members get positional ids | identity of Owner::@3 on child_ids, GetSymbol, Python |
Keep. Any surface needs addressable unnamed elements; the RPC returns these ids. |
#1980 conjugated port typed by P::'~P' |
semantics, export, views | Keep. Engine fix; ConjugatedPortTyping::portDefinition reads it. |
#1992 send action is a SendActionUsage |
semantics, runtime, query, export | Keep. Engine fix; metaclass and payloadArgument/senderArgument/receiverArgument read it. |
| #1994 positional parameter redefinition | semantics, migrate | Keep. Engine fix. |
| #1983 connector related features from the ends' reference subsettings | semantics derivation + SymbolInfo/query fields |
Keep the derivation, drop the new fields. Connector::relatedFeature/sourceFeature/targetFeature/connectorEnd are served by the evaluator once the derivation is right. |
#1993 isComposite/isReference on symbols and in queries |
surface only | Supersede. Feature::isComposite/isReference are served. |
#1981 Symbol.valuation with expression text/structure |
bespoke valuation shape on symbol, gRPC, query | Supersede. FeatureValue::value → OperatorExpression::operand/operator, InvocationExpression::argument, LiteralExpression::value give the structure in the specification's own shape. |
| #1979 instance owner and paths | runtime objects, not metamodel | Independent. Unaffected either way. |
Acceptance
GetElementPropertiesanswers every property inmetamodel.servedRulesfor a declared
element and reports the recorded reason for everyOmitted()one;tests/grpc
conformance cases per metaclass family (Type, Feature, Connector, Flow, SendActionUsage,
StateDefinition, FeatureValue/Expression, Membership/Import).- The RPC's answer and the
api-jsonexport agree on every (element, property) pair over
examples/(a hygiene test, not a new baseline). - All five clients expose it; the Python and Go clients have the same differential test
they have forQuery. docs/project/spec-compliance/08-grpc-service-layer.mdand the gRPC guide document the
RPC and the capability flag.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
Merge pull request #2013 from Open-MBEE/feature/element-properties
Merge pull request #2014 from Open-MBEE/refactor/symbol-backed-metamo…
hideo67 commentedon Nov 7, 2026
Thanks for #2013. We added a suite that reads every case through
Model.element_properties(test-opensysml-py/test_props.py) and walks the abstract syntax the same way as our sysml-toolkit adapter. On19bc16d1dfit scores 1236 pass / 323 fail / 62 unsupported / 9 error on the 1630 cases. The Symbol API gets 652 / 222 / 747 / 9. 470 reads that had no route now pass. Of the 62 unsupported, 39 need a KerML operation (allSupertypes(),directionOf()), and 20 need an expression's source text.Most of the remaining failures come from the problems below. All were reproduced with the Python client (
OPENSYSML_BINARY=bin/sysml-grpcof19bc16d1df).Reproduction
1. Ids in an answer that the call cannot read back
28 of the 101 entries raise
ConversionError: library document Systems Library/Parts.sysml writes no element bd909aa8-dcdb-59fb-a116-8670f6db05b1. They are 18 FeatureMemberships ofOccurrences.kermland 10 OwningMemberships ofParts.sysml,Items.sysml,Objects.kerml,Base.kermlandOccurrences.kerml. The members of the 18 FeatureMemberships are the unnamed library features. They are listed ininheritedFeature, and reading them fails the same way, so a client cannot tell an unnamed library feature from a model one, or count them (the Pilot lists 18).2. Chained connector ends have no related features
With unchained ends (
connect q to r) all three are answered. Expected:relatedFeature= the chainsx.pandy.p,sourceFeature=x.p,targetFeature=y.p. This is 114 cases (B10, B11, B12), with connection, interface and binding usages at end depths 1 and 2.3. A connection def's
endFeatureis emptyExpected:
a,b(both declaredend).4. Flows and messages
Expected for
f1:sourceOutputFeatureandtargetInputFeatureare the flow ends' owned features that redefineTank::fuelOutandEngine::fuelIn. A message's two ends are owned features but notconnectorEnd.5. A send action has no owned features
Expected: the payload, sender and receiver parameters as owned features, with
payloadArgumentthenew Sig()expression. The same happens forsend alarm via alarmPortandsend alarm to display.6. Expressions
Expected:
instantiatedType=P::Sig.operator=".", which the Pilot reports. The constructor'sresultandargumentare answered.7.
isReferenceis answered only when writtenisReferenceis derived asnot isComposite. Expected: false forcomp, and true for a part usage owned by a package.8.
Function::resultis emptyExpected:
result=P::Calc::r. For a constraint, requirement or case def, expected: the inheritedresult.directedFeaturelists the libraryresultbeside the parameterrthat redefines it, which is item 4 of #2009.Already filed and seen here as well:
if/while/forreported as ActionUsage (#1985), a succession flow as FlowUsage (#2008), the type of a~PPport (#1962), an inherited type missing fromtype(#2007).Version
developat19bc16d1df(nightly-199-g19bc16d1df),bin/sysml-grpcbuilt withmake build-grpcclient/pythonof the same committest-suite/test-opensysml-py/test_props.py(suiteopensysml-py-props)docs(changelog): GetElementProperties reads back every id an answer c…
Merge pull request #2050 from Open-MBEE/fix/element-properties-readab…
devin-ai-integration commentedon Nov 8, 2026
Thanks for the suite — it is the most useful measurement we have of this API, and we ran your model through all eight parts against current
develop(bfebfa9, with #2050 merged) and against the branch of #2042, which movesGetElementPropertiesoff the api-json element form onto the symbol-backedSymbolStructure(#2014) so that the RPC, the Symbol surface and the exporter read one representation. Status per item:developbfebfa9inheritedMembershipthat cannot be read backP::a's memberships read back (was 85/113). Root cause: unnamed members of catalogued library elements were minted underAnonymousMemberOfids by the model form but under positional ids by the per-document library formrelatedFeature/sourceFeature/targetFeaturerelatedFeature→ the two chain features,sourceFeature/targetFeaturesplitconnection defendFeatureemptyP::Link::a,P::Link::bsourceOutputFeature/targetInputFeature, messageconnectorEndemptyconnectorEndis reported as not derived rather than empty, andFlow::sourceOutputFeature/targetInputFeaturehave no rulesendaction: no owned features,payloadArgument/receiverArgumentActionUsage)SendActionUsageclassification + arguments), then #2053 for accept/assign/if/while/forConstructorExpression::instantiatedTypeemptyP::SigFeatureChainExpression::operatorempty.)isReferenceonly answered when writtenisComposite—comp → False,ref part r → True, and the package-owneda → TrueFunction::resultemptyP::Calc::rOne more thing you will see when #2042 lands: anonymous ids change spelling (the connector ends are
P::V::c1.r1.e0rather thanP::V::c1::a, membership idsP::V.r0rather thanP__V__x_om). Every id an answer carries will read back, which is the contract #2050 added a test for (TestElementPropertiesReadsBackEveryIdAnAnswerCarries) and which #2042 has to keep.Also noted from your run and ours:
Type::directedFeatureonP::Calclists bothP::Calc::rand thePerformances::Evaluation::resultit redefines; inherited members redefined by an owned member must be excluded (KerML §8.3.3.1), same defect as #2009 item 4 — added to #2028's scope.If you re-run the suite after #2050 the item-1 failures should be gone; the rest will move with the PRs above, and we would welcome the suite itself as a fixture once the count is stable.
feat(grpc,clients): census every served and omitted metamodel propert…
feat(grpc): read any metamodel property of an element by its specific…
feat(client): ElementProperties reads an element's metamodel properti…
feat(python): Model.element_properties and Symbol.properties read an …
feat(rust,conformance): element_properties in the Rust client and a c…
feat(node): Model.elementProperties reads an element's metamodel prop…
feat(conformance): the Node and Java clients know element_properties
docs: GetElementProperties in the wire contract, transports and the g…
test(grpc): element_properties is the newest capability
feat(metamodel): symbol-backed Structure with a graph-versus-symbol d…
fix(export): write a library document's unnamed members under the ids…
test(export): re-record the api-json differential baseline's writer d…
Merge pull request #2073 from Open-MBEE/feat/element-properties-closeout
devin-ai-integration commentedon Nov 13, 2026
Closing this tracking issue. #2073 (merged) satisfies the acceptance text as written:
GetElementPropertiesanswers any metamodel property by its specification name, cached on the model hash, over the full KerML/SysML metamodel. The symbol-backed structure and hideo67's follow-ups (1–4, 6a, 7, 8) are owned by #2042 and #2052, which stay open and now carryCloses #2012so the cross-reference survives; anything that is not covered there should be opened as its own issue against the specific property.