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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a12f62d0fcd43d608d8a7f33534c0db08a2c471a79fb8667b8cb75cd633d51af |
|
MD5 | ee4b3edeb4d70bd071869a976ffec5de |
|
BLAKE2b-256 | 368f909fbb5edacd946b35ee2f67417d408b8b8bd6bacfe265f63c4c4450abef |
Close
Hashes for sari_field_definitions_generator-0.2.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bc8d4840385796fb4479ff1c2895a99b6233b0e9ba9732b90ac526e8d38584b |
|
MD5 | 469679ea0ea287cb37cef2db1a4be12e |
|
BLAKE2b-256 | 0c03b2eb5ab31a800b6a24cc43e41f1da703269efe3cdb003a13a332244cf4bc |