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

Fix application exploration #287

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion buildingmotif/api/views/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def get_model_graph(models_id: int) -> Graph:
except NoResultFound:
return {"message": f"No model with id {models_id}"}, status.HTTP_404_NOT_FOUND

return model.graph.serialize(format="ttl"), status.HTTP_200_OK
g = Graph() + model.graph
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also a copy_graph function in utils.py however, looking at the implementation it seems like it might be slower than this. @gtfierro what do you think?


return g.serialize(format="ttl"), status.HTTP_200_OK


@blueprint.route("/<models_id>/target_nodes", methods=(["GET"]))
Expand All @@ -79,6 +81,7 @@ def get_target_nodes(models_id: int) -> Graph:
"""
)
result = list({r for r in result})
result.sort()

return result, status.HTTP_200_OK

Expand Down