GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Is it possible to change type of record? · Issue #934 · ArcadeData/arcadedb

Is it possible to change type of record? #934

New issue
Copy link
New issue
Copy link
Closed
Closed
Is it possible to change type of record?#934
Copy link
Assignees
lvca
Labels
questionFurther information is requested
Milestone
23.3.1

Description

@FilipJirsak
FilipJirsak
opened on Mar 13, 2023
Issue body actions

Is it possible to change the record type (with completion of mandatory fields)?
For example, when importing data, I can have information about the user's login. I will create a record for him and link it with other data. Subsequently, in a separate transaction, I download additional information about the user and add it to the original record. However, I would also like to update the record type so that it is clear from the type that all mandatory fields for the given type are filled out.

CREATE VERTEX TYPE PersonBasic;
CREATE PROPERTY PersonBasic.login STRING (mandatory true, notnull true);

CREATE VERTEX TYPE PersonFull EXTENDS PersonBasic;
CREATE PROPERTY PersonFull.displayName STRING (mandatory true, notnull true);
CREATE PROPERTY PersonFull.email STRING (mandatory false, notnull true);
CREATE PROPERTY PersonFull.nick STRING (mandatory false, notnull true);

CREATE VERTEX PersonBasic SET login = 'bobo';

-- create edge to created PersonBasic
CREATE EDGE E1 FROM #10:3 TO #11:4;

-- change type to PersonFull somehow ???
UPDATE #11:4 SET displayName = 'Bob Sandwich', email = '[email protected]', nick = 'Bobo';

Activity

  1. FilipJirsak
    changed the title [-]Is it posible to change type of record?[/-] [+]Is it possible to change type of record?[/+] on Mar 13, 2023
  2. gramian commented on Mar 13, 2023

    @gramian
    gramian
    on Mar 13, 2023
    Collaborator
    More actions

    Hi,
    AFAIK this is not doable, at least in the way you want to. In theory you could do something like:

    UPDATE #11:4 SET displayName = 'Bob Sandwich', email = '[email protected]', nick = 'Bobo', @type = 'PersonFull';
    

    I did quick test but this results in an error (@lvca is this correct behavior?).
    Though, as you would need some logic anyways to find an existing entry, you could just INSERT INTO PersonFull a new entry including the properties (login, incoming edges @in, outgoing edged @out) from the already identified PersonBasic entry (ie using a sub-query), and afterwards DELETE the PersonBasic entry by @rid.

    If what you describe above is your actual use-case I would like to very humbly suggest to consider to add a (boolean) property indicating if the full person info is set. A bit cleaner would may be to add an EMBEDDED (document) property to PersonBasic which is null by default and can hold the PersonFull data. This way you just have to test for nullity of this property (no need for an extra Boolean) and avoid reconnecting vertices in your graph.

    Reacted by Filip Jirsák
  3. lvca commented on Mar 13, 2023

    @lvca
    lvca
    on Mar 13, 2023
    Member
    More actions

    Changing the type is not possible, the easier way is to create a new vertex and copy the information you want. I suggest to create a base class to use polymorphism:

    create vertex type PersonInfo;
    create vertex type PersonBasic extends PersonInfo;
    create vertex type PersonFull extends PersonInfo;

    And define the common properties in the PersonInfo.

  4. lvca
    self-assigned this
    on Mar 13, 2023
  5. lvca
    added
    questionFurther information is requested
    on Mar 13, 2023
  6. lvca
    added this to the 23.3.1 milestone on Mar 13, 2023
  7. lvca
    closed this as completedon Mar 13, 2023
  8. mergify
    added a commit that references this issue on May 24, 2026

    chore(deps): bump uuid and testcontainers in /e2e-js [skip ci]

    7989577
  9. tae898
    added a commit that references this issue on Jun 28, 2026

    chore(deps): bump uuid and testcontainers in /e2e-js [skip ci]

    b3bde1e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lvca
    lvca

Labels

questionFurther information is requested

Type

No type

Projects

No projects

    Milestone

    • 23.3.1

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.