A generator for Field Definitions for ResearchSpace and Metaphacts
Project description
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
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 sari-field-definitions-generator-0.2.19.tar.gz.
File metadata
- Download URL: sari-field-definitions-generator-0.2.19.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47149f8eabb065a0610957611f8ae851e197f7bd70f83f6dd4eb4fb3cf6502eb
|
|
| MD5 |
e20fcfac7e8811792ed7f0ed725479ed
|
|
| BLAKE2b-256 |
8b184687587f3c123d5f95f75c8beb4ca46aab4a5751488e824a2cc4f16cebc1
|
File details
Details for the file sari_field_definitions_generator-0.2.19-py3-none-any.whl.
File metadata
- Download URL: sari_field_definitions_generator-0.2.19-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
376a55362ed1516fa536d32f717c04f3ee79fde6fcaec4e9088d1ff9bfa42402
|
|
| MD5 |
b5d91f9b75c1d0a93714da49da7dc22e
|
|
| BLAKE2b-256 |
42eed90b45c5a2c72bb392128ce783c94afbf20038a6415ba11997bb2343d95a
|