Skip to content

Add PackageRead.Parts to enumerate package parts - #96

Merged
aaronzi merged 1 commit into
eclipse-aascw:mainfrom
aaronzi:feat/enumerate-parts
Oct 13, 2026
Merged

aaronzi merged 1 commit into
eclipse-aascw:mainfrom
aaronzi:feat/enumerate-parts

Conversation

@aaronzi

@aaronzi aaronzi commented Oct 13, 2026

Copy link
Copy Markdown
Member

Fixes #79

Problem

Every PackageRead accessor needs either a relationship or a URI the caller already knows, and PackageBase.parts is not accessible. So a part that no relationship targets can't be discovered.

OPC (ISO/IEC 29500-2, which IDTA-01005 builds on) allows such parts, and they show up in practice. For example, examples/IDTA-01005_Example.aasx in admin-shell-io/aas-specs-aasx holds three PDFs under aasx/suppl/. data.xml refers to them through File elements, but the package has no aas-suppl relationships. Strictly speaking, that example doesn't follow Part 5, which expects such files to be targeted by aas-suppl from the spec. A reader still needs a way to notice them.

Change

  • New PackageRead.Parts(): Promise<Part[]>. It returns every part in the package sorted by path, including parts no relationship targets. OPC metadata ([Content_Types].xml, *.rels) is not included, same as everywhere else in the API.
  • README API table updated.
  • Test covering an unrelated part, including DeletePart afterwards.

On the IDTA example, Parts() now lists the origin, data.xml, all three supplementary PDFs and Thumbnail.png.

The same gap exists in aas-package3-golang. A matching PR is opened there.

Every read accessor so far needs a relationship or an already known URI,
so a part that no relationship targets could not be discovered at all.
Such parts are legal in an OPC package and occur in practice, e.g. the
supplementary files of the IDTA-01005 example package, which has no
aas-suppl relationships.

Parts lists every part (excluding the OPC metadata entries) sorted by
path, so importers can detect content they would otherwise drop.

Fixes eclipse-aascw#79
@aaronzi
aaronzi merged commit 730b047 into eclipse-aascw:main Oct 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to enumerate parts, so a part no relationship points at is invisible

1 participant