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 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 dataset 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-1.0.3.tar.gz
(21.2 kB
view details)
Built Distribution
File details
Details for the file datacatalogtordf-1.0.3.tar.gz
.
File metadata
- Download URL: datacatalogtordf-1.0.3.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.3 Linux/5.3.0-1031-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2494cdd9f596963795d514c9a3e6ba47f70a5854599addeab9029c42d8bf469 |
|
MD5 | 6774d7136f2740d59a81530057b8ad6f |
|
BLAKE2b-256 | 12c4d62e3bf78b138227be915570dbb426ad17e80ea5730d0138f348a5068900 |
File details
Details for the file datacatalogtordf-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: datacatalogtordf-1.0.3-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.3 Linux/5.3.0-1031-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c6ffcd3e67ff9c5fd45e189f81c36359e0ae3ad20010767673d38b0586d2d86 |
|
MD5 | 21948bf77db50fcc03dffe9a0857a2af |
|
BLAKE2b-256 | 226c1c5d66f160503dddaf5079a456ae0f0cf7073ddc7256308d05a0b601f1c9 |