Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add (optional) properties to edges #38

Merged
merged 24 commits into from
Nov 4, 2023

Conversation

drkameleon
Copy link
Contributor

Until now, Grafito offers properties/data only for nodes.

However, adding this possibility for edges too would be really interesting and useful (most graph databases support, plus it could open the way for things like "weights graphs", etc), so... let's see how this goes! 🚀

P.S. Syntax-wise, especially in queries, this might get a tiny bit complicated, but remains to be seen!

@drkameleon drkameleon added enhancement New feature or request engine Issues related the Grafito database engine core functions Issues related to the main Grafito functions labels Nov 3, 2023
@drkameleon drkameleon self-assigned this Nov 3, 2023
@drkameleon drkameleon changed the title Add option properties to edges Add (optional) properties to edges Nov 4, 2023
@drkameleon
Copy link
Contributor Author

drkameleon commented Nov 4, 2023

And... ready to merge! 🚀


What we've managed in this PR

In a few words

Now, not only nodes by edges may have properties/data as well

How do we set set this data?

Let's say we have our helpers in place (e.g. lemma, etc):

lemma ~> 'means .:[as: "noun"] someMeaning

(.: is the part where we are setting the edge's - means's - properties, using a weird bug-or-feature of Arturo: empty attributes - yes, .: is actually the "" attribute being set to [as:"noun"] ⚠️ )

How do we query this data?

lemma [
    means: |> [][
        as: "noun"
    ]
]

Word of caution: The above (the syntax mainly) may change. So, don't trust it 100%. (Better ask me, if you want to play and have questions - I'll be more than glad to help, if I can). Plus, the whole project is still in in-the-making stage, so different things could change. Sure thing is it needs an extreme cleanup & re-organization, which I hope to find the time for soon! 🚀

@drkameleon drkameleon merged commit 7413c2b into main Nov 4, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core functions Issues related to the main Grafito functions engine Issues related the Grafito database engine enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant