Skip to content

feat: Copy paste of classes (RDFA-381)#93

Open
kiph-soptim wants to merge 40 commits into
mainfrom
feature/RDFA-381-Copy-Paste-of-classes
Open

feat: Copy paste of classes (RDFA-381)#93
kiph-soptim wants to merge 40 commits into
mainfrom
feature/RDFA-381-Copy-Paste-of-classes

Conversation

@kiph-soptim
Copy link
Copy Markdown
Collaborator

Description

Added the option to copy classes and paste them as duplicate or as abstract

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

Comment thread frontend/src/lib/rendering/svelteflow/svelteFlowWrapper.svelte Outdated
Comment thread frontend/src/lib/rendering/svelteflow/components/SvelteFlowPaneContextMenu.svelte Outdated
Comment thread frontend/src/routes/mainpage/packageNavigation/ClassEntry.svelte Outdated
Comment thread frontend/src/routes/mainpage/packageNavigation/PackageButton.svelte Outdated
spah-soptim and others added 12 commits May 5, 2026 14:48
Signed-off-by: Jan-Hendrik Spahn <jan-hendrik.spahn@soptim.de>
…-Paste-of-classes

# Conflicts:
#	backend/src/main/java/org/rdfarchitect/database/inmemory/InMemoryDatabaseAdapter.java
#	backend/src/main/java/org/rdfarchitect/services/select/QueryGraphService.java
#	backend/src/main/java/org/rdfarchitect/services/update/classes/UpdateClassService.java
#	backend/src/main/java/org/rdfarchitect/services/update/classes/associations/AssociationsService.java
#	backend/src/main/java/org/rdfarchitect/services/update/classes/attributes/AttributesService.java
#	backend/src/main/java/org/rdfarchitect/services/update/packages/UpdatePackageService.java
#	backend/src/test/java/org/rdfarchitect/services/update/UpdateClassServiceTest.java
#	frontend/src/lib/api/backend.js
#	frontend/src/routes/layout/menu-bar/Edit.svelte
Copy link
Copy Markdown
Collaborator

@rema-soptim rema-soptim left a comment

Choose a reason for hiding this comment

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

These are mostly changes for readability. Testing is yet to be done.

Copy link
Copy Markdown
Collaborator

@rema-soptim rema-soptim left a comment

Choose a reason for hiding this comment

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

  • The paste action pastes the class in a new package without the "package_" prefix, regardless if the original package has the prefix or not

  • When pasting a class with an association, that already exists, the association breaks. E.g. pasting IdentifiedObject and DiagramObject from the DL-profile to a new empty schema. For some reason this only happens, when pasting the IdentifiedObject first.

  • A similar bug happens, when pasting DiagramObject, then Diagram, then a DiagramObject again. This is probably the same bug, as described before, but i'm not 100% sure how and under what circumstances the paste with association works and when it doesn't

  • When a class does not exist in a graph, but is referenced as external and then is pasted, its pasted as a copy not as original, also its not possible to rename it to the original name, since its flagged as "must be unique".

  • When pasting a class with associations to a class that does not exists yet in the schema, there are faulty api calls for GET /datasets/.../graphs/.../classes/... on each reload of the class

  • the " - Copy" suffix adds spaces which are stored in the uri like this: "\u0020-\u0020Copy" This works, but i feel like spaces in class names should not be allowed or at least not encouraged?

  • "Copied class Diagram from DiagramLayout to no package as Diagram - Copy with attributes with associations" I think, when pasting to "no package" it should be "default package" instead to keep naming uniform. Also "Copy with attributes with associations" sounds strange, i think the last part should reflect the paste options, (without attributes, associations, bare), Also would it maybe make sense to add the dataset and graph name? this could result in a very long changelog message so im not sure about this.

  • ctrl-c, ctrl-v would be nice, but maybe this should be moved to the [RDFA-365] "Keyboard shortcuts" ticket, since i the behaviour of when to copy what, might not be trivial and would require some discussion.

  • There is no paste without enum entries, is this intentional? The option doesn't really make sense, since it should never

  • pasting into a different dataset/graph changes the selected package but not the dataset/graph. It should either be change all 3 or change none

  • When creating a class there is a package preselected called "nullnulldefault'

  • When nothing is selected "addClass" via the menu bar crashes the website

  • The order of paste and "addClass" is different in the packageNav context menu and the diagram context menu

  • there is no "constraints" option in the diagram class context menu

  • opening constraints via the packageNav class context menu, throws errors

  • Closing the class editor via the close buttons throws an error

  • Delete Class is not recorded in the changelog

  • some external classes are shown as external packages in the search results

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.

4 participants