data2rdf 2.4.0.dev1__tar.gz → 2.4.2__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.
- data2rdf-2.4.2/PKG-INFO +119 -0
- data2rdf-2.4.2/README.md +98 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/config.py +1 -1
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/models/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/models/base.py +5 -4
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/models/graph.py +37 -24
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/models/mapping.py +13 -4
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/models/utils.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/modes/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/parsers/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/parsers/base.py +30 -27
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/parsers/csv.py +52 -46
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/parsers/excel.py +42 -44
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/parsers/json.py +112 -70
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/parsers/utils.py +32 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/pipelines/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/pipelines/main.py +51 -32
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/qudt/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/qudt/utils.py +2 -2
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/utils.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/warnings.py +0 -0
- data2rdf-2.4.2/data2rdf.egg-info/PKG-INFO +119 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf.egg-info/SOURCES.txt +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf.egg-info/dependency_links.txt +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf.egg-info/requires.txt +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf.egg-info/top_level.txt +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/setup.cfg +1 -1
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_empty_rows/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_empty_rows/output/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_empty_rows/test_parser.py +7 -7
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_empty_rows/test_pipeline.py +8 -8
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_pipeline_test/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_pipeline_test/input/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_pipeline_test/test_parser.py +83 -23
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_pipeline_test/test_pipeline.py +124 -14
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_without_header/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_without_header/input/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_without_header/input/data/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_without_header/input/data/test.csv +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_without_header/input/mapping/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_without_header/output/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_without_header/test_parser.py +7 -7
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/csv_without_header/test_pipeline.py +8 -8
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/dict_custom_properties/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/dict_custom_properties/test_pipeline.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/json_custom_relations/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/json_custom_relations/test_json_custom_relations.py +84 -2
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/json_multiple_iris/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/json_multiple_iris/test_multiple_iris.py +73 -1
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/json_pipeline_test/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/json_pipeline_test/test_parser.py +16 -10
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/json_pipeline_test/test_pipeline.py +16 -10
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/test_models.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/utils.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/xls_custom_relations/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/xls_custom_relations/test_xlsx_custom_relations.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/xls_pipeline_test/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/xls_pipeline_test/test_parser.py +56 -20
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/abox/xls_pipeline_test/test_pipeline.py +143 -12
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/csv_pipeline_test/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/csv_pipeline_test/test_parser.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/csv_pipeline_test/test_pipeline.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/explicit_datatypes/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/explicit_datatypes/test_explicit_datatypes.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/json_pipeline_test/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/json_pipeline_test/test_parser.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/json_pipeline_test/test_pipeline.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/json_pipeline_test/test_title_exclusion.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/xls_pipeline_test/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/xls_pipeline_test/test_parser.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/tbox/xls_pipeline_test/test_pipeline.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/test_utils.py +0 -0
- data2rdf-2.4.0.dev1/PKG-INFO +0 -145
- data2rdf-2.4.0.dev1/README.md +0 -98
- data2rdf-2.4.0.dev1/data2rdf.egg-info/PKG-INFO +0 -145
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/LICENSE +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/data2rdf/__init__.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/setup.py +0 -0
- {data2rdf-2.4.0.dev1 → data2rdf-2.4.2}/tests/__init__.py +0 -0
data2rdf-2.4.2/PKG-INFO
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: data2rdf
|
|
3
|
+
Version: 2.4.2
|
|
4
|
+
Summary: A generic pipeline that can be used to map raw data to RDF.
|
|
5
|
+
Home-page: https://github.com/MI-FraunhoferIWM/data2rdf
|
|
6
|
+
Author: Paul Zierep, Yoav Nahshon, Pablo de Andres, Deepu Krishnareddy, Matthias Büschelberger
|
|
7
|
+
Author-email: matthias.bueschelberger@iwm.fraunhofer.de, yoav.nahshon@iwm.fraunhofer.de, pablo.de.andres@iwm.fraunhofer.de, deepu.krishnareddy@iwm.fraunhofer.de, matthias.bueschelberger@iwm.fraunhofer.de
|
|
8
|
+
License: BSD-3-Clause
|
|
9
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
10
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
14
|
+
Requires-Python: >=3.9
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Provides-Extra: dev
|
|
17
|
+
Provides-Extra: docs
|
|
18
|
+
Provides-Extra: pre_commit
|
|
19
|
+
Provides-Extra: tests
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
|
|
22
|
+
# data2rdf
|
|
23
|
+
|
|
24
|
+
A pipeline for generating data representation in RDF out of raw data given in ASCII, CSV, JSON or EXCEL format.
|
|
25
|
+
|
|
26
|
+
https://data2rdf.readthedocs.io/en/latest/
|
|
27
|
+
|
|
28
|
+
<!-- Pytest Coverage Comment:Begin -->
|
|
29
|
+
<a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/README.md"><img alt="Coverage" src="https://img.shields.io/badge/Coverage-88%25-green.svg" /></a><details><summary>Coverage Report </summary><table><tr><th>File</th><th>Stmts</th><th>Miss</th><th>Cover</th><th>Missing</th></tr><tbody><tr><td colspan="5"><b>data2rdf</b></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/__init__.py">__init__.py</a></td><td>5</td><td>0</td><td>100%</td><td> </td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/config.py">config.py</a></td><td>27</td><td>1</td><td>1</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/config.py#L 96%"> 96%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/utils.py">utils.py</a></td><td>12</td><td>2</td><td>2</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/utils.py#L 83%"> 83%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/warnings.py">warnings.py</a></td><td>3</td><td>0</td><td>100%</td><td> </td></tr><tr><td colspan="5"><b>data2rdf/models</b></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/__init__.py">__init__.py</a></td><td>3</td><td>0</td><td>100%</td><td> </td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/base.py">base.py</a></td><td>53</td><td>5</td><td>5</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/base.py#L 91%"> 91%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/graph.py">graph.py</a></td><td>144</td><td>8</td><td>8</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/graph.py#L 94%"> 94%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/mapping.py">mapping.py</a></td><td>47</td><td>1</td><td>1</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/mapping.py#L 98%"> 98%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/utils.py">utils.py</a></td><td>58</td><td>14</td><td>14</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/utils.py#L 76%"> 76%</a></td></tr><tr><td colspan="5"><b>data2rdf/modes</b></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/modes/__init__.py">__init__.py</a></td><td>4</td><td>0</td><td>100%</td><td> </td></tr><tr><td colspan="5"><b>data2rdf/parsers</b></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/__init__.py">__init__.py</a></td><td>6</td><td>0</td><td>100%</td><td> </td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/base.py">base.py</a></td><td>153</td><td>17</td><td>17</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/base.py#L 89%"> 89%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/csv.py">csv.py</a></td><td>168</td><td>20</td><td>20</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/csv.py#L 88%"> 88%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/excel.py">excel.py</a></td><td>183</td><td>17</td><td>17</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/excel.py#L 91%"> 91%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/json.py">json.py</a></td><td>229</td><td>39</td><td>39</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/json.py#L 83%"> 83%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/utils.py">utils.py</a></td><td>90</td><td>10</td><td>10</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/utils.py#L 89%"> 89%</a></td></tr><tr><td colspan="5"><b>data2rdf/pipelines</b></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/pipelines/__init__.py">__init__.py</a></td><td>2</td><td>0</td><td>100%</td><td> </td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/pipelines/main.py">main.py</a></td><td>95</td><td>16</td><td>16</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/pipelines/main.py#L 83%"> 83%</a></td></tr><tr><td colspan="5"><b>data2rdf/qudt</b></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/qudt/__init__.py">__init__.py</a></td><td>0</td><td>0</td><td>100%</td><td> </td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/qudt/utils.py">utils.py</a></td><td>55</td><td>16</td><td>16</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/qudt/utils.py#L 71%"> 71%</a></td></tr><tr><td><b>TOTAL</b></td><td><b>1337</b></td><td><b>166</b></td><td><b>88%</b></td><td> </td></tr></tbody></table></details>
|
|
30
|
+
<!-- Pytest Coverage Comment:End -->
|
|
31
|
+
|
|
32
|
+
# Installation
|
|
33
|
+
|
|
34
|
+
## Install for using the package
|
|
35
|
+
|
|
36
|
+
Either install the package from the pypi
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install data2rdf
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## Install for development
|
|
44
|
+
Install the package from the source code:
|
|
45
|
+
```bash
|
|
46
|
+
git clone git@github.com:MI-FraunhoferIWM/data2rdf.git
|
|
47
|
+
cd data2rdf
|
|
48
|
+
pip install -e .
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
# Unit tests
|
|
52
|
+
|
|
53
|
+
Before running the unit tests, please install the needed packages:
|
|
54
|
+
|
|
55
|
+
```{bash}
|
|
56
|
+
pip install data2rdf[tests]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Afterwards, run the unittest with:
|
|
60
|
+
|
|
61
|
+
```{bash}
|
|
62
|
+
pytest
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
# Building the docs locally
|
|
66
|
+
### HTML
|
|
67
|
+
|
|
68
|
+
A server will start, generate the docs and listen for changes in the source files.
|
|
69
|
+
This can be done by using docker or installing the development environment directly on the you machine. Next are installation guides for Docker and Linux OS.
|
|
70
|
+
|
|
71
|
+
#### Docker
|
|
72
|
+
|
|
73
|
+
First, build the Docker image by running the following command:
|
|
74
|
+
|
|
75
|
+
```shell
|
|
76
|
+
$ docker build -f docs.Dockerfile -t data2rdf-docs .
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Then, start the program by running:
|
|
80
|
+
|
|
81
|
+
```shell
|
|
82
|
+
$ docker run -it --rm -v $PWD:/app -p 8000:8000 data2rdf-docs
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
#### Linux
|
|
86
|
+
|
|
87
|
+
At an OS level (these commands work on Linux Debian):
|
|
88
|
+
|
|
89
|
+
```shell
|
|
90
|
+
$ sudo apt install pandoc graphviz default-jre
|
|
91
|
+
$ sudo apt-get install texlive-latex-recommended \
|
|
92
|
+
texlive-latex-extra \
|
|
93
|
+
texlive-fonts-recommended \
|
|
94
|
+
latexmk
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The python dependencies:
|
|
98
|
+
|
|
99
|
+
```shell
|
|
100
|
+
$ pip install .[docs]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Now you can start the server and render the docs:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
$ sphinx-autobuild docs/source docs/build/html
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The documentation will be available on [`http://127.0.0.1:8000`](http://127.0.0.1:8000).
|
|
110
|
+
|
|
111
|
+
### PDF (LaTeX)
|
|
112
|
+
|
|
113
|
+
To generate a PDF of the documentation, simply run (from the root project folder):
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
make -C docs latexpdf
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The generated PDF can be found under docs/build/latex/data2rdf_docs.pdf
|
data2rdf-2.4.2/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# data2rdf
|
|
2
|
+
|
|
3
|
+
A pipeline for generating data representation in RDF out of raw data given in ASCII, CSV, JSON or EXCEL format.
|
|
4
|
+
|
|
5
|
+
https://data2rdf.readthedocs.io/en/latest/
|
|
6
|
+
|
|
7
|
+
<!-- Pytest Coverage Comment:Begin -->
|
|
8
|
+
<a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/README.md"><img alt="Coverage" src="https://img.shields.io/badge/Coverage-88%25-green.svg" /></a><details><summary>Coverage Report </summary><table><tr><th>File</th><th>Stmts</th><th>Miss</th><th>Cover</th><th>Missing</th></tr><tbody><tr><td colspan="5"><b>data2rdf</b></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/__init__.py">__init__.py</a></td><td>5</td><td>0</td><td>100%</td><td> </td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/config.py">config.py</a></td><td>27</td><td>1</td><td>1</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/config.py#L 96%"> 96%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/utils.py">utils.py</a></td><td>12</td><td>2</td><td>2</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/utils.py#L 83%"> 83%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/warnings.py">warnings.py</a></td><td>3</td><td>0</td><td>100%</td><td> </td></tr><tr><td colspan="5"><b>data2rdf/models</b></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/__init__.py">__init__.py</a></td><td>3</td><td>0</td><td>100%</td><td> </td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/base.py">base.py</a></td><td>53</td><td>5</td><td>5</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/base.py#L 91%"> 91%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/graph.py">graph.py</a></td><td>144</td><td>8</td><td>8</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/graph.py#L 94%"> 94%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/mapping.py">mapping.py</a></td><td>47</td><td>1</td><td>1</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/mapping.py#L 98%"> 98%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/utils.py">utils.py</a></td><td>58</td><td>14</td><td>14</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/models/utils.py#L 76%"> 76%</a></td></tr><tr><td colspan="5"><b>data2rdf/modes</b></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/modes/__init__.py">__init__.py</a></td><td>4</td><td>0</td><td>100%</td><td> </td></tr><tr><td colspan="5"><b>data2rdf/parsers</b></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/__init__.py">__init__.py</a></td><td>6</td><td>0</td><td>100%</td><td> </td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/base.py">base.py</a></td><td>153</td><td>17</td><td>17</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/base.py#L 89%"> 89%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/csv.py">csv.py</a></td><td>168</td><td>20</td><td>20</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/csv.py#L 88%"> 88%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/excel.py">excel.py</a></td><td>183</td><td>17</td><td>17</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/excel.py#L 91%"> 91%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/json.py">json.py</a></td><td>229</td><td>39</td><td>39</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/json.py#L 83%"> 83%</a></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/utils.py">utils.py</a></td><td>90</td><td>10</td><td>10</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/parsers/utils.py#L 89%"> 89%</a></td></tr><tr><td colspan="5"><b>data2rdf/pipelines</b></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/pipelines/__init__.py">__init__.py</a></td><td>2</td><td>0</td><td>100%</td><td> </td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/pipelines/main.py">main.py</a></td><td>95</td><td>16</td><td>16</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/pipelines/main.py#L 83%"> 83%</a></td></tr><tr><td colspan="5"><b>data2rdf/qudt</b></td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/qudt/__init__.py">__init__.py</a></td><td>0</td><td>0</td><td>100%</td><td> </td></tr><tr><td> <a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/qudt/utils.py">utils.py</a></td><td>55</td><td>16</td><td>16</td><td><a href="https://github.com/MI-FraunhoferIWM/data2rdf/blob/main/data2rdf/qudt/utils.py#L 71%"> 71%</a></td></tr><tr><td><b>TOTAL</b></td><td><b>1337</b></td><td><b>166</b></td><td><b>88%</b></td><td> </td></tr></tbody></table></details>
|
|
9
|
+
<!-- Pytest Coverage Comment:End -->
|
|
10
|
+
|
|
11
|
+
# Installation
|
|
12
|
+
|
|
13
|
+
## Install for using the package
|
|
14
|
+
|
|
15
|
+
Either install the package from the pypi
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install data2rdf
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Install for development
|
|
23
|
+
Install the package from the source code:
|
|
24
|
+
```bash
|
|
25
|
+
git clone git@github.com:MI-FraunhoferIWM/data2rdf.git
|
|
26
|
+
cd data2rdf
|
|
27
|
+
pip install -e .
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
# Unit tests
|
|
31
|
+
|
|
32
|
+
Before running the unit tests, please install the needed packages:
|
|
33
|
+
|
|
34
|
+
```{bash}
|
|
35
|
+
pip install data2rdf[tests]
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Afterwards, run the unittest with:
|
|
39
|
+
|
|
40
|
+
```{bash}
|
|
41
|
+
pytest
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
# Building the docs locally
|
|
45
|
+
### HTML
|
|
46
|
+
|
|
47
|
+
A server will start, generate the docs and listen for changes in the source files.
|
|
48
|
+
This can be done by using docker or installing the development environment directly on the you machine. Next are installation guides for Docker and Linux OS.
|
|
49
|
+
|
|
50
|
+
#### Docker
|
|
51
|
+
|
|
52
|
+
First, build the Docker image by running the following command:
|
|
53
|
+
|
|
54
|
+
```shell
|
|
55
|
+
$ docker build -f docs.Dockerfile -t data2rdf-docs .
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Then, start the program by running:
|
|
59
|
+
|
|
60
|
+
```shell
|
|
61
|
+
$ docker run -it --rm -v $PWD:/app -p 8000:8000 data2rdf-docs
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Linux
|
|
65
|
+
|
|
66
|
+
At an OS level (these commands work on Linux Debian):
|
|
67
|
+
|
|
68
|
+
```shell
|
|
69
|
+
$ sudo apt install pandoc graphviz default-jre
|
|
70
|
+
$ sudo apt-get install texlive-latex-recommended \
|
|
71
|
+
texlive-latex-extra \
|
|
72
|
+
texlive-fonts-recommended \
|
|
73
|
+
latexmk
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The python dependencies:
|
|
77
|
+
|
|
78
|
+
```shell
|
|
79
|
+
$ pip install .[docs]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Now you can start the server and render the docs:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
$ sphinx-autobuild docs/source docs/build/html
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The documentation will be available on [`http://127.0.0.1:8000`](http://127.0.0.1:8000).
|
|
89
|
+
|
|
90
|
+
### PDF (LaTeX)
|
|
91
|
+
|
|
92
|
+
To generate a PDF of the documentation, simply run (from the root project folder):
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
make -C docs latexpdf
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The generated PDF can be found under docs/build/latex/data2rdf_docs.pdf
|
|
@@ -39,7 +39,7 @@ class Config(BaseSettings):
|
|
|
39
39
|
|
|
40
40
|
data_download_uri: Union[str, AnyUrl] = Field(
|
|
41
41
|
"https://www.example.org/download",
|
|
42
|
-
description="General base iri for downloading the
|
|
42
|
+
description="General base iri for downloading the dataframe after uploading",
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
graph_identifier: Optional[Union[str, AnyUrl]] = Field(
|
|
File without changes
|
|
@@ -24,6 +24,7 @@ class RelationType(str, Enum):
|
|
|
24
24
|
ANNOTATION_PROPERTY = "annotation_property"
|
|
25
25
|
DATA_PROPERTY = "data_property"
|
|
26
26
|
OBJECT_PROPERTY = "object_property"
|
|
27
|
+
PROPERTY = "property"
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
class BaseConfigModel(BaseModel):
|
|
@@ -71,14 +72,14 @@ class BasicGraphModel(BasicConceptMapping):
|
|
|
71
72
|
|
|
72
73
|
@property
|
|
73
74
|
@abstractmethod
|
|
74
|
-
def json_ld(
|
|
75
|
+
def json_ld(self) -> Dict[str, Any]:
|
|
75
76
|
"""Return dict for json-ld of graph"""
|
|
76
77
|
|
|
77
78
|
@property
|
|
78
|
-
def graph(
|
|
79
|
+
def graph(self) -> Graph:
|
|
79
80
|
"""Return graph object based on json-ld"""
|
|
80
|
-
graph = Graph(identifier=
|
|
81
|
-
graph.parse(data=json.dumps(
|
|
81
|
+
graph = Graph(identifier=self.config.graph_identifier)
|
|
82
|
+
graph.parse(data=json.dumps(self.json_ld), format="json-ld")
|
|
82
83
|
return graph
|
|
83
84
|
|
|
84
85
|
|
|
@@ -70,6 +70,10 @@ class ClassTypeGraph(BasicGraphModel):
|
|
|
70
70
|
None, description="Mappings for Data Properties"
|
|
71
71
|
)
|
|
72
72
|
|
|
73
|
+
rdfs_properties: Optional[List[ValueRelationMapping]] = Field(
|
|
74
|
+
None, description="Mappings for rdfs:Properties"
|
|
75
|
+
)
|
|
76
|
+
|
|
73
77
|
# OVERRIDE
|
|
74
78
|
@property
|
|
75
79
|
def json_ld(self) -> "Dict[str, Any]":
|
|
@@ -89,6 +93,14 @@ class ClassTypeGraph(BasicGraphModel):
|
|
|
89
93
|
)
|
|
90
94
|
for model in self.data_properties
|
|
91
95
|
}
|
|
96
|
+
properties = {
|
|
97
|
+
model.relation: (
|
|
98
|
+
apply_datatype(model)
|
|
99
|
+
if model.datatype
|
|
100
|
+
else detect_datatype(str(model.value))
|
|
101
|
+
)
|
|
102
|
+
for model in self.rdfs_properties
|
|
103
|
+
}
|
|
92
104
|
objects = {
|
|
93
105
|
model.relation: {"@id": model.value}
|
|
94
106
|
for model in self.object_properties
|
|
@@ -107,6 +119,7 @@ class ClassTypeGraph(BasicGraphModel):
|
|
|
107
119
|
**annotations,
|
|
108
120
|
**datatypes,
|
|
109
121
|
**objects,
|
|
122
|
+
**properties,
|
|
110
123
|
}
|
|
111
124
|
|
|
112
125
|
|
|
@@ -146,7 +159,7 @@ class MeasurementUnit(BaseConfigModel):
|
|
|
146
159
|
class QuantityGraph(BasicGraphModel, BasicSuffixModel):
|
|
147
160
|
"""Quantity with or without a discrete value and a unit
|
|
148
161
|
E.g. a quantity with a single value and unit _or_
|
|
149
|
-
a quantity describing a column of a
|
|
162
|
+
a quantity describing a column of a dataframe or table with a unit."""
|
|
150
163
|
|
|
151
164
|
unit: Optional[Union[str, AnyUrl]] = Field(
|
|
152
165
|
None, description="QUDT Symbol or any other IRI for the unit mapping"
|
|
@@ -226,23 +239,23 @@ class QuantityGraph(BasicGraphModel, BasicSuffixModel):
|
|
|
226
239
|
return self
|
|
227
240
|
|
|
228
241
|
@property
|
|
229
|
-
def json_ld(
|
|
242
|
+
def json_ld(self) -> Dict[str, Any]:
|
|
230
243
|
"""Return dict of json-ld for graph"""
|
|
231
244
|
return {
|
|
232
245
|
"@context": {
|
|
233
|
-
f"{
|
|
246
|
+
f"{self.config.prefix_name}": make_prefix(self.config),
|
|
234
247
|
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
|
|
235
248
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
236
249
|
"qudt": "http://qudt.org/schema/qudt/",
|
|
237
250
|
},
|
|
238
|
-
"@id": f"{
|
|
251
|
+
"@id": f"{self.config.prefix_name}:{self.suffix}",
|
|
239
252
|
"@type": (
|
|
240
|
-
[str(iri) for iri in
|
|
241
|
-
if isinstance(
|
|
242
|
-
else str(
|
|
253
|
+
[str(iri) for iri in self.iri]
|
|
254
|
+
if isinstance(self.iri, list)
|
|
255
|
+
else str(self.iri)
|
|
243
256
|
),
|
|
244
|
-
**
|
|
245
|
-
**
|
|
257
|
+
**self.unit_json,
|
|
258
|
+
**self.value_json,
|
|
246
259
|
}
|
|
247
260
|
|
|
248
261
|
@property
|
|
@@ -273,7 +286,7 @@ class PropertyGraph(BasicGraphModel, BasicSuffixModel):
|
|
|
273
286
|
"""Mapping for an individual with arbitrary property. E.g. the
|
|
274
287
|
name of a tester or a testing facility. The value must not have a
|
|
275
288
|
discrete value but can also be a reference to a column in a table or
|
|
276
|
-
|
|
289
|
+
dataframe."""
|
|
277
290
|
|
|
278
291
|
value: Optional[
|
|
279
292
|
Union[str, int, float, bool, AnyUrl, "PropertyGraph", "QuantityGraph"]
|
|
@@ -340,17 +353,17 @@ class PropertyGraph(BasicGraphModel, BasicSuffixModel):
|
|
|
340
353
|
return self
|
|
341
354
|
|
|
342
355
|
@property
|
|
343
|
-
def json_ld(
|
|
356
|
+
def json_ld(self) -> Dict[str, Any]:
|
|
344
357
|
"""Return dict of json-ld for graph"""
|
|
345
358
|
return {
|
|
346
359
|
"@context": {
|
|
347
|
-
f"{
|
|
360
|
+
f"{self.config.prefix_name}": make_prefix(self.config),
|
|
348
361
|
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
|
|
349
362
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
350
363
|
},
|
|
351
|
-
"@id": f"{
|
|
352
|
-
**
|
|
353
|
-
**
|
|
364
|
+
"@id": f"{self.config.prefix_name}:{self.suffix}",
|
|
365
|
+
**self.value_json,
|
|
366
|
+
**self.types_json,
|
|
354
367
|
}
|
|
355
368
|
|
|
356
369
|
@property
|
|
@@ -372,26 +385,26 @@ class PropertyGraph(BasicGraphModel, BasicSuffixModel):
|
|
|
372
385
|
return response
|
|
373
386
|
|
|
374
387
|
@property
|
|
375
|
-
def types_json(
|
|
388
|
+
def types_json(self) -> "Dict[str, Any]":
|
|
376
389
|
"""Dict of json-ld for class types of the individual"""
|
|
377
|
-
if
|
|
390
|
+
if self.annotation:
|
|
378
391
|
types = {
|
|
379
392
|
"@type": [
|
|
380
393
|
(
|
|
381
|
-
[str(iri) for iri in
|
|
382
|
-
if isinstance(
|
|
383
|
-
else str(
|
|
394
|
+
[str(iri) for iri in self.iri]
|
|
395
|
+
if isinstance(self.iri, list)
|
|
396
|
+
else str(self.iri)
|
|
384
397
|
),
|
|
385
|
-
|
|
398
|
+
self.annotation,
|
|
386
399
|
]
|
|
387
400
|
}
|
|
388
401
|
else:
|
|
389
402
|
types = {
|
|
390
403
|
"@type": [
|
|
391
404
|
(
|
|
392
|
-
[str(iri) for iri in
|
|
393
|
-
if isinstance(
|
|
394
|
-
else str(
|
|
405
|
+
[str(iri) for iri in self.iri]
|
|
406
|
+
if isinstance(self.iri, list)
|
|
407
|
+
else str(self.iri)
|
|
395
408
|
)
|
|
396
409
|
]
|
|
397
410
|
}
|
|
@@ -41,7 +41,15 @@ class TBoxBaseMapping(BasicConceptMapping):
|
|
|
41
41
|
)
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
class
|
|
44
|
+
class PropertySubgraphBaseModel(BasicSuffixModel):
|
|
45
|
+
concatenate: Optional[bool] = Field(
|
|
46
|
+
False,
|
|
47
|
+
description="Concatenate the value and the iri",
|
|
48
|
+
alias=AliasChoices("concatenate", "concat"),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class CustomRelationPropertySubgraph(PropertySubgraphBaseModel):
|
|
45
53
|
value_relation: Optional[str] = Field(
|
|
46
54
|
"rdfs:label",
|
|
47
55
|
description="""Object/Data/Annotation property for the value
|
|
@@ -49,7 +57,7 @@ class CustomRelationPropertySubgraph(BasicSuffixModel):
|
|
|
49
57
|
)
|
|
50
58
|
|
|
51
59
|
|
|
52
|
-
class CustomRelationQuantitySubgraph(
|
|
60
|
+
class CustomRelationQuantitySubgraph(PropertySubgraphBaseModel):
|
|
53
61
|
unit_relation: Optional[Union[str, AnyUrl]] = Field(
|
|
54
62
|
"qudt:hasUnit",
|
|
55
63
|
description="""Object property for mapping the IRI
|
|
@@ -175,9 +183,10 @@ class ABoxBaseMapping(BasicConceptMapping, BasicSuffixModel):
|
|
|
175
183
|
class ABoxExcelMapping(ABoxBaseMapping):
|
|
176
184
|
"""A special model for mapping from excel files to semantic concepts in the ABox"""
|
|
177
185
|
|
|
178
|
-
|
|
186
|
+
dataframe_start: Optional[str] = Field(
|
|
179
187
|
None,
|
|
180
|
-
description="Cell location for the start of the
|
|
188
|
+
description="Cell location for the start of the dataframe quantity",
|
|
189
|
+
alias=AliasChoices("dataframe_start", "time_series_start"),
|
|
181
190
|
)
|
|
182
191
|
worksheet: Optional[str] = Field(
|
|
183
192
|
None,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -46,7 +46,7 @@ class BaseParser(BaseModel):
|
|
|
46
46
|
|
|
47
47
|
dropna: bool = Field(
|
|
48
48
|
False,
|
|
49
|
-
description="Drop all rows where ONLY NaN and None occur in the
|
|
49
|
+
description="Drop all rows where ONLY NaN and None occur in the dataframe.",
|
|
50
50
|
)
|
|
51
51
|
|
|
52
52
|
config: Config = Field(
|
|
@@ -72,7 +72,7 @@ class AnyBoxBaseParser(BaseParser):
|
|
|
72
72
|
|
|
73
73
|
@property
|
|
74
74
|
@abstractmethod
|
|
75
|
-
def mapping_model(
|
|
75
|
+
def mapping_model(self) -> "BaseParser":
|
|
76
76
|
"""Pydantic model for validating mapping.
|
|
77
77
|
Must be a subclass of `ABoxBaseParser` or `TBoxBaseParser`.
|
|
78
78
|
"""
|
|
@@ -93,10 +93,10 @@ class AnyBoxBaseParser(BaseParser):
|
|
|
93
93
|
"""Class method for loading data file"""
|
|
94
94
|
|
|
95
95
|
@property
|
|
96
|
-
def graph(
|
|
96
|
+
def graph(self) -> "Graph":
|
|
97
97
|
"""Return RDF Graph from the parsed data."""
|
|
98
|
-
graph = Graph(identifier=
|
|
99
|
-
graph.parse(data=json.dumps(
|
|
98
|
+
graph = Graph(identifier=self.config.graph_identifier)
|
|
99
|
+
graph.parse(data=json.dumps(self.json_ld), format="json-ld")
|
|
100
100
|
return graph
|
|
101
101
|
|
|
102
102
|
@model_validator(mode="after")
|
|
@@ -171,8 +171,8 @@ class ABoxBaseParser(AnyBoxBaseParser):
|
|
|
171
171
|
"""Basic Parser for ABox mode"""
|
|
172
172
|
|
|
173
173
|
_general_metadata: Any = PrivateAttr()
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
_dataframe_metadata: Any = PrivateAttr()
|
|
175
|
+
_dataframe: Any = PrivateAttr()
|
|
176
176
|
|
|
177
177
|
@property
|
|
178
178
|
def general_metadata(self) -> "List[BasicConceptMapping]":
|
|
@@ -180,14 +180,14 @@ class ABoxBaseParser(AnyBoxBaseParser):
|
|
|
180
180
|
return self._general_metadata
|
|
181
181
|
|
|
182
182
|
@property
|
|
183
|
-
def
|
|
183
|
+
def dataframe_metadata(self) -> "List[BasicConceptMapping]":
|
|
184
184
|
"""Return list object with general metadata"""
|
|
185
|
-
return self.
|
|
185
|
+
return self._dataframe_metadata
|
|
186
186
|
|
|
187
187
|
@property
|
|
188
|
-
def
|
|
188
|
+
def dataframe(self) -> "pd.DataFrame":
|
|
189
189
|
"""Return times series found in the data as pd.DataFrame"""
|
|
190
|
-
return self.
|
|
190
|
+
return self._dataframe
|
|
191
191
|
|
|
192
192
|
@property
|
|
193
193
|
def plain_metadata(self) -> List[Dict[str, Any]]:
|
|
@@ -226,6 +226,9 @@ class ABoxBaseParser(AnyBoxBaseParser):
|
|
|
226
226
|
prop = {
|
|
227
227
|
"label": metadatum.suffix,
|
|
228
228
|
"value": metadatum.value,
|
|
229
|
+
"relation_mapping": {
|
|
230
|
+
"class_iri": str(metadatum.iri),
|
|
231
|
+
},
|
|
229
232
|
}
|
|
230
233
|
if hasattr(metadatum, "measurement_unit"):
|
|
231
234
|
prop[
|
|
@@ -310,11 +313,11 @@ class BaseFileParser(BaseParser):
|
|
|
310
313
|
return self
|
|
311
314
|
|
|
312
315
|
@property
|
|
313
|
-
def plain_metadata(
|
|
316
|
+
def plain_metadata(self) -> Dict[str, Any]:
|
|
314
317
|
"""Metadata as flat json - without units and iris.
|
|
315
318
|
Useful e.g. for the custom properties of the DSMS."""
|
|
316
|
-
if
|
|
317
|
-
return
|
|
319
|
+
if self.mode == PipelineMode.ABOX:
|
|
320
|
+
return self.abox.plain_metadata
|
|
318
321
|
else:
|
|
319
322
|
raise NotImplementedError(
|
|
320
323
|
"`plain_metadata` is not available in `tbox`-mode."
|
|
@@ -330,33 +333,33 @@ class BaseFileParser(BaseParser):
|
|
|
330
333
|
)
|
|
331
334
|
|
|
332
335
|
@property
|
|
333
|
-
def general_metadata(
|
|
336
|
+
def general_metadata(self) -> "List[BasicConceptMapping]":
|
|
334
337
|
"""Return list object with general metadata"""
|
|
335
|
-
if
|
|
336
|
-
return
|
|
338
|
+
if self.mode == PipelineMode.ABOX:
|
|
339
|
+
return self.abox.general_metadata
|
|
337
340
|
else:
|
|
338
341
|
raise NotImplementedError(
|
|
339
342
|
"`general_metadata` is not available in `tbox`-mode."
|
|
340
343
|
)
|
|
341
344
|
|
|
342
345
|
@property
|
|
343
|
-
def
|
|
344
|
-
"""Return
|
|
345
|
-
if
|
|
346
|
-
return
|
|
346
|
+
def dataframe_metadata(self) -> "List[BasicConceptMapping]":
|
|
347
|
+
"""Return dataframe metadata"""
|
|
348
|
+
if self.mode == PipelineMode.ABOX:
|
|
349
|
+
return self.abox.dataframe_metadata
|
|
347
350
|
else:
|
|
348
351
|
raise NotImplementedError(
|
|
349
|
-
"`
|
|
352
|
+
"`dataframe_metadata` is not available in `tbox`-mode."
|
|
350
353
|
)
|
|
351
354
|
|
|
352
355
|
@property
|
|
353
|
-
def
|
|
354
|
-
"""Return
|
|
355
|
-
if
|
|
356
|
-
return
|
|
356
|
+
def dataframe(self) -> "Dict[str, Any]":
|
|
357
|
+
"""Return dataframe"""
|
|
358
|
+
if self.mode == PipelineMode.ABOX:
|
|
359
|
+
return self.abox.dataframe
|
|
357
360
|
else:
|
|
358
361
|
raise NotImplementedError(
|
|
359
|
-
"`
|
|
362
|
+
"`dataframe` is not available in `tbox`-mode."
|
|
360
363
|
)
|
|
361
364
|
|
|
362
365
|
@property
|