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 sari-field-definitions-generator

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

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.13.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file sari-field-definitions-generator-0.2.13.tar.gz.

File metadata

  • Download URL: sari-field-definitions-generator-0.2.13.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for sari-field-definitions-generator-0.2.13.tar.gz
Algorithm Hash digest
SHA256 af84f9239f7812d0d361f7a85d31598ed01d0073c572f7b505c266480d3246f2
MD5 6b537ff6babba9d20604c7848b2c51ae
BLAKE2b-256 2c3d1b676fc52d57f49ad5577650e51ad1b0c4b5061846468ad107fc2b1c2fed

See more details on using hashes here.

File details

Details for the file sari_field_definitions_generator-0.2.13-py3-none-any.whl.

File metadata

  • Download URL: sari_field_definitions_generator-0.2.13-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for sari_field_definitions_generator-0.2.13-py3-none-any.whl
Algorithm Hash digest
SHA256 d9d87b096b3fcffc54c02757e016cf4373e27c2f5fb6955335961a1bfb6d73c0
MD5 65e98aaed2477cdb6fd23a47c0d9615c
BLAKE2b-256 e5577229d928c5534b3f1c303b99133b20107c15653c691c8d417fb43d789bfc

See more details on using hashes here.

Supported by

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