A feature's type leaves out the types it gets through subsetting and redefinition, and reference subsetting (`::>`) is not reported at all
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đá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
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start by reading type_info and specialization construction in the Go service, then compare those results with _with_inherited_facts in client/python/opensysml/generate.py. Reproduce with the supplied SysML example and check A20-037..039 and A40-007, A40-022, A40-034, A40-037, A40-040, and A40-043. Done means the API reports derived types and the reference-subsetting relationship for these cases.
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 model and the reproduction were run against the version below.
What happened
A Symbol's type_info gives only the feature's own : T typing. A feature that gets its type by subsetting, reference subsetting or redefinition reports no type. A feature that has its own typing and also subsets another feature reports only its own type. Reference subsetting (::>) is not in specializations either, so nothing in the Symbol says where pRef gets its type.
package P {
part def T;
part def V;
part def Owner {
part q : T;
part pSub :> q; // subsetting
ref part pRef ::> q; // reference subsetting
part pBoth : V :> q; // typing and subsetting
attribute a : ScalarValues::Real;
}
part def SubOwner :> Owner {
part :>> q; // redefinition
}
part tuned : Owner {
attribute :>> a = 3.5; // redefinition with a value
}
}
import opensysml
m = opensysml.loads(SRC) # m.ok is True, no diagnostics
for qn in ["P::Owner::q", "P::Owner::pSub", "P::Owner::pRef",
"P::Owner::pBoth", "P::SubOwner::q", "P::tuned::a"]:
s = m.get(qn)
print(qn, repr(s.type_facts.resolved_id), repr(s.type_facts.primitive),
[(sp.kind, sp.target_id) for sp in s.specializations])
P::Owner::q 'P::T' '' [('typing', 'P::T')]
P::Owner::pSub '' '' [('subsets', 'P::Owner::q')]
P::Owner::pRef '' '' []
P::Owner::pBoth 'P::V' '' [('typing', 'P::V'), ('subsets', 'P::Owner::q')]
P::SubOwner::q '' '' [('redefines', 'P::Owner::q')]
P::tuned::a '' 'Real' [('redefines', 'P::Owner::a')]
The last line is the most common case in practice: attribute :>> mass = 1500; in a usage. The service does follow the redefinition for primitive ('Real') but leaves resolved_id empty, so the type is known but not reported.
The Python client's own code generator already works around this. _with_inherited_facts in client/python/opensysml/generate.py walks subsets/redefines to fill in a feature's type. A user reading Symbols has no such fallback, and the workaround cannot help pRef, whose reference subsetting is not reported at all.
Expected
-
type_info(or a new field) reports the feature's types as KerML derives them.Feature::typecovers the feature's own typings and the types of every feature it subsets. Redefinition and reference subsetting are kinds of subsetting, so their targets count too:feature expected types pSub :> qTpRef ::> qTpBoth : V :> qV,TSubOwner::q :>> qTtuned::a :>> a = 3.5ScalarValues::RealpBothhas two types, andTypeInfo.resolved_idholds one. A list is probably needed. Alternatively, a separate field could hold the derived types and leavetype_infoas the declared typing. -
pRef ::> qlists a specialization forq, with its own kind (the spec metaclass isReferenceSubsetting). The comment onSpecialization.kindinapi/proto/sysml.protolists onlyspecializes,subsets,redefinesandtyping. Reporting::>assubsetswould also do, since a reference subsetting is a subsetting. Losing the relationship entirely is the bug.
For comparison, the SysML v2 Pilot Implementation (0.64.0-SNAPSHOT, commit 378a8700c) and sysml-toolkit (v0.11.3) give the types and specializations above for every case.
Version
OpenSysML develop at 1a8e4927dc (2026-11-05), built locally: sysml-grpc nightly-153-g1a8e4927dc, Python client from client/python. The Go API (client/opensysml) gives the same results.
Related
#1961 is about features not being listed through a typing usage or a specialization. This issue is about features read directly in their owner, which are found but report the wrong type.
Found by
The test suite at https://github.com/hideo67/sysmlv2-tests, matrices A20 (attribute usages) and A40 (feature typing, subsetting and redefinition). Models: test-suite/data/models/A20.sysml and A40.sysml. Failing cases:
- A20-037..039: the type of
:>> plain = 3.5,:>> boundand:>> dflt = 5.5in a usage. - A40-007, A40-022: the specializations and subsetted features of
pRef ::> q. - A40-034, A40-037, A40-040, A40-043: the types of
pSub,pRef,pBothandSubOwner::q.
The other A40 failures (read through owner, subOwner, subSub) are #1961.
- Ngôn ngữ chính
- Go
- Star
- 56
- Fork
- 17
- Merge trung bình
- 12 giờ 31 phút
- Pull request đã merge (30 ngày)
- 909
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ó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug enhancement spec compliance
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Open-MBEE/OpenSysML#2009 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug spec compliance
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
Open-MBEE/OpenSysML#2008 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
Open-MBEE/OpenSysML#2006 · 1 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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
multica-ai/multica#10081 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
csp-probe needs efqdn to probe CSP domainsCó thể đã có người làm @unknownhackerworld đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
projectdiscovery/httpx#2725 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
stefanpejcic/OpenPanel#1321 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug triage/pending
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày