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.

Source Distribution

skosify-2.3.0.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

skosify-2.3.0-py2.py3-none-any.whl (23.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file skosify-2.3.0.tar.gz.

File metadata

  • Download URL: skosify-2.3.0.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for skosify-2.3.0.tar.gz
Algorithm Hash digest
SHA256 012beee78f23038edbb5783f7163afb3fedd2d8a0b68cfc2408566df59bb5611
MD5 b1af1867245cd1051d6821dd9c2dead8
BLAKE2b-256 c761066294d0711ddf554e67e8185006b9e67530e59f11f96a3e9120ac3ff148

See more details on using hashes here.

File details

Details for the file skosify-2.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: skosify-2.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for skosify-2.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c147043c2abe9ca64489eca0f8a5ca891b84118d298027e40287bdd6819668d4
MD5 a03323799fe29395a105b4cd44c8d91d
BLAKE2b-256 b65f8bb413d47d091d7f0ee3940a7429daf82a54a68a89ca3f295b8e7b8d48fb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page