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 details)
Built Distribution
File details
Details for the file datacatalogtordf-0.1.0a3.tar.gz
.
File metadata
- Download URL: datacatalogtordf-0.1.0a3.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.0.0-1032-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfab249c8be08cef7c54d907c96172ffc5edd17b09e2d1fc1b3e9fc19f3b5681 |
|
MD5 | 752874db321bc00d1a87373e3bb838e4 |
|
BLAKE2b-256 | 361c81def170dd52dbd9a76bf7cd3186ee9aec2077c16f6e5cc091e18a7b08bf |
File details
Details for the file datacatalogtordf-0.1.0a3-py3-none-any.whl
.
File metadata
- Download URL: datacatalogtordf-0.1.0a3-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.2 Linux/5.0.0-1032-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bf9ba1b5320acda2688d1ac51e61b2a69a8c966b123d4aa1cd1c8891387d55d |
|
MD5 | 2dc5ecf7387e32e14589e338f74be051 |
|
BLAKE2b-256 | 54b885980249fc12fdc0e3db0fdea0adb0f6eef63c199578e7b14cb15ead60a3 |