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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13e0f17aa7bb3fcd977daeb4f5bc41e8171beb541a3306322a1fa732f9ca52dd |
|
MD5 | a24744fe9fb8868a885182b333b93db6 |
|
BLAKE2b-256 | ae757a710e3c53c9b13543ad5d1483aa96e062ba114f49ae247ee98600ae49bc |
Close
Hashes for sari_field_definitions_generator-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9c66a64764153d34be70c3e107a1167d002a9da7f8a1a8dc2ed8b99359070b3 |
|
MD5 | 143dbee3c490364afc5a2f991c2f596f |
|
BLAKE2b-256 | d39ba2edc205e4017492dc122a1c0e04a3676d7766a437e3795c89c1f69a9c13 |