SARI Field Definitions Generator
A generator for Metaphacts/ResearchSpace field definitions
Installations
install using pip
pip install sari-field-definitions-generator
Usage
Define field definitions as a Python dict or in an external yaml file:
prefix: http://rs.swissartresearch.net/instances/fields/
fields:
- id: {unique identifier}
label: {label}
description: {description}
dataType: {datatype}
domain: {domain}
range: {range}
minOccurs: #
maxOccurs: #
queries:
- ask: '{ask query}'
- delete: '{delete query}'
- insert: '{insert query}'
- select: '{select query}'
- valueSet: '{value set query}'
- ...
Then, load and compile it using the generator
from sariFieldDefinitionsGenerator import generator
inputFile = './fieldDefinitions.yml'
outputFile = '../ldp/assets/fieldDefinitions.trig'
model = generator.loadSourceFromFile(inputFile)
output = generator.generate(model, generator.METAPHACTS)
with open(outputFile, 'w') as f:
f.write(output)
Available templates are:
generator.METAPHACTSfor Metaphacts Open Source Platformgenerator.RESEARCHSPACEfor ResearchSpacegenerator.UNIVERSALfor both platformsgenerator.JSONfor a JSON representationgenerator.INLINEfor a Backend Template version
Release files for sari-field-definitions-generator 0.2.19
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sari-field-definitions-generator-0.2.19.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sari_field_definitions_generator-0.2.19-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.6 kB
Release files / sari-field-definitions-generator-0.2.19.tar.gz
| Download URL | sari-field-definitions-generator-0.2.19.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47149f8eabb065a0610957611f8ae851e197f7bd70f83f6dd4eb4fb3cf6502eb
|
|
BLAKE2b-256 checksum How to use checksums |
8b184687587f3c123d5f95f75c8beb4ca46aab4a5751488e824a2cc4f16cebc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1
|
Release files / sari_field_definitions_generator-0.2.19-py3-none-any.whl
| Download URL | sari_field_definitions_generator-0.2.19-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
376a55362ed1516fa536d32f717c04f3ee79fde6fcaec4e9088d1ff9bfa42402
|
|
BLAKE2b-256 checksum How to use checksums |
42eed90b45c5a2c72bb392128ce783c94afbf20038a6415ba11997bb2343d95a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1
|