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

Schema: Entity and relation taxonomy #484

Open
lmeyerov opened this issue May 13, 2023 · 0 comments
Open

Schema: Entity and relation taxonomy #484

lmeyerov opened this issue May 13, 2023 · 0 comments

Comments

@lmeyerov
Copy link
Contributor

lmeyerov commented May 13, 2023

Typed property graphs often have some sort of taxonomy, where nodes or relations with a certain label typically have specific fields, and those fields typically take on specific data representations

For example, Person nodes in an identity graph might look like:

class Person:
  name: str
  age: int
  addresses: List[str]
  alias: Optional[str]

Primitive types should match the database native schema, or even better, Apache Arrow types

Note the use of List, and if heterogeneity exists for a type, Optional, Union, etc

In cypher, that might correspond to (a: Person { name, age, addresses })

Something similar might be true of a relationship, like friend:

class IsFriends:
  first_met: datetime64[ms]
  • We should get the edge & node ontology in a machine-understandable format, e.g.,
class EntityRepresentation:
   attributes: Dict[str, FieldType]

PrimitiveTypes = Literal['str', 'int', ...]
CompoundTypes = Tuple[ Literal["Optional", "Union", "List"],  Union[PrimitiveTypes, 'CompoundTypes'] ]
FieldType = CompoundTypes


node_taxonomy : Dict[str, EntityRepresentation]
edge_taxonomy : Dict[str, EntityRepresentation]

There may be more convenient representations as well

  • Databases may have 1B+ elements, so inference should still work there
@lmeyerov lmeyerov changed the title Schema: Event and entity taxonomy Schema: Entity and relation taxonomy May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants