triplets 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- triplets-0.0.3/MANIFEST.in +2 -0
- triplets-0.0.3/PKG-INFO +46 -0
- triplets-0.0.3/README.md +32 -0
- triplets-0.0.3/setup.cfg +12 -0
- triplets-0.0.3/setup.py +27 -0
- triplets-0.0.3/triplets/__init__.py +6 -0
- triplets-0.0.3/triplets/_version.py +21 -0
- triplets-0.0.3/triplets/cgmes_tools.py +623 -0
- triplets-0.0.3/triplets/rdf_parser.py +990 -0
- triplets-0.0.3/triplets/rdfs_tools.py +256 -0
- triplets-0.0.3/triplets.egg-info/PKG-INFO +46 -0
- triplets-0.0.3/triplets.egg-info/SOURCES.txt +15 -0
- triplets-0.0.3/triplets.egg-info/dependency_links.txt +1 -0
- triplets-0.0.3/triplets.egg-info/requires.txt +3 -0
- triplets-0.0.3/triplets.egg-info/top_level.txt +1 -0
- triplets-0.0.3/versioneer.py +1822 -0
triplets-0.0.3/PKG-INFO
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: triplets
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: Simple RDF tools to load/modify/export RDF data using Pandas DataFrames
|
|
5
|
+
Home-page: https://github.com/Haigutus/rdf_tools
|
|
6
|
+
Author: Kristjan Vilgo
|
|
7
|
+
Author-email: kristjan.vilgo@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Description: # RDF parser:
|
|
10
|
+
|
|
11
|
+
- Parses CIM RDF/XML data to pandas dataframe with 4 columns [ID, KEY, VALUE, INSTANCE_ID] (triplestore like)
|
|
12
|
+
- The solution does not care about CIM version nor namespaces
|
|
13
|
+
- Input files can be xml or zip files (containing one or mutiple xml files)
|
|
14
|
+
- 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
|
|
15
|
+
|
|
16
|
+
## To get started:
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
import pandas
|
|
20
|
+
from triplets import rdf_parser
|
|
21
|
+
|
|
22
|
+
path = "CGMES_v2.4.15_RealGridTestConfiguration_v2.zip"
|
|
23
|
+
data = pandas.read_RDF([path])
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Result:
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
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
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
data.type_tableview("ACLineSegment")
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
Look into examples folders for more
|
|
41
|
+
|
|
42
|
+
Platform: UNKNOWN
|
|
43
|
+
Classifier: Programming Language :: Python :: 3
|
|
44
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
45
|
+
Classifier: Operating System :: OS Independent
|
|
46
|
+
Description-Content-Type: text/markdown
|
triplets-0.0.3/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# RDF parser:
|
|
2
|
+
|
|
3
|
+
- Parses CIM RDF/XML data to pandas dataframe with 4 columns [ID, KEY, VALUE, INSTANCE_ID] (triplestore like)
|
|
4
|
+
- The solution does not care about CIM version nor namespaces
|
|
5
|
+
- Input files can be xml or zip files (containing one or mutiple xml files)
|
|
6
|
+
- 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
|
|
7
|
+
|
|
8
|
+
## To get started:
|
|
9
|
+
|
|
10
|
+
```python
|
|
11
|
+
import pandas
|
|
12
|
+
from triplets import rdf_parser
|
|
13
|
+
|
|
14
|
+
path = "CGMES_v2.4.15_RealGridTestConfiguration_v2.zip"
|
|
15
|
+
data = pandas.read_RDF([path])
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Result:
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
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
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
data.type_tableview("ACLineSegment")
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
Look into examples folders for more
|
triplets-0.0.3/setup.cfg
ADDED
triplets-0.0.3/setup.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from setuptools import setup
|
|
2
|
+
import versioneer
|
|
3
|
+
|
|
4
|
+
with open("README.md", "r") as fh:
|
|
5
|
+
long_description = fh.read()
|
|
6
|
+
|
|
7
|
+
setup(
|
|
8
|
+
name='triplets',
|
|
9
|
+
version=versioneer.get_version().split("+")[0],
|
|
10
|
+
cmdclass=versioneer.get_cmdclass(),
|
|
11
|
+
packages=['triplets'],
|
|
12
|
+
long_description=long_description,
|
|
13
|
+
long_description_content_type="text/markdown",
|
|
14
|
+
url='https://github.com/Haigutus/rdf_tools',
|
|
15
|
+
license='MIT',
|
|
16
|
+
author='Kristjan Vilgo',
|
|
17
|
+
author_email='kristjan.vilgo@gmail.com',
|
|
18
|
+
description='Simple RDF tools to load/modify/export RDF data using Pandas DataFrames',
|
|
19
|
+
install_requires=[
|
|
20
|
+
"pandas", "lxml", 'aniso8601',
|
|
21
|
+
],
|
|
22
|
+
classifiers=[
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"License :: OSI Approved :: MIT License",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
]
|
|
27
|
+
)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
# This file was generated by 'versioneer.py' (0.18) from
|
|
3
|
+
# revision-control system data, or from the parent directory name of an
|
|
4
|
+
# unpacked source archive. Distribution tarballs contain a pre-generated copy
|
|
5
|
+
# of this file.
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
|
|
9
|
+
version_json = '''
|
|
10
|
+
{
|
|
11
|
+
"date": "2023-03-23T07:38:57+0200",
|
|
12
|
+
"dirty": false,
|
|
13
|
+
"error": null,
|
|
14
|
+
"full-revisionid": "d089c47c71cfe645bfa08117dd5378f52bc99502",
|
|
15
|
+
"version": "0.0.3"
|
|
16
|
+
}
|
|
17
|
+
''' # END VERSION_JSON
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_versions():
|
|
21
|
+
return json.loads(version_json)
|