Skip to main content

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 Platform
  • generator.RESEARCHSPACE for ResearchSpace
  • generator.UNIVERSAL for both platforms

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sari-field-definitions-generator-0.2.0.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page