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.13.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | af84f9239f7812d0d361f7a85d31598ed01d0073c572f7b505c266480d3246f2 |
|
MD5 | 6b537ff6babba9d20604c7848b2c51ae |
|
BLAKE2b-256 | 2c3d1b676fc52d57f49ad5577650e51ad1b0c4b5061846468ad107fc2b1c2fed |
Close
Hashes for sari_field_definitions_generator-0.2.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9d87b096b3fcffc54c02757e016cf4373e27c2f5fb6955335961a1bfb6d73c0 |
|
MD5 | 65e98aaed2477cdb6fd23a47c0d9615c |
|
BLAKE2b-256 | e5577229d928c5534b3f1c303b99133b20107c15653c691c8d417fb43d789bfc |