Skip to main content

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)

Metadata

Release files for sdmx2json-ld 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sdmx2json-ld 1.0.0
File Size Uploaded
sdmx2json_ld-1.0.0.tar.gz 39.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sdmx2json-ld 1.0.0
File Interpreter ABI Platform
sdmx2json_ld-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 128.4 kB

Release files / sdmx2json_ld-1.0.0.tar.gz

Download URL sdmx2json_ld-1.0.0.tar.gz
Size 39.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1154f3db71293b2d875a8d0e914c9df9609ff3d3d0e4617010a02107bec40677
BLAKE2b-256 checksum
How to use checksums
2b22fe4e295f3e5c66acddc66dd7519fd1472b7c3c29a6dbf3e83f333da7d858
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.6 Linux/6.2.0-10014-tuxedo

Release files / sdmx2json_ld-1.0.0-py3-none-any.whl

Download URL sdmx2json_ld-1.0.0-py3-none-any.whl
Size 89.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d3be8d49109a64845466e5452057c561152c6dfbf512405d64a42b746e71eae
BLAKE2b-256 checksum
How to use checksums
8560db16d97fdd7f051169ad75fe1e3fcd313890443cf9fd4ae53a2a1899eff5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.6 Linux/6.2.0-10014-tuxedo

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page