A library for mapping a modelldcatno model to rdf
Project description
modelldcatnotordf
A small Python library for mapping a modell catalog to rdf
The library contains helper classes for the following modelldcat-ap-no classes:
The library will map to the Norwegian Application Profile.
Usage
Install
% pip install modelldcatnotordf
Getting started
from datacatalogtordf import Catalog
from modelldcatnotordf import InformationModel
# Create catalog object
catalog = Catalog()
catalog.identifier = "http://example.com/catalogs/1"
catalog.title = {"en": "A model catalog"}
catalog.publisher = "https://example.com/publishers/1"
# Create a model:
model = InformationModel()
model.identifier = "http://example.com/models/1"
model.description = {"nb": "En adressemodell"}
# ... and further attributes ...
#
# Add model to catalog:
catalog.model.append(model)
# get rdf representation in turtle (default)
rdf = catalog.to_rdf()
print(rdf.decode())
Development
Requirements
- python3
- pyenv
- [pipx] (https://github.com/pipxproject/pipx)
- poetry
- nox
% pipx install poetry==1.0.5
% pipx install nox==2020.8.22
% pipx inject nox nox-poetry
Install
% git clone https://github.com/Informasjonsforvaltning/modelldcatnotordf.git
% cd modelldcatnotordf
% pyenv install 3.8.6
% pyenv install 3.7.9
% pyenv local 3.8.6 3.7.9
% 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file modelldcatnotordf-1.0.8.tar.gz.
File metadata
- Download URL: modelldcatnotordf-1.0.8.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.5 Linux/5.8.0-1033-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd4e4ab37c5a43064cbd2c3ff5aef4c4d89a135c3494235bfb9bba7e75e2eed5
|
|
| MD5 |
be2884804249339d14c3eb20ef65587c
|
|
| BLAKE2b-256 |
b5e84f653d609bf871ce94b5534e3d24cfdad0c7069ffdd3ebf9cfe334212ec8
|
File details
Details for the file modelldcatnotordf-1.0.8-py3-none-any.whl.
File metadata
- Download URL: modelldcatnotordf-1.0.8-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.5 Linux/5.8.0-1033-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6c3b19f9c4ed6d6c9db0409e5ede08824c731e4784c06b2d9f7668fa0522b7f
|
|
| MD5 |
c5781918ad59cbafaba10150a01068af
|
|
| BLAKE2b-256 |
cd0036556531a43ad0c095d8b4cb3453aca4975300e760379f8201bbfbd5cabf
|