|
2 | 2 | import json |
3 | 3 | import logging |
4 | 4 | import os |
| 5 | + |
5 | 6 | import bmt |
6 | 7 | from biothings.utils import serializer |
7 | 8 | from biothings.web.auth.authn import BioThingsAuthnMixin |
8 | 9 | from biothings.web.handlers import BaseAPIHandler, QueryHandler |
9 | 10 | from biothings.web.handlers.query import BiothingHandler, capture_exceptions |
10 | 11 | from biothings.web.settings.default import QUERY_KWARGS |
11 | 12 | from tornado.httpclient import AsyncHTTPClient |
12 | | -from tornado.web import Finish, HTTPError |
13 | 13 | from tornado.template import Loader |
| 14 | +from tornado.web import Finish, HTTPError |
14 | 15 |
|
15 | 16 | from controller import SmartAPI |
16 | 17 | from controller.exceptions import ControllerError, NotFoundError |
17 | 18 | from pipeline import MetaKGQueryPipeline |
| 19 | +from utils.decoder import to_dict |
18 | 20 | from utils.downloader import DownloadError, download_async |
| 21 | +from utils.metakg.biolink_helpers import get_expanded_values |
| 22 | +from utils.metakg.cytoscape_formatter import CytoscapeDataFormatter |
19 | 23 | from utils.metakg.export import edges2graphml |
| 24 | +from utils.metakg.metakg_errors import MetadataRetrievalError |
| 25 | +from utils.metakg.parser import MetaKGParser |
20 | 26 | from utils.metakg.path_finder import MetaKGPathFinder |
21 | | -from utils.metakg.cytoscape_formatter import CytoscapeDataFormatter |
22 | | -from utils.metakg.biolink_helpers import get_expanded_values |
23 | 27 | from utils.notification import SlackNewAPIMessage, SlackNewTranslatorAPIMessage |
24 | | -from utils.metakg.parser import MetaKGParser |
25 | | -from utils.metakg.metakg_errors import MetadataRetrievalError |
26 | | -from utils.decoder import to_dict |
27 | 28 |
|
28 | 29 | logger = logging.getLogger("smartAPI") |
29 | 30 |
|
@@ -627,7 +628,7 @@ class MetaKGPathFinderHandler(QueryHandler): |
627 | 628 | "max": 6, |
628 | 629 | "default": [], |
629 | 630 | "enum": ["subject", "object", "predicate", "node", "edge", "all"] |
630 | | - } |
| 631 | + } |
631 | 632 | }, |
632 | 633 | } |
633 | 634 |
|
@@ -722,9 +723,9 @@ async def get(self, *args, **kwargs): |
722 | 723 | self.write(raw_query_output) |
723 | 724 | return |
724 | 725 | res = { |
725 | | - "total": len(paths_with_edges), |
726 | | - "paths": paths_with_edges, |
727 | | - } |
| 726 | + "total": len(paths_with_edges), |
| 727 | + "paths": paths_with_edges, |
| 728 | + } |
728 | 729 | await asyncio.sleep(0.01) |
729 | 730 | self.finish(res) |
730 | 731 |
|
|
0 commit comments