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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fb4659f5bb32f6977735a3ebc8f68ce4bc4c52db0214e284a1e667f0c8536fd |
|
MD5 | d2100070e3ba214d86d43b96c2be631d |
|
BLAKE2b-256 | cae21e8b4af82e400e93590d306e00a5f70b612817f783ec7201b7c0dd9e9886 |
Close
Hashes for sari_field_definitions_generator-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 421f34d07c94e5432c5e8258ef3952ecb3e612c627f9f88d644a2a236dd57333 |
|
MD5 | 2be546c464bf47edf3887f5c246513d0 |
|
BLAKE2b-256 | 6f751813d600dc3fa25d053dc515f0bf410217f16725a5c0aca00d5f97bf5200 |