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 bounded graph queries #126

Open
tuxdna opened this issue Mar 16, 2018 · 2 comments
Open

Add support for bounded graph queries #126

tuxdna opened this issue Mar 16, 2018 · 2 comments

Comments

@tuxdna
Copy link
Contributor

tuxdna commented Mar 16, 2018

At present BayesianGraph.execute() does not support queries with bounded parameters:

def execute(cls, str_gremlin_dsl):
"""Execute the query prepared for the graph database."""
logger.debug("BayesianGraph::execute() Gremlin DSL: %s", str_gremlin_dsl)
payload = {'gremlin': str_gremlin_dsl}
response = requests.post(config.GREMLIN_SERVER_URL_REST,
data=json.dumps(payload))
json_response = response.json()
logger.debug("BayesianGraph::execute(): %s", response)
if response.status_code != 200:
logger.error("ERROR %d(%s): %s" % (response.status_code, response.reason,
json_response.get("message")))
return False, json_response
else:
return True, json_response

Support for bounded parameters will help us write better queries and avoid many bugs.

@tuxdna
Copy link
Contributor Author

tuxdna commented Mar 16, 2018

Bounded parameters work similar to prepared statements in SQL. Here is an example:
Bounded parameters

@miteshvp
Copy link
Contributor

miteshvp commented Mar 16, 2018

Its a matter of implementing it in data importer. We do for front-ending services as in https://github.com/fabric8-analytics/f8a-server-backbone/blob/aa74d11653d05f6e7bb4d1daad50c188d0a6168f/src/recommender.py#L129
But since data importer endpoint was not public till now, so was ok, but, we may need to implement it .

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

2 participants