HTTP-APIs / hydrus

REST server - Flask Hydra-powered for Semantic Web
https://pypi.org/project/hydrus/
MIT License
195 stars 130 forks source link

Fixing typo in `demo.py` file #611

Closed vrutik2809 closed 2 years ago

vrutik2809 commented 2 years ago

Fixes #610

Checklist

Current behaviour

There is a typo in the demo.py file. Due to that the following error was occurring: image

New expected behaviour

The typo has been removed. Now it will work completely fine.

Change logs

Fixed

Mec-iS commented 2 years ago

please check if the same declaration is present in other parts of the codebase

vrutik2809 commented 2 years ago

Another two issues found in the same file:

Need to remove those lines

Mec-iS commented 2 years ago

you should provide the changes to fix those then. Are those methods unused or they changed names? Check hydra-python-core repository also.

Mec-iS commented 2 years ago

Those methods have been removed from hydrus/data/doc_parse.py so demo.py should be updated.

Mec-iS commented 2 years ago

@farazkhanfk7 do you know what we use now in place of insert_classes to generate the class objects?

farazkhanfk7 commented 2 years ago

In hydrus/data/db_models.py, there is a Resource class which is used to create a Class or Collection. It has a function make_db_table, which is called by another function create_database_tables to insert classes in the database. https://github.com/HTTP-APIs/hydrus/blob/c6a8587c7904afe64c31f74da1f9d4edc7139ed2/hydrus/data/db_models.py#L217-L220

vrutik2809 commented 2 years ago

Unavailable method removed from demo.py file

Mec-iS commented 2 years ago

ok. but now the demo should work by using the new methods.

farazkhanfk7 commented 2 years ago

@vrutik2809 you can take a look at app.py for reference and also make sure that hydrus server is working fine after running demo.py.

vrutik2809 commented 2 years ago

While running demo.py, it is running two times:

I'm not able to figure out why it is happening.

While debugging it, I also observed that even if pass a different port or api-name it still listen to base-url & api-name provided while making documentation using doc.writer.HydraDoc(). It can be verified in the above image also. Api-name in the doc.py (reference image attached below) is api but in demo.py it is passed as serverapi then it is throwing 404 but when I fire a request on /api then it gives me 200

snap of doc.py : image

vrutik2809 commented 2 years ago

I have opened new issue (#613) regarding PORT and API_NAME problem.

Mec-iS commented 2 years ago

Thanks!