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.19.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47149f8eabb065a0610957611f8ae851e197f7bd70f83f6dd4eb4fb3cf6502eb |
|
MD5 | e20fcfac7e8811792ed7f0ed725479ed |
|
BLAKE2b-256 | 8b184687587f3c123d5f95f75c8beb4ca46aab4a5751488e824a2cc4f16cebc1 |
Close
Hashes for sari_field_definitions_generator-0.2.19-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 376a55362ed1516fa536d32f717c04f3ee79fde6fcaec4e9088d1ff9bfa42402 |
|
MD5 | b5d91f9b75c1d0a93714da49da7dc22e |
|
BLAKE2b-256 | 42eed90b45c5a2c72bb392128ce783c94afbf20038a6415ba11997bb2343d95a |