fix: Support packages without Package_ prefix (RDFA-481)#78
fix: Support packages without Package_ prefix (RDFA-481)#78spah-soptim wants to merge 5 commits intomainfrom
Conversation
a118737 to
72524f7
Compare
kiph-soptim
left a comment
There was a problem hiding this comment.
- 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
72524f7 to
5a68017
Compare
|
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) |
5a68017 to
13bd1f7
Compare
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>
13bd1f7 to
4c60bb6
Compare
Signed-off-by: Jan-Hendrik Spahn <jan-hendrik.spahn@soptim.de>
be5b546 to
558e8f7
Compare
kiph-soptim
left a comment
There was a problem hiding this comment.
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
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
Global MenuBar
Welcome Page
Editor - MenuBar
Editor - Navigation
Editor - Package View
Editor - Class Editor
Prefixes Page
Changelog Page
Compare Page