Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Access to Archetype Unique IDs at Language Level #584

Open
ChrisIsKing opened this issue Aug 23, 2024 · 0 comments
Open

Access to Archetype Unique IDs at Language Level #584

ChrisIsKing opened this issue Aug 23, 2024 · 0 comments
Assignees

Comments

@ChrisIsKing
Copy link
Collaborator

This may be a jaclang-jaseci feature and not a jaclang one. Not entirely sure. I'm happy to move if this isn't covered here.

Is your feature request related to a problem? Please describe.

In Jac1/Jaseci v1 there was a notion of a JID in every archetype that allowed for its unique identification. In current jaclang this identifier is gone and the responsibility is put on the developer to manage the unique identification of their objects if needed.

Describe the solution you'd like

It would be great if at the language level we could access a unique identifier for each instantiated object without having to define or declare it ourselves. e.g.

Consider the code

node agent {
    has name: str;
    has description: str = "";
    has descriptor: str = "";
    has meta: dict = {};
    has published: bool = True;
}

with entry:__main__ {
   agent_node = here ++> agent(name="test");
   report {
       "agent": agent_node;
   }
}

When returned the agent object contains a unique identifier formatted as such: n:agents:66c65b889b1ee68a337bb051. It would be useful if the unique identifier is exposed at the language level especially when doing filters. e.g visit [-->](?agent)(id = agent_node.id). Currently, this id is only shown in report. print()` or manual inspection of the object vars does not expose this unique id.

Describe alternatives you've considered

Currently in order to uniquely identify nodes one would have to create a custom attribute and manage the assignment of it's unique value. e.g

node agent {
    has name: str;
    has description: str = "";
    has descriptor: str = "";
    has id: str = utils.generate_unique_id();
    has meta: dict = {};
    has published: bool = True;

}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants