Skip to main content

A SDMX in RDF Turtle 1.1 format parser to generate valid JSON-LD and send to FIWARE Context Brokers using ETSI NGSI-LD.

Project description

SDMX to JSON-LD Parser

Stable Version Issues Apache2.0 License Python Versions Package Status LinkedIn


Logo

SDMX (Turtle) to NGSI-LD (JSON-LD) converter

A SDMX to JSON-LD parser to communicate with FIWARE Context Brokers using ETSI NGSI-LD.
Explore the docs »

View Demo · Report Bug · Request Feature

About The Project

A SDMX in RDF Turtle 1.1 format parser to generate valid JSON-LD and send to FIWARE Context Brokers using ETSI NGSI-LD.

It is based on a EBNF LALR(1) grammar.

This project is part of INTERSTAT. For more information about the INTERSTAT Project, please check the url https://cef-interstat.eu.

(back to top)

Dependencies

The dependencies of the sdmx2jsonld python package are the following:

For more details about the versions of each library, please refer to requirements.txt.

(back to top)

Installing SDMX2JSON-LD and Supported Versions

SDMX2JSON-LD is available on PyPI:

$ python -m pip install sdmx2jsonld

SDMX2JSON-LD officially supports Python 3.10+.

(back to top)

Usage

To execute the python module you can follow the following code to parse the RDF Turtle file to generate the JSON-LD content to be sent to the FIWARE Context Broker:

from sdmx2jsonld.transform.parser import Parser
from sdmx2jsonld.exceptions import UnexpectedEOF, UnexpectedInput, UnexpectedToken

file_in = open("structures-accounts.ttl")
generate_files = True

# Start parsing the file
my_parser = Parser()

try:
    my_parser.parsing(content=file_in, out=generate_files)
except UnexpectedToken as e:
    print(e)
except UnexpectedInput as e:
    print(e)
except UnexpectedEOF as e:
    print(e)

Where:

  • file_in is the RDF Turtle content that can be a string in StringIO class or a read file in TextIOWrapper class.
  • file_out is a boolean variable to indicate if we want to save the JSON-LD parser content into files (True) or we want to show the content in the screen (False).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Contact

Fernando López - @flopezaguilar - fernando.lopez@fiware.org

Project Link: https://github.com/flopezag/IoTAgent-Turtle

(back to top)

License

Distributed under the Apache2.0 License. See LICENSE for more information.

(back to top)

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

sdmx2json_ld-1.0.0.tar.gz (39.0 kB view details)

Uploaded Source

Built Distribution

sdmx2json_ld-1.0.0-py3-none-any.whl (89.4 kB view details)

Uploaded Python 3

File details

Details for the file sdmx2json_ld-1.0.0.tar.gz.

File metadata

  • Download URL: sdmx2json_ld-1.0.0.tar.gz
  • Upload date:
  • Size: 39.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/6.2.0-10014-tuxedo

File hashes

Hashes for sdmx2json_ld-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1154f3db71293b2d875a8d0e914c9df9609ff3d3d0e4617010a02107bec40677
MD5 f3937cb0cfed21249bf6621f09a2fcd8
BLAKE2b-256 2b22fe4e295f3e5c66acddc66dd7519fd1472b7c3c29a6dbf3e83f333da7d858

See more details on using hashes here.

File details

Details for the file sdmx2json_ld-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: sdmx2json_ld-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 89.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/6.2.0-10014-tuxedo

File hashes

Hashes for sdmx2json_ld-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d3be8d49109a64845466e5452057c561152c6dfbf512405d64a42b746e71eae
MD5 caad2fe5b43496b0b10364fb2f09a90b
BLAKE2b-256 8560db16d97fdd7f051169ad75fe1e3fcd313890443cf9fd4ae53a2a1899eff5

See more details on using hashes here.

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