Symbol API fields answer differently from GetElementProperties, with no sign that the answer is incomplete
Maintainer thường phản hồi trong vòng 1 ngày
@devin-ai-integration đang làm issue này rồi.
Từ ngày 7/11/2026.
- #2040 của @devin-ai-integration — đang mở
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start by reading the Symbol API implementations for kind, type_facts, specializations, and parameter direction, then compare them with the GetElementProperties path and the four reproduction cases in the issue. Run the two named Python suites, opensysml-py and opensysml-py-props, to confirm the discrepancies. Done means the chosen fix or documentation makes the Symbol answers consistent with, or clearly identifies their limits relative to, the metamodel values.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This issue was written with AI help. The reproduction was run against the version below.
Since #2013, the same question can be asked of the Symbol API and of GetElementProperties, and the two sometimes disagree. When the Symbol API has no field for something, a user can tell and looks elsewhere. The problem is the fields that do exist and give a wrong or partial answer without saying so: a user who starts from Symbol has no reason to suspect the value and no pointer to element_properties.
We compared both surfaces on the 1630 cases of our suite (opensysml-py and opensysml-py-props). 470 reads are answered only by GetElementProperties because the Symbol API has no field for them, which is fine. In 37 further cases, a dedicated Symbol field answers and GetElementProperties gives the value the Pilot gives. The four patterns are below.
Reproduction
package P {
private import ScalarValues::*;
port def AP { out item a; }
part def T;
part def Vehicle { attribute plain : Real; }
part tuned : Vehicle { attribute :>> plain = 3.5; }
part def Owner {
part q : T;
part pSub :> q;
ref part pRef ::> q;
}
action def Supervise {
port alarmPort : AP;
item alarm;
action sendVia send alarm via alarmPort;
}
requirement def Req {
subject s : Part;
in x : Real;
}
}
m = opensysml.loads(SRC)
def props(el, *names):
r = m.element_properties(el, *names)
return {p.name: [str(v) for v in p.values] for p in r}, r.element.metaclass
1. Symbol.kind flattens action kinds.
m.get("P::Supervise::sendVia").kind # 'actionUsage'
props("P::Supervise::sendVia", "name")[1] # 'SendActionUsage'
The same happens for accept, assignment and perform actions (15 cases). The if, while and for actions are wrong on both surfaces (#1985).
2. Symbol.type_facts is empty where the feature has a type.
m.get("P::tuned::plain").type_facts.resolved_id # ''
props("P::tuned::plain", "type")[0]["type"] # ['ScalarValues::Real']
m.get("P::Owner::pSub").type_facts.resolved_id # ''
props("P::Owner::pSub", "type")[0]["type"] # ['P::T']
In each case the type is inherited from the feature that is redefined (:>> plain), subsetted (:> q) or reference-subsetted (::> q), and the feature declares none of its own (12 cases).
3. Symbol.specializations leaves out a reference subsetting.
[(sp.kind, sp.target_id) for sp in m.get("P::Owner::pRef").specializations] # []
# element_properties("P::Owner::pRef", "ownedSpecialization") -> one ReferenceSubsetting (to P::Owner::q)
The references specialization kind exists, but ref part pRef ::> q does not produce one (6 cases).
4. The subject of a requirement def has no direction in the Symbol listings.
# children() + members(inherited=True, library=True) of P::Req that carry metadata["direction"]:
# [['in', 'x'], ['out', 'result']]
props("P::Req", "directedFeature")[0]["directedFeature"]
# ['P::Req::s', 'P::Req::x', 'Requirements::RequirementConstraintCheck::result']
props("P::Req", "subjectParameter")[0]["subjectParameter"] # ['P::Req::s']
The subject s is an in parameter, but the Symbol API lists it without a direction, so a client that collects parameters by direction misses it (4 cases: requirement and use case defs).
Beyond these 37, there are 108 more where the Symbol API gives an empty listing rather than "unknown": a connector's ends are not among its children (endCount 0), and a #M or @M; annotation is not a child. We count those separately because they depend on where a client looks for ends and annotations.
Suggestion
Any of these would help, from least to most work:
- Document on each overlapping Symbol field (
kind,type_facts,specializations,metadata["direction"]) that it is a summary, and point toelement_propertiesfor the value the specification defines. - Delegate. Derive these fields from the same metamodel evaluation that
GetElementPropertiesserves, so the two surfaces cannot disagree.attributes()delegating tomembers(#1974) is a precedent. - Mark incompleteness in the answer where a field is known to be partial, as
withheld_library_membersdoes for the member listing, rather than answering an empty string or an empty list.
Version
- OpenSysML
developat19bc16d1df(nightly-199-g19bc16d1df),bin/sysml-grpcbuilt withmake build-grpc - Python client from
client/pythonof the same commit - Suite: https://github.com/hideo67/sysmlv2-tests, suites
opensysml-py(test_matrices.py) andopensysml-py-props(test_props.py); per-case results intest-suite/report-all-SNAPSHOT.md
- Ngôn ngữ chính
- Go
- Star
- 56
- Fork
- 17
- Merge trung bình
- 12 giờ 45 phút
- Pull request đã merge (30 ngày)
- 910
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Open-MBEE/OpenSysML
-
dependencies
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Open-MBEE/OpenSysML#1951 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Open-MBEE/OpenSysML#2029 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement spec compliance
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Open-MBEE/OpenSysML#2028 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Java client: no member enumeration, no GetElementProperties, no instance pathsCó thể đã có người làm @devin-ai-integration đã nhận hôm nay. Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Open-MBEE/OpenSysML#2022 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Open-MBEE/OpenSysML
Issue tương tự
-
agent-butler-finding chore
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
jordansmall/spindrift#6695 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
skills-init: commit-SHA skill refs never start (git checkout -- <sha> reads the SHA as a pathspec)Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
kagent-dev/kagent#3571 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
book-layout.spec fails when the similar-books rail holds other projects' booksCó thể đã có người làm @praetorianer777 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
praetorianer777/GoTome#373 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeoutCó thể đã có người làm @floriankoch đã nhận hôm nay. Đang mởtriage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
envoyproxy/gateway#10562 ·
Maintainer thường phản hồi trong vòng 1 ngày