The Plinian Core vocabulary is a standard data model designed to share biological species level information. It is developped as an XML schema (XSD).
The Plinian Core ontology is a representation the XSD PlinianCore data model as an OWL ontology, to be used in RDF-based knowledge graphs.
This repository is a Python application that transtlates the Plinian Core XML schema into an OWL ontology. The output format is RDF Turtle.
The documentation of the ontology is deployed on the Github pages of this repository.
The WebVOWL only interface is accessible from this page.
WARNING: this is an on-going work, the generated ontology may change at any time.
This repository relies on Conda to manage the execution environment.
File environment.yml defines an environment named plic2owl.
- Install Conda
- Set up and activate the environment:
conda env create -f environment.yml
conda activate plic2owl- Run the translation of the currently available Plinian Core schema:
cd app
python ./main.py \
https://raw.githubusercontent.com/tdwg/PlinianCore/master/xsd/abstract%20models/stable%20version/PlinianCore_AbstractModel_v3.2.2.7.xsd \
--copy schemas \
--output ../ontology/plic_ontology.ttlFirst CD to directory app.
Script main.py runs the translation. It takes a local path or a URL of the XML schema to translate, for instance:
python ./main.py /home/user/plic/PlinianCore.xsdor
python ./main.py https://myserver.org/plic/PlinianCore.xsdAt each invocation, this will download the XML schema as well as all the imported schemas.
To save time and bandwidth, add option --copy to store the downloaded schemas to a local directory.
python ./main.py /home/user/plic/PlinianCore.xsd --copy schemasAt subsequent invocations, the XSD files will be read from directory schemas. You may run the same command again or keep only the base name of the schema:
python ./main.py PlinianCore.xsd --copy schemasBy default, the generated RDF triples are printed out on the standard output. You may change this with option --output:
python ./main.py PlinianCore.xsd --copy schemas --output ../ontology/ontology.ttlEdit file config/default_config.yml to change the default namespace of imported XSD components (used when loaded XSDs do not mention a target namespace), and the namespaces for which we want to generate RDF terms.
You may specify an alternate configuration file with option --config:
python ./main.py https://myserver.org/plic/PlinianCore.xsd --copy schemas --config ../config/config_plic.ymlFile config/logging.yml configures the application logger.
By default the target is the standard output, and the log level is WARNING. See the logging API documentation for customization.