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}'
- 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 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.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01ce7dbad0afd1132893a44a8a91ec6b79240314ed70c0a080e1e1751c070c0c |
|
MD5 | 6f3464b02970a8864651a0f43886f794 |
|
BLAKE2b-256 | fbbbf301c502b5551fa2577ab4febbb6f7b9b13e4654fc805010c3999f835d9c |
Close
Hashes for sari_field_definitions_generator-0.2.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6aacf4ff6ef1f3ae593e71f76c764ce80b56b382a93a2c9a08a0803e8ac0250 |
|
MD5 | b7b5761a3e60fd05563282b2692bdc4a |
|
BLAKE2b-256 | bb2c81e61e2943bd4f7459d421069494506744ba7a383ffe86182a8c873b288a |