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 representation
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.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaf0b4bc53906ad2374314a52fd4886b3c053ac4310532781476c98e61c692c6 |
|
MD5 | bff0ccf62618709a4ca4571940a76c1d |
|
BLAKE2b-256 | 79650af0ecf534f7206083aaba21111c0d7572ef8a623a1918efef5fa0a09474 |
Close
Hashes for sari_field_definitions_generator-0.2.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ccb34a2c573d85a60bb4eb991868e2ce9f313b6e5d1a373d09ca7709792dd26 |
|
MD5 | 08f7dcb1c603086571b585e5b20b7ce6 |
|
BLAKE2b-256 | 1792025e57275fef1a365e435292534ed5ff1054534282b16d03a3adb16eb5a8 |