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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b9d15b40e17cb5d020c06bf1a99e0219f37c020c7c462a3586b1c75c04de7c8 |
|
MD5 | 90cb5d2bef2bae4417dc9332799952d1 |
|
BLAKE2b-256 | 0f9f314f529b2cca281ceb7512730b0dff05def3732ad58e4d9c0345c35e2b7c |
Close
Hashes for sari_field_definitions_generator-0.2.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec93cddd7e6e50c007d78cb0752f96312d7626ae3b8a6907edfd4ce7386359ce |
|
MD5 | 7ab43190c4144cdb0ad4a9af51d93755 |
|
BLAKE2b-256 | aab47c9b6bde5bcf651c123ceafdcd1b31b94ad59be2acc3b6e90b3b0860e4e7 |