A tool to support round-tripping between modular and flattened versions of profiles of data models expressed using OWL, JSON-Schema, SHACL etc.
Generates HTML for Ontology and Profile views using pyLODE
ProfileWiz uses the W3C Profiles Vocabulary to both accept configuration and output documentation of locations of various different views of data model profiles used and generated by different operating modes.
Profiles document the way external ontologies are used in specific circumstances. Please read the section on "Namespaces and Ontology identification"
In development, focussed on Use Case 1.
Does a reasonable job of extracting profiles for referenced namespaces and generating JSON-LD contexts.
JSON schema yet to be tested.
Needs to allow owl:import and prof:isProfile of to override namespace to handle cases where ontologies are available, but not from the namespace URI. (this can be handled with an explicit profiles catalogue however)
Examples and test cases in development too.
Clone this repository.
run python path/to/dir/profilewiz/profilewiz.py --help
or to install as a editable module
pip install -e
run python -m profilewiz
TODO: register as pip downloadable package.
Profilewiz builds profiles and implementing resources using external resources. Often these resources are not immediately available by dereferencing namespace declarations or OWL imports. A "profiles catalog" can be specified to identify local copies of ontologies and, if required, specific profiles of these ontologies to use.
Typical usage with a local library of ontologies, run from a separate directory at the same level as a directory with models to profile:
python.exe /repos/misc/profilewiz/profilewiz/profilewiz.py -n --all -x -p=lib/profile_cat.ttl ../models/*.ttl
usage: profilewiz.py [-h] [-o [OUTPUT]] [-q] [-c] [-ho] [-hp] [-r]
[-p P [P ...]] [-a] [-i [INIT_LIB]]
input
Create JSON context, schema and other views of an ontology
positional arguments:
input input file containing ontology in TTL format
optional arguments:
-h, --help show this help message and exit
-o [OUTPUT], --output [OUTPUT]
output file
-q, --qnames_only use qnames only for JSON elements
-c, --choose-class Choose a main Class object to create structural
schema. Properties defined but not used are assumed to
be allowable properties of main Class
-ho, --html_owl If set generate HTML for output OWL file, if present
then do not perform analysis functions.
-hp, --html_prof If set generate HTML for output Profile description,
if present then do not perform analysis functions.
-r, --force_relative use relative filenames and cached copies for imports
-p P [P ...], --profiles P [P ...]
file name or URL of profiles model with pre-configured
resource locations
-a, --ask Ask for filenames and URI locations for imports not
present in lib or cache
-i [INIT_LIB], --init_lib [INIT_LIB]
Initialise or update profile library and profile
catalog with used namespaces using first named profile
catalog
Namespaces and Ontology identification
There is a loose coupling between a range of related concepts:
Namespaces are typically similar to Ontology URI, with the addition of a joiner ("/" or "#"), although some Ontologies may have URIs already ending in such joiners. Ideally both Namespace and Ontology URIs resolve to the same definitive OWL artefact.
Typical assumptions used by ProfileWiz, reflecting the unwritten rules (an assumed Best Pactice) for ontology publishing:
So the challenge is to map objects discovered in a profile to the underlying Ontology that defines it. This is done in the following order:
Presence of object's namespace in a profile catalog - containing, per Ontology:
To simplify processing and document assumptions, ProfileWiz provides an interactive mode to build a profile catalog and declare intended profiling relationships, which is used as the definitive solution and part of provenance documentation for profile processing.
Overriding and handling ambiguous short-names in JSONIf two ontologies define objects with the same qname in different namespaces A:X and B:X - then using the -q option would create JSON attributes "X" for each. This can be handled by an override using a CSV file with three columns:
URI,LocalName,Renamed
<http://xmlns.com/foaf/0.1/Person>,Person,Dude
<> around URIs is optional
This tool and its code are licensed using the Creative Commons CC-BY 4.0 license. See the LICENSE file in this repo for the deed.
This software has been supported through the participation of the OpenGeospatial Consortium in the European Union’s Horizon 2020 research and innovation programme projects CYBELE (Grant Agreement No 825355) and DEMETER (Grant Agreement No 857202)
This project encourages contributions and collaboration! Please create Issues for the code or, better, Pull Requests to enhance function. Contributions will be recognised in release notes and other documetation.
For more information on contributing, please contact us via the Contact details below.
Please submit issues if required.
Author: Rob Atkinson Senior Research Engineer Open Geospatial Consortium ratkinson - "at" - ogc.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3