Code Monkey home page Code Monkey logo

Comments (3)

khoale88 avatar khoale88 commented on June 15, 2024

I think somehow type serves as a kind of index. The graph search engine can leverage this to search for a subset of nodes/edges instead of searching for all nodes. Our algorithm does not benefit from this just yet. But it's nice to have, maybe for the sake of being cypher (?).

If it is to be done, I recommend it is to be stored under the __type__ property. Why two-end double dashes? it more adheres to the python convention and leaves room for other usages. It appears to be intimidating for users to construct a graph by themselves following this convention. But it will go away as soon as graph mutation is supported.

from grand-cypher.

j6k4m8 avatar j6k4m8 commented on June 15, 2024

Oh I like __type__ __label__, that seems like the right move for sure! Good call. We can also perhaps have a few utilities to easily assign labels before adding proper support for mutations, like (just a sketch, I don't feel strongly about this API in particular)

from grandcypher import assign_labels

g_with_labels = assign_labels(g, assignments)

where assignments can be a dict or callable:

assignments = {"a": "Customer", "b": "Store", "c": "Product"}
# or:
assignments = lambda x: x.split(":")[1:] # for node IDs of format "Jordan:Customer"

One thing to keep in mind is that objects can have more than one entity label assigned... So __label__ may have to be a complex dtype like set instead of a simple str.

[EDIT] Went back and changed "types" to "labels" to match cypher terminology.

from grand-cypher.

j6k4m8 avatar j6k4m8 commented on June 15, 2024

Fixed by @khoale88 in #25 :):)

from grand-cypher.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.