-
Notifications
You must be signed in to change notification settings - Fork 6
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
ApiDoc Automation script created & mock portfolio data generator refectored. #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look great. Also tested NPLVocab_parser.
Suggestion : get_npl_vocab function will give FileNotFoundError
for NonPerformingLoan.jsonld. It only works when api_docwriter.py
is ran from terminal ( cd : exact file path).
To solve file path issue you can use something like :
from pathlib import Path
from os.path import abspath, dirname
cwd_path = Path(dirname(dirname(abspath(__file__))))
vocab_file_path = cwd_path / "npl_vocab" / "NonPerformingLoan.jsonld"
I would put the portfolio generator script in a separate directory. In principle this is not a test but a mock client. |
on the vocabulary parser, should there be different treatment of data properties versus object properties? actually not sure what the later (object properties) are mapped into. in any case data properties are the immediate focus |
@open-risk probably after merging this PR you can remove and put it in a separate directory. |
For object property the property_uri is the |
@open-risk please do approve these changes so that we can merge this PR. |
That should probably always work if the input ontology is valid. The peculiar case is if the ontology has a class with an object property linking it to another class that has no data properties. Logically it is fine but it will be implemented as a FK to a table that has no data... |
Fixes #15
As of now, we create all the classes and properties in ApiDoc using docwriter.py manually.
I have created the script which will parse the
NonPerformingLoan.jsonld
and can create hydra classes & properties for ApiDoc.NonPerformingLoan.jsonld --> ApiDoc
Methods used to parse the jsonld-ld are defined in
NPLVocab_parser.py
It can be used as:
The ApiDoc generated by the new script is tested with the postman. and all the tests are passing as well.
mock_porfolio_generator.py
is also refactored.creating objects in sequence.
CounterParty --> Loan --> Collateral