A library with utils for performing Skolemization on blank nodes (RDF)
Project description
skolemizer
A library with utils for performing Skolemization on blank nodes (RDF)
W3C has a short intro to skolemization here: https://www.w3.org/2011/rdf-wg/wiki/Skolemisation
Development
Requirements
- pyenv (recommended)
- pipx (recommended)
- poetry
- nox
- nox-poetry
% pipx install poetry==1.1.6
% pipx install nox==2020.12.31
% pipx inject nox nox-poetry
Install
% git clone https://github.com/Informasjonsforvaltning/skolemizer.git
% cd skolemizer
% pyenv install 3.9.4
% pyenv local 3.9.4
% poetry install
Getting started
Remember before starting to always set the baseurl for skolemization, according to your organizations url. This can be done by setting the environment variable skolemizer_baseurl on your operation system. It can also e.g be done run time through Python's os package:
os.environ[Skolemizer.baseurl_key] = "https://www.someorganiztion.somedomain/"
If not set Skolemizer will use "http://example.com/" as base url. In order to invoke the skolemizer for ensuring identifier of rdf-nodes simply add
from skolemizer import Skolemizer
and then before rdf-serialization of a class:
if not getattr(self, "identifier", None):
self.identifier = Skolemizer.add_skolemization()
There should also be a skolemization check performed when serializing object properties.
Run all sessions
% nox
Run all tests with coverage reporting
% nox -rs tests
Debugging
You can enter into Pdb by passing --pdb
to pytest:
nox -rs tests -- --pdb
You can set breakpoints directly in code by using the function breakpoint()
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for skolemizer-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73057ad137fb2d8e301de06c3e24927b5c532bcf15ebec9c0545187a5848dc50 |
|
MD5 | bcd482fa8d4f6170c471151e640f31b5 |
|
BLAKE2b-256 | f48d3e32ca6ce21c8fbce0fdc959c05e2b8aeb3ccfe49bf2d5b944717114f21d |