Skip to content

Haigutus/triplets

Repository files navigation

About:

  • Parses CIM RDF/XML data to pandas dataframe with 4 columns [ID, KEY, VALUE, INSTANCE_ID] (triplestore like)
  • The solution does not care about CIM version nor namespaces
  • Input files can be xml or zip files (containing one or mutiple xml files)
  • All files are parsed into one and same Pandas DataFrame, thus if you want single file or single data model, you need to filter on INSTANCE_ID column

Documentation:

https://haigutus.github.io/triplets

To get started:

python -m pip install triplets
import pandas
import triplets

path = "CGMES_v2.4.15_RealGridTestConfiguration_v2.zip"
data = pandas.read_RDF([path])

Result:

image

You can then query a dataframe of all same type elements and its parameters across all [EQ, SSH, TP, SV etc.] instance files, where parameters are columns and index is object ID-s

data.type_tableview("ACLineSegment")

image

Export:

data.export_to_cimxml(
    rdf_map=schemas.ENTSOE_CGMES_2_4_15_552_ED1,
    export_type=ExportType.XML_PER_INSTANCE_ZIP_PER_XML,
)

Look into examples folders for more

About

Import and export XML/RDF to pandas dataframe

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages