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 sariFieldDefinitionsGenerator
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}'
- ...
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 platforms
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb983a78ab496a1408a203f743f0a275e2bdbde0131a7b1e332da2e29e9bb2b9 |
|
MD5 | 06839ed7ddd8728e49f112731216e6ea |
|
BLAKE2b-256 | d3ab45c54711f5c2a03fbd08e340c5a4392a959de9ba98a9880700d905a5be85 |
Close
Hashes for sari_field_definitions_generator-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a5ec630f09037bf4f4ed6cb80c5673f944698c1643c798518fb9f9b36dbc39e |
|
MD5 | dfcc7017effc3ce8c4266d0284335b62 |
|
BLAKE2b-256 | 2e0302a76919837bf96b6f7ed954d3ac97918d00426321bbd022425c92c8947c |