-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Readme & docs updated, test for iri collection added (#22)
* README.md Updated. * Diagram updated * collection_iri test Added. * vocab_generator doc added * nplvocab_parser doc added
- Loading branch information
1 parent
28d9c7b
commit 684987a
Showing
5 changed files
with
102 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# nplvocab_parser | ||
|
||
`nplvocab_parser` parses all the classes & properties from `NonPerformingLoan.jsonld` and convert them to HydraClass & HydraClassProp. | ||
|
||
nplvocab_parser is located in `api_doc` directory | ||
```python | ||
api_doc | ||
| | ||
|___ nplvocab_parser.py | ||
``` | ||
It can be used by importing as a python module: | ||
```python | ||
import NPLVocab_parse as parser | ||
|
||
npl_vocab = parser.get_npl_vocab() | ||
classes = parser.get_all_classes(npl_vocab) | ||
hydra_classes = parser.create_hydra_classes(classes) | ||
``` | ||
nplvocab_parser provide following functions: | ||
* `get_all_classes()` -> Return all the classes from the given Vocabulary. | ||
* `create_hydra_classes()` -> Return list of HydraClass objects. | ||
* `get_class_properties()` -> Return all the properties of the given class. | ||
* `create_hydra_properties()` -> Return list of HydraclasProps from the list of properties. | ||
* `get_class_id()` -> Returns the class id of given class. | ||
* `add_operations_to_class()` -> Return list of hydra properties of given class. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# vocab_generator | ||
|
||
`vocab_genrator.py` generates `NonPerformingLoan.jsonld` vocabulary from the owl ontology. | ||
|
||
It is located inside the `npl_vocab` directory. | ||
```python | ||
npl_vocab | ||
| | ||
|___ vocab_generator.py | ||
``` | ||
vocab_generator uses [rdflib](https://github.com/RDFLib/rdflib-jsonld) and [pyld](https://github.com/digitalbazaar/pyld) libaries to parse & serialize owl ontology | ||
to jsonld with the `@context.` | ||
|
||
To generate JSON-LD voabulary: | ||
```python | ||
python npl_vocab/vocab_generator.py | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters