· 6 years ago · Apr 07, 2020, 11:20 PM
1Traceback (most recent call last):
2 File "/home/kristian/.virtualenvs/hydrus/src/hydra-python-core/hydra_python_core/doc_maker.py", line 61, in create_doc
3 id_ = doc["@id"]
4KeyError: '@id'
5
6During handling of the above exception, another exception occurred:
7
8Traceback (most recent call last):
9 File "app.py", line 15, in <module>
10 agent = Agent(url)
11 File "/home/kristian/.virtualenvs/hydrus/src/hydra-agent/hydra_agent/agent.py", line 30, in __init__
12 self.fetch_apidoc()
13 File "/home/kristian/.virtualenvs/hydrus/src/hydra-agent/hydra_agent/agent.py", line 48, in fetch_apidoc
14 self.api_doc = doc_maker.create_doc(jsonld_api_doc)
15 File "/home/kristian/.virtualenvs/hydrus/src/hydra-python-core/hydra_python_core/doc_maker.py", line 63, in create_doc
16 raise SyntaxError("The API Documentation must have [@id]")
17SyntaxError: The API Documentation must have [@id]
18
19
20Which comes from these lines on Hydrus:
21
22def create_doc(doc: Dict[str, Any], HYDRUS_SERVER_URL: str = None,
23 API_NAME: str = None) -> HydraDoc:
24 """Create the HydraDoc object from the API Documentation.
25
26 Raises:
27 SyntaxError: If the `doc` doesn't have an entry for `@id` key.
28 SyntaxError: If the `@id` key of the `doc` is not of
29 the form : '[protocol] :// [base url] / [entrypoint] / vocab'
30
31 """
32 # Check @id
33 try:
34 id_ = doc["@id"]
35 except KeyError:
36 raise SyntaxError("The API Documentation must have [@id]")