Skip to content

fix: Support packages without Package_ prefix (RDFA-481)#78

Open
spah-soptim wants to merge 5 commits intomainfrom
fix/RDFA-481-packages-without-prefix
Open

fix: Support packages without Package_ prefix (RDFA-481)#78
spah-soptim wants to merge 5 commits intomainfrom
fix/RDFA-481-packages-without-prefix

Conversation

@spah-soptim
Copy link
Copy Markdown
Member

@spah-soptim spah-soptim commented Apr 16, 2026

Description

Allows packages without the Package_ prefix.

The backend now preserves the raw package URI instead of rewriting Package_.
Frontend now hides the Package_ in the UI.

Test Checklist

General Behavior

  • Components reload automatically when data changes
  • Editing features are disabled in readonly datasets
  • Dialogs pre-select current dataset/graph
  • Required fields are validated in dialogs
  • Discarding unsaved changes opens a discard cancel confirm dialog

Global MenuBar

  • Navigate to home page works
  • File menu:
    • Import → Graph/SHACL works
    • Export → Graph/SHACL works
    • Share Snapshot works
    • Delete → Dataset/Graph works
  • Edit menu:
    • New → Class works
    • New → Package works
    • Edit/View → Create/Edit/View Ontology works
    • Edit/View → Package works
    • Undo/Redo (Ctrl+Z / Ctrl+Y) works
    • Enable/Disable editing works
    • Manage/View namespaces works
    • Delete → Ontology/Package works
  • View menu:
    • Changelog opens and shows current graph
    • Compare Graphs opens
    • Full SHACL works
  • Help menu:
    • Help link works
    • Submit Feedback link works
    • About navigation works

Welcome Page

  • Navigation to Editor works
  • Tips are displayed
  • Security and data information displayed
  • Copyright and version information displayed

Editor - MenuBar

  • Search function works with all filters (All Datasets, Current Dataset, Current Graph, Current Package)
  • Search finds classes, attributes, associations, packages
  • "Enable Editing" button appears for readonly datasets

Editor - Navigation

  • Hierarchical display (Datasets → Graphs → Packages) works
  • Selection is highlighted
  • Selecting a class does not change dataset/graph/package selection
  • Class selection stays open/highlighted when switching dataset/graph/package
  • Datasets and graphs are collapsible
  • Single click selects; double click or chevron toggles expand/collapse
  • State persists on reload (non-browser)
  • Context menus act on the dataset/graph/package they were opened on
  • Hover labels show prefixes when configured
  • Dataset context menu:
    • Import graph works (disabled in readonly datasets)
    • Share Snapshot works
    • Enable/Disable editing works
    • Manage/View namespaces works
    • Delete dataset works
  • Graph context menu:
    • New package works (disabled in readonly datasets)
    • Undo/Redo works (only enabled when available)
    • Create Ontology
    • Edit Ontology (View Ontology in readonly)
    • Delete Ontology
    • Changelog navigation works
    • Compare dialog works
    • SHACL import/export/full view works (import disabled in readonly datasets)
    • Export graph works
    • Delete graph works (disabled in readonly datasets)
  • Package context menu:
    • Create new class works (disabled in readonly datasets)
    • View/Edit package works
    • Copy URL works
    • Delete package works (disabled for external/default packages and readonly datasets)
  • Class context menu:
    • Open class (editor) works
    • SHACL works
    • Delete class works (disabled in readonly datasets)

Editor - Package View

  • Class diagram displays correctly
  • Moving nodes works and layout changes persist after reload
  • Loading animation shows while loading
  • Info cards show when no package or no classes available
  • Drag and zoom diagram works
  • "Reset View" button works
  • "Filter View" works
  • "Reset Layout" button resets diagram to auto-generated layout
  • Click on class opens class editor

Editor - Class Editor

  • Display and edit class properties: UUID (readonly), Label, Namespace, Package, Derived from, Abstract, Stereotypes, Attributes, Associations, Comment
  • Delete class works
  • Save changes works
  • Discard changes works
  • Attribute Editor works
  • Association Editor works
  • attribute/association SHACL View works
  • Class SHACL View works

Prefixes Page

  • View, add, remove and edit namespaces works

Changelog Page

  • Select graph and display write operations works
  • Operations shown in reverse chronological order
  • Detailed view of changed triples works
  • Restoring graph to a version works

Compare Page

  • Compare two graphs works

@spah-soptim spah-soptim marked this pull request as ready for review April 16, 2026 09:41
@spah-soptim spah-soptim force-pushed the fix/RDFA-481-packages-without-prefix branch from a118737 to 72524f7 Compare April 17, 2026 06:51
Copy link
Copy Markdown
Collaborator

@kiph-soptim kiph-soptim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Creating a class in an imported package, the class is created in an external package named like the imported package
  • When creating a package that has the same IRI as an already existing class, the package and the class are doubled displayed in the navigation

@spah-soptim spah-soptim self-assigned this Apr 26, 2026
@spah-soptim spah-soptim force-pushed the fix/RDFA-481-packages-without-prefix branch from 72524f7 to 5a68017 Compare April 26, 2026 21:39
@spah-soptim
Copy link
Copy Markdown
Member Author

Issue 1: Package and class doubled in navigation when sharing an IRI

Without the Package_ prefix on package URIs, creating a package whose URI matches an existing class produces a single RDF resource carrying both rdf:type rdfs:Class and rdf:type cims:ClassCategory. The class list query and package list query each picked it up, producing duplicate nav entries.

Fixed in QueryGraphService.java#getClassList: Add a FILTER NOT EXISTS { ?uri rdf:type cims:ClassCategory } to the class query so a resource that is also a package is shown only as the package.

Issue 2: Class created in a duplicate "external" package

The bug occurred for packages where the URI suffix (e.g. Package_Wires) differed from the rdfs:label literal (e.g. Wires). PackageMapper.toDTO was sourcing the DTO label from the literal rdfs:label while buildURI reconstructs the URI as prefix + label. The reconstructed URI (…#Wires) didn't match the actual package URI (…#Package_Wires), so newly created classes pointed to a non-existent resource that then surfaced as a separate "external" package with the same display name.

Fixed in PackageMapper.java: source DTO label from uri.suffix (and likewise for BelongsToCategoryDTO)

@spah-soptim spah-soptim force-pushed the fix/RDFA-481-packages-without-prefix branch from 5a68017 to 13bd1f7 Compare April 26, 2026 21:44
Without the Package_ prefix on package URIs, creating a package whose URI matches an existing class produces a single RDF resource carrying both rdf:type rdfs:Class and rdf:type cims:ClassCategory. The class list query and package list query each picked it up, producing duplicate nav entries.

Fixed in QueryGraphService.java#getClassList: Add a FILTER NOT EXISTS { ?uri rdf:type cims:ClassCategory } to the class query so a resource that is also a package is shown only as the package.
The bug occurred for packages where the URI suffix (e.g. Package_Wires) differed from the rdfs:label literal (e.g. Wires). PackageMapper.toDTO was sourcing the DTO label from the literal rdfs:label while buildURI reconstructs the URI as prefix + label. The reconstructed URI (…#Wires) didn't match the actual package URI (…#Package_Wires), so newly created classes pointed to a non-existent resource that then surfaced as a separate "external" package with the same display name.

Fixed in PackageMapper.java: source DTO label from uri.suffix (and likewise for BelongsToCategoryDTO)

Signed-off-by: Jan-Hendrik Spahn <jan-hendrik.spahn@soptim.de>
@spah-soptim spah-soptim force-pushed the fix/RDFA-481-packages-without-prefix branch from 13bd1f7 to 4c60bb6 Compare April 26, 2026 21:51
Signed-off-by: Jan-Hendrik Spahn <jan-hendrik.spahn@soptim.de>
@spah-soptim spah-soptim force-pushed the fix/RDFA-481-packages-without-prefix branch from be5b546 to 558e8f7 Compare April 26, 2026 22:09
@spah-soptim spah-soptim enabled auto-merge (squash) April 26, 2026 22:12
@spah-soptim spah-soptim requested a review from kiph-soptim April 27, 2026 07:00
Copy link
Copy Markdown
Collaborator

@kiph-soptim kiph-soptim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When creating a package that has the same IRI as an already existing class, the package is doubled displayed in the navigation and the class disappears. In the rendered diagram the class is still shown, but the class editor won't load

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.

2 participants