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.16.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67a2a8e9baf76103ecd7ece388ee400999a4b9cb8d7017e43587fe8e889f3c40 |
|
MD5 | 7cbbd50b1dc98e6a9dd883741e1d4397 |
|
BLAKE2b-256 | 72d16430e9819a6124e53ca87eccd155d4530787841308ee29ae7bca17a0bb89 |
Close
Hashes for sari_field_definitions_generator-0.2.16-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 486eae8f3078aa7f6ee05316507e6d04163d1078759da590fc8627000b5d44e3 |
|
MD5 | 41fe8b03766b3f2069c4161db050576c |
|
BLAKE2b-256 | 919bbbcd72676d4ddbc38acba137c4678af228b1bfd7f71c724c706c10c24caf |