GetElementProperties answers nothing for a model when one document has an error or a duplicate top-level name

未关闭
#2,029 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
go

调研方向

Start by tracing the GetElementProperties entry point and how it builds the element form for a model containing multiple documents. Reproduce the reported behavior with the Pilot examples, including one document with an error or a duplicate top-level name. The issue is resolved when elements from unaffected documents remain readable while the problematic document is handled with an error or excluded from the element form.

由索引模型根据 Issue 内容生成。

描述

bug

When the Pilot's examples are parsed as one model (195 files), GetElementProperties answers no element of the model if any one document:

  • has an error diagnostic, for example Dynamics.sysml ("cannot bind a value of dimension L^4·M^2·T^-5 to a feature typed by AccelerationValue"), or
  • declares a top-level name that another document also declares. The Pilot's training material has four such pairs, e.g. training/17. Control/Camera.sysml and examples/Camera Example/Camera.sysml.

The answer for every element is then the same message, for example:

cannot convert the declaration of Camera at …/training/17. Control/Camera.sysml:1:1: its id lands on the same IRI as Camera at …/examples/Camera Example/Camera.sysml:1:1, which another document declares, and merging two elements into one subject would be a different model

The reason given for the duplicate case makes sense. What makes it hard to use is the scope: one document affects the whole model. For a workspace of many files (an editor, a CI check over a repository), being able to read the elements of the other documents would help a lot. That could mean keeping the affected document out of the element form, or answering its elements with the error while the rest stay readable.

For reference, these documents are the ones OpenSysML reports errors in. The Pilot reports no error for any of them:

  • examples/Analysis Examples/Dynamics.sysml: the dimension check above
  • examples/Simple Tests/PartTest.sysml: "p1 participates in a specialization cycle"
  • both Annex A vehicle files: vehicle_b is hidden by two imports that bring distinct elements of that name
  • our C30-accept.sysml: a syntax error on entry … then …

Each of these may be worth a look on its own. We're happy to open separate issues if that's more convenient.

Found while building the census in #2028. In the census, such documents are left out for OpenSysML and listed under "Corpora".

主要语言
Go
星标
56
派生
17
平均合并
12 小时 45 分钟
30 天内合并 PR
910

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Open-MBEE/OpenSysML 的其他 Issue

查看 Open-MBEE/OpenSysML 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。