A library for mapping a data catalog to rdf
Project description
datacatalogtordf
A small Python library for mapping a data catalog to rdf
The library contains helper classes for the following dcat classes:
Other relevant classes are also supported, such as:
- Contact vcard:Kind
The library will map to the Norwegian Application Profile of the DCAT standard.
Usage
Install
% pip install datacatalogtordf
Getting started
from datacatalogtordf.catalog import Catalog, Dataset
# Create catalog object
catalog = Catalog()
catalog.identifier = "http://example.com/catalogs/1"
catalog.title = {"en": "A dataset catalog"}
catalog.publisher = "https://example.com/publishers/1"
# Create a dataset:
dataset = Dataset()
dataset.identifier = "http://example.com/datasets/1"
dataset.title = {"nb": "inntektsAPI", "en": "incomeAPI"}
#
# Add concept to catalog:
catalog.datasets.append(dataset)
# get rdf representation in turtle (default)
rdf = catalog.to_rdf()
print(rdf.decode())
Development
Requirements
Install
% git clone https://github.com/Informasjonsforvaltning/datacatalogtordf.git
% cd datacatalogtordf
% pyenv install 3.8.2
% pyenv install 3.7.6
% pyenv local 3.8.2 3.7.6
% poetry install
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
datacatalogtordf-0.1.0a3.tar.gz
(10.5 kB
view hashes)
Built Distribution
Close
Hashes for datacatalogtordf-0.1.0a3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bf9ba1b5320acda2688d1ac51e61b2a69a8c966b123d4aa1cd1c8891387d55d |
|
MD5 | 2dc5ecf7387e32e14589e338f74be051 |
|
BLAKE2b-256 | 54b885980249fc12fdc0e3db0fdea0adb0f6eef63c199578e7b14cb15ead60a3 |