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.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74abc591b41941775afee2060aee2fd1ed31562d5449c4ca4dc8392343ee4a04 |
|
MD5 | 3d196dc2789300641716c6a94a64a134 |
|
BLAKE2b-256 | 038b2c445fb918f24671ceb2f70998b3087b67c7739125eb3c552e2c5177ca73 |
Close
Hashes for sari_field_definitions_generator-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b62bbe8216d86db0b27372a6bd0498ce97557b6957983d931b5e75b142042c09 |
|
MD5 | 04bed7bb8c99167391772301c502e52e |
|
BLAKE2b-256 | 38e7cb006757f086996bd512009ab4b38af0d0a776c04becec7550752875279d |