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}'
- ...
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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9722c9dbb8bd98f675fb963b6ba6091052272f0bd88bda90d148936b8a1a785f |
|
MD5 | 168e97189a466987696ee0d1cd32effb |
|
BLAKE2b-256 | 0dd8ba1834fc591712c09ed8d5cd5b75dadc166753ca273ec4efceb03da06591 |
Close
Hashes for sari_field_definitions_generator-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d043aab9d2102e78bf7b8792d57fb93f1e1dd57ae284bb05f4581001cf2a661 |
|
MD5 | 22f814a5eeafb26a09c405dfb8099a98 |
|
BLAKE2b-256 | f0be5ef3baadecae0d2b8c31802b9189a6609bacedad3152638d09dc57a7fc2f |