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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 613fe589f8208b21159d9c3ddb45cdbef587ae5f538e6712bdaa6df00653c4db |
|
MD5 | cc8000bbc801b8f0e690a9742b2b2673 |
|
BLAKE2b-256 | 551a3f144364cb2959a7ed1b69b8e037233f71cebede34f910dfc1514b74adcd |
Close
Hashes for sari_field_definitions_generator-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34975ba492377406558081ff0b8e392cbb40d52955d0b5fc603b7d063a1754f7 |
|
MD5 | 087a7f6e61c55250412c9fb4ef5de49e |
|
BLAKE2b-256 | 9569569fe11f82680ac0d0705202c1f8196f63cd3f2fb1b7f2f7d2a9cb4074fe |