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.15.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ab0365f21598894a5ee74134eb110f3880dd86272966ae658260a4ce0a531d1 |
|
MD5 | 3cc12db9cabfc91b40562ef7532ef794 |
|
BLAKE2b-256 | 8fcbdfa01cd1c321d7f1d81fab2ad5fd4174f348bec11dba099316f314a4df53 |
Close
Hashes for sari_field_definitions_generator-0.2.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 854c2ef0141fee6248b1c768f659241146d86de2a607b5279b4970d042f54100 |
|
MD5 | ca83a51579be5f3f201631e0fa11673a |
|
BLAKE2b-256 | ef0a5bb372e33553508140bd8fafd37dc7c700d0902a1a09c106778476db3745 |