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.14.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9194992cad1343a5952206bf3ef68291d083bc69927a3bddadbed154541895a |
|
MD5 | e8c8afb5e85da005c7f5cc376a269fa9 |
|
BLAKE2b-256 | 1b0bdd6467bc1894f24930c9e20ba4716da359af576c32a0fbdd798c382efb60 |
Close
Hashes for sari_field_definitions_generator-0.2.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98a80a39f79b2c18391a20d741b6c132b9d347265c00f7f89364e69ad4cdb470 |
|
MD5 | 3be01f64dc78983a0e71ef4e24cea466 |
|
BLAKE2b-256 | bb3b8d5aa436e8be9db9094aff5fb74e85c3b8601ba7f986a1e0c63885808308 |