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

[Issue]: When defining validation schema for Neo4JGraphQueryEngine, how do I set the relationships? Also, why are there no properties? #228

Open
tyler-suard-parker opened this issue Dec 17, 2024 · 0 comments
Assignees

Comments

@tyler-suard-parker
Copy link

Describe the issue

@Eric-Shang Hello Eric. Thank you for writing a module for Neo4J.
This is what the example looks like:

relations = Literal[
    "FOLLOWS",
    "PROVIDES",
    "APPLIES_TO",
    "DEFINED_AS",
    "ASSIGNED_TO",
    "PART_OF",
    "MANAGES",
    "REQUIRES",
    "ENTITLED_TO",
    "REPORTS_TO",
]

# define which entities can have which relations
validation_schema = {
    "EMPLOYEE": ["FOLLOWS", "APPLIES_TO", "ASSIGNED_TO", "ENTITLED_TO", "REPORTS_TO"],
    "EMPLOYER": ["PROVIDES", "DEFINED_AS", "MANAGES", "REQUIRES"],
    "POLICY": ["APPLIES_TO", "DEFINED_AS", "REQUIRES"],
    "BENEFIT": ["PROVIDES", "ENTITLED_TO"],
    "POSITION": ["DEFINED_AS", "PART_OF", "ASSIGNED_TO"],
    "DEPARTMENT": ["PART_OF", "MANAGES", "REQUIRES"],
    "CONTRACT": ["PROVIDES", "REQUIRES", "APPLIES_TO"],
    "RESPONSIBILITY": ["ASSIGNED_TO", "REQUIRES", "DEFINED_AS"],
} ``` 

If I have a graph with uni-directional connections, how should I note the relationships in the validation schema?
If I have the relationship:
(node1) -- likes -> (node2)
How would I note that in the schema?

Would it be 
"node1":["likes"]
"node2":["likes"]

Or would it just be
"node1":["likes"]
?

Also, it is not clear to me where I should put the properties for each node.  Why are there no properties for the nodes in the example?  Thank you for your help.


### Steps to reproduce

_No response_

### Screenshots and logs

_No response_

### Additional Information

_No response_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants