SDMX to JSON-LD Parser
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.
Dependencies
The dependencies of the sdmx2jsonld python package are the following:
- Lark - a modern general-purpose parsing library for Python.
- hi-dateinfer - a python library to infer date format from examples.
- Loguru - a library which aims to bring enjoyable logging in Python.
- Requests - an elegant and simple HTTP library for Python, built for human beings.
- RDFLib - a pure Python package for working with RDF.
For more details about the versions of each library, please refer to requirements.txt.
Installing SDMX2JSON-LD and Supported Versions
SDMX2JSON-LD is available on PyPI:
$ python -m pip install sdmx2jsonld
SDMX2JSON-LD officially supports Python 3.10+.
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_inis the RDF Turtle content that can be a string in StringIO class or a read file in TextIOWrapper class.file_outis 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).
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Contact
Fernando López - @flopezaguilar - fernando.lopez@fiware.org
Project Link: https://github.com/flopezag/IoTAgent-Turtle
License
Distributed under the Apache2.0 License. See LICENSE for more information.
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sdmx2json_ld-1.0.0.tar.gz | 39.0 kB | Without provenance | Details for sdmx2json_ld-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sdmx2json_ld-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for sdmx2json_ld-1.0.0-py3-none-any.whl |
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
|
Security for sdmx2json-ld 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.