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 support for edge_project to QueryBuilder constructor #3420

Open
sphuber opened this issue Oct 14, 2019 · 1 comment
Open

Add support for edge_project to QueryBuilder constructor #3420

sphuber opened this issue Oct 14, 2019 · 1 comment

Comments

@sphuber
Copy link
Contributor

sphuber commented Oct 14, 2019

This functionality is currently only accessible through the QueryBuilder.append method. However, the REST API uses the method of initialization through the constructor

@sphuber sphuber added priority/critical-blocking must be resolved before next release topic/query-builder type/accepted feature approved feature request labels Oct 14, 2019
@sphuber sphuber added this to the v1.0.0 milestone Oct 14, 2019
@sphuber sphuber self-assigned this Oct 14, 2019
@sphuber sphuber removed this from the v1.0.0 milestone Oct 14, 2019
@sphuber
Copy link
Contributor Author

sphuber commented Oct 14, 2019

Apparently, this is already supported but not documented and the syntax is weird.

query_help = {
    'path': [{
        'cls': orm.Node,
        'tag': 'n1',
    }, {
        'cls': orm.Node,
        'tag': 'n2',
        'edge_tag': 'n1--n2',
        'with_incoming': 'n1'
    }],
    'filters': {
    },
    'project': {
        'n1': ['id', 'uuid', 'ctime'],
        'n2': ['id', 'description'],
        'n1--n2': [{'label': {}}, {'type': {}}]
    },
} 

Note that for the edge projections on edge n1--n2 one does not have to specify a flat list but a list of dictionaries where the key is the desired projection and its value is always an empty dictionary.

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