Interoperability Enabler
Project description
What is it?
Interoperability Enabler (IE) component is designed to facilitate seamless integration and interaction among various artefacts within the SEDIMARK ecosystem, including data, AI models, and service offerings.
Key Feature
- Data Formatter - Convert data from various formats into the SEDIMARK internal processing format (pandas DataFrames)
- Data Quality Annotations - Enable adding any kind of quality annotations to data inside pandas DataFrames
- Data Mapper – Convert data from pandas DataFrames into NGSI-LD json
- Data Extractor – Extract relevant data from a pandas DataFrame
- Metadata Restorer – Restore metadata to a pandas DataFrame
- Data Merger – Merge two DataFrames by matching column names
Installation
The source code can be found on GitHub at https://github.com/Sedimark/InteroperabilityEnabler.
To install the package, you can use pip:
pip install InteroperabilityEnabler
Quick Start Examples
Data Formatter (to convert the input data into a pandas DataFrame)
from InteroperabilityEnabler.utils.data_formatter import data_to_dataframe
FILE_PATH="sample.jsonld"
df = data_to_dataframe(FILE_PATH)
It recursively flattens dictionaries while preserving key hierarchies, supporting nested structures and ensuring efficient processing and interoperability.
Data Quality Annotations (to enrich pandas DataFrames by adding quality annotations)
Instance-level annotations:
from InteroperabilityEnabler.utils.annotation_dataset import add_quality_annotations_to_df
entity_type_annotation = "entity_type_value" # entity type for quality annotations
annotated_df = add_quality_annotations_to_df(
df,
entity_type = entity_type_annotation,
assessed_attrs = None,
# type = "new_type", # If there is no type in the input file, a new one can be created
# context_value = [link1, link2] # If there is no @context in the input file, a new one can be created
)
Attribut-level annotation:
from InteroperabilityEnabler.utils.annotation_dataset import add_quality_annotations_to_df
entity_type_annotation = "entity_type_value" # entity type for quality annotations
assessed_attrs = ["attribut_name"] # Base attribute name (metadata)
annotated_df = add_quality_annotations_to_df(
df, entity_type = entity_type_annotation, assessed_attrs = assessed_attrs
)
Granular-level annotation:
from InteroperabilityEnabler.utils.annotation_dataset import add_quality_annotations_to_df
entity_type_annotation = "entity_type_value" # entity type for quality annotations
assessed_attrs = ["currentTripCount[0]"] # Base attribute name (metadata) - with the indice
annotated_df = add_quality_annotations_to_df(
df, entity_type = entity_type_annotation, assessed_attrs = assessed_attrs
)
Data Mapper (to convert the DataFrame into NGSI-LD json format)
from InteroperabilityEnabler.utils.data_mapper import data_conversion, restore_ngsi_ld_structure
data = data_conversion(annotated_df)
data_restored = restore_ngsi_ld_structure(data) # to restore the original NGSI-LD structure
Data Extractor (to extract and return specific columns from a pandas DataFrame)
from InteroperabilityEnabler.utils.extract_data import extract_columns
# Select columns by index
column_indices = [5, 7]
selected_df, selected_column_names = extract_columns(df, column_indices)
print("\nSelected DataFrame:")
print(selected_df)
print("\nSelected Column Names:")
print(selected_column_names)
Metadata Restorer (to restore column names into a pandas DataFrame)
import pandas as pd
from InteroperabilityEnabler.utils.add_metadata import add_metadata_to_predictions_from_dataframe
PREDICTED_DATA = "predicted_data.csv" # example - prediction results from an AI model
predicted_df = pd.read_csv(PREDICTED_DATA, header=None)
predicted_df = add_metadata_to_predictions_from_dataframe(
predicted_df, selected_column_names
)
Data Merger (merge two DataFrames)
from InteroperabilityEnabler.utils.merge_data import merge_predicted_data
# To combine the original input data with the corresponding prediction results from an AI model
merged_df = merge_predicted_data(df, predicted_df)
Acknowledgement
This software has been developed by the Inria under the SEDIMARK(SEcure Decentralised Intelligent Data MARKetplace) project. SEDIMARK is funded by the European Union under the Horizon Europe framework programme [grant no. 101070074].
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file interoperabilityenabler-0.1.4.tar.gz.
File metadata
- Download URL: interoperabilityenabler-0.1.4.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3e82f64f5e584b32917a8741dd86806a0c4fd8b2663e15fc3ab66e59beb5fff
|
|
| MD5 |
158f15b2dcb61be7e67cbf7e9eeaed50
|
|
| BLAKE2b-256 |
8c2650cfad58d352d80c8dfb72dd8e93e1009209cd6b707d9b567f663f92e12c
|
File details
Details for the file interoperabilityenabler-0.1.4-py3-none-any.whl.
File metadata
- Download URL: interoperabilityenabler-0.1.4-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33fd7089194e893580363c39bce712db3b1560749784f2a6c9be85054168875e
|
|
| MD5 |
07c133207f213a48547e310ce6644b43
|
|
| BLAKE2b-256 |
d5aef8aec4055f32078456bc5bf3e5785b566afa5f472d75ce70ade60b2ec9bb
|