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.METAPHACTS
for Metaphacts Open Source Platformgenerator.RESEARCHSPACE
for ResearchSpacegenerator.UNIVERSAL
for both platformsgenerator.JSON
for a JSON representationgenerator.INLINE
for 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
Close
Hashes for sari-field-definitions-generator-0.2.17.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6a93f947320210d51fff4b431af28fdebc2de052adaaa04158c1677fe5d6c55 |
|
MD5 | 33ea99caed309e8590bc3d49f1b535b1 |
|
BLAKE2b-256 | a5ca8a79a362eda7a3660d779bc96e7a99ea04478473a23f1970e21ed1b75f03 |
Close
Hashes for sari_field_definitions_generator-0.2.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d0acadf9795728f6e9f11843456ef46e80c88614c9ccc23a3059fd28b38edb8 |
|
MD5 | e84987775c2be5ff0d6653b46efa831c |
|
BLAKE2b-256 | 6ec4c928cc20757cb5581607288d3a4a5d6bea5c29eead7d5da82523bf10f2a5 |