Skip to main content

SKOS converter for RDFS/OWL/SKOS vocabularies.

Project description

https://badge.fury.io/py/skosify.svg https://travis-ci.org/NatLibFi/Skosify.svg?branch=master https://readthedocs.org/projects/skosify/badge/?version=latest https://codecov.io/gh/NatLibFi/Skosify/branch/master/graph/badge.svg

Python script for converting to SKOS.

This program accepts a thesaurus-like vocabulary expressed as RDFS, OWL or SKOS as input. It produces a clean SKOS representation, which attempts to represent the input data losslessly using SKOS best practices. When given SKOS as input, it will be cleaned up, validated and enriched to follow the SKOS specification and related best practices.

Installation

Skosify requires Python 3.6+.

pip install --upgrade skosify

Usage

As command line script:

skosify myvoc.owl -o myvoc-skos.ttl --label "My Ontology"

This will read the file myvoc.owl in RDF/XML format and write SKOS file myvoc-skos.ttl in Turtle format, setting the name of the Concept Scheme to My Ontology.

Run skosify --help for more usage information.

As Python library:

import skosify  # contains skosify, config, and infer

voc = skosify.skosify('myontology.owl', label='My Ontology')
voc.serialize(destination='myontology-skos.rdf', format='xml')

rdf = Graph()
rdf.parse('myontology.owl')
config = skosify.config('owl2skos.cfg')
voc = skosify.skosify(rdf, **config)

skosify.infer.skos_related(rdf)
skosify.infer.skos_topConcept(rdf):
skosify.infer.skos_hierarchical(rdf, narrower=True)
skosify.infer.skos_transitive(rdf, narrower=True)

skosify.infer.rdfs_classes(rdf)
skosify.infer.rdfs_properties(rdf)

See the API Reference for documentation of the public API of this module. Everything not listed there might change in a future version.

Additional documentation can be found in the GitHub project wiki

Additional scripts

The scripts directory contains two additional scripts to be used together with Skosify:

  • skosify.cgi a web application to use Skosify
  • sparqldump.py a command line client to download RDF via a SPARQL endpoint

Author and Contributors

  • Osma Suominen
  • Jakob Voß
  • Dan Michael O. Heggø
  • Alex Kourijoki

See also

See background for history, related works, publications etc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for skosify, version 2.3.0
Filename, size File type Python version Upload date Hashes
Filename, size skosify-2.3.0.tar.gz (25.6 kB) File type Source Python version None Upload date Hashes View
Filename, size skosify-2.3.0-py2.py3-none-any.whl (23.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page