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 2.7 or 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.2.0.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: skosify-2.2.0.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for skosify-2.2.0.tar.gz
Algorithm Hash digest
SHA256 75455be9191c79de425899962bf80f2b320847c6e10c4efc288b331171b91f7b
MD5 a9f5355fc6b1dceb563b372ea6619663
BLAKE2b-256 917ac0e41f0f1af52e83a0a14d2de9e6e1947ddea7c29d9528425b6e5b489dc9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: skosify-2.2.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.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for skosify-2.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 54d83ef19649abcda784bcf532a014ab2e4c61b0f80ec1d6b529f352cacc66f5
MD5 240964cdd616e30e93c98664507f6f99
BLAKE2b-256 238ca7ba323dd480100d24e7baf60561301e4c08a9904118fd166d7783265a1a

See more details on using hashes here.

Supported by

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