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

Edge variable matching #22

Open
IMP1 opened this issue Jul 6, 2018 · 3 comments
Open

Edge variable matching #22

IMP1 opened this issue Jul 6, 2018 · 3 comments

Comments

@IMP1
Copy link
Owner

IMP1 commented Jul 6, 2018

Variables' values can't be calculated if they only exist in an edge's label.

rule r1
    <int x>
    [1, 2 | 1->2 (x), 2->1 (x)]
 => [];

If there are two edges from node A to node B with values 3 and 4, and one from node B to node A with value 4, then the edges with value 4 should be matched, right? But this currently isn't possible.


Also, there's a step where a possible matching is only kept if all the mappings it has have valid (read: equal) variable values. Edges can't be checked in the same way. Maybe check that the count of edges between two rule nodes with variable labels is equal to (or less than) the count of edges between two graph nodes with the same value of the right type. But this condition should be checked for all possible variable values, which may be more than one per matching (see above)

@IMP1
Copy link
Owner Author

IMP1 commented Jul 6, 2018

If the variable exists in a node's label, then use that as the value (because it's dependent on the possible_matching). If there are any rule edges with the same variable, then make sure that there are at least as many graph edges with the right value between the same nodes.

If the variable doesn't exist in a node's label, and instead is in a edge's label, then just check there are as many graph edges with the right type and the same value as there are rule edges with the variable.

@IMP1
Copy link
Owner Author

IMP1 commented Jul 6, 2018

None of this would be a problem if you could only have one instance of a variable. You could still check for variables being equal in a rule's condition as well...
It's nice for the user though, just looks like it might be a pain in the arse to implement.

IMP1 added a commit that referenced this issue Jul 6, 2018
@IMP1 IMP1 self-assigned this Jul 6, 2018
@IMP1
Copy link
Owner Author

IMP1 commented Jul 10, 2018

Is it the case that if a variable isn't present in any node labels, and is only in edge labels. That any value for this variable is fine, and shouldn't effect the possible matching of the node mappings?

Because if that's the case, then any value for the variable (that has enough matching edges) can be chosen with no problems.

I'm currently too tired to reason about whether or not this is the case.

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

No branches or pull requests

1 participant