Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs #57

Merged
merged 3 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion docs/examples/abox/1_csv.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CSV file with metadata and time series

```{note}
Please follow [this link here](https://github.com/MI-FraunhoferIWM/data2rdf/blob/b29be66cb57beef8bd8f84e2cd588ccb8e17559c/examples/1_csv.ipynb) in order to access the related jupyter notebook.
```

## General understanding

In this example, we want to transfor a csv file which encorporates stress/strain of the measurement and some metadata about the experiment into an RDF repesentation.
Expand Down Expand Up @@ -71,6 +75,15 @@ Since we are assuming to have a csv file, we can assume the following parser arg
* `"fillna"`: The value to fill NaN values in the parsed dataframe.
In this example, we assume that the NaN values in the dataframe are filled with `""`. Hence the argument is `""`. This is in particular of importance when the time series is parsed from the csv file. Since we are using pandas to parse the csv file, we need to make sure that gaps in the time series are filled with `""`, instead of the default `np.nan` values in the dataframe. If not applied here, this might lead to problems in the data2rdf pipeline.

The according parser args hence will look like this:

```{python}
parser_args = {
"metadata_sep":"\t",
"time_series_sep":"\t",
"metadata_length":20
}
```

### The mapping

Expand Down Expand Up @@ -154,6 +167,43 @@ For the quantitative properties (e.g. `"Vorkraft"`=Preload) and non-quantitative
"iri": "https://w3id.org/steel/ProcessOntology/TestStandard",
"key": "Pr\u00fcfnorm"
},
{
"iri": "https://w3id.org/steel/ProcessOntology/TestTime",
"key": "Pr\u00fcfzeit"
},
{
"iri": "https://w3id.org/steel/ProcessOntology/StandardForce",
"key": "Standardkraft"
},
{
"iri": "https://w3id.org/steel/ProcessOntology/Extension",
"key": "Standardweg"
},
{
"iri": "https://w3id.org/steel/ProcessOntology/Temperature",
"key": "Temperatur"
},
{
"iri": "https://w3id.org/steel/ProcessOntology/AbsoluteCrossheadTravel",
"key": "Traversenweg absolut"
},
{
"iri": "https://w3id.org/steel/ProcessOntology/ParallelLength",
"key": "Versuchsl\u00e4nge"
},
{
"iri": "https://w3id.org/steel/ProcessOntology/Preload",
"key": "Vorkraft"
},
{
"iri": "https://w3id.org/steel/ProcessOntology/DisplacementTransducer",
"key": "Wegaufnehmer"
},
{
"annotation": "https://w3id.org/steel/ProcessOntology",
"iri": "https://w3id.org/steel/ProcessOntology/Material",
"key": "Werkstoff"
}
]
```
</Details>
Expand Down Expand Up @@ -456,7 +506,7 @@ pipeline = Data2RDF(

The mapping can also be provided as a csv or excel file (**only as a file writen to disk, not as a string in memory**):

```{csv}
```
key;iri;annotation
Prüfinstitut;https://w3id.org/steel/ProcessOntology/TestingFacility;
Projektnummer;https://w3id.org/steel/ProcessOntology/ProjectNumber;
Expand Down
5 changes: 5 additions & 0 deletions docs/examples/abox/2_excel.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Excel file with metadata and time series

```{note}
Please follow [this link here](https://github.com/MI-FraunhoferIWM/data2rdf/blob/b29be66cb57beef8bd8f84e2cd588ccb8e17559c/examples/2_excel.ipynb) in order to access the related jupyter notebook.
```


```{note}
This example is building up on the previous one about the [CSV file with metadata and time series](1_csv.md).
Please start from this chapter in order to fully understand the content of this example.
Expand Down
9 changes: 7 additions & 2 deletions docs/examples/abox/3_json.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# JSON file or Python-dict with metadata and time series

```{note}
Please follow [this link here](https://github.com/MI-FraunhoferIWM/data2rdf/blob/b29be66cb57beef8bd8f84e2cd588ccb8e17559c/examples/3_json.ipynb) in order to access the related jupyter notebook.
```


```{note}
This example is building up on the very first one about the [CSV file with metadata and time series](1_csv.md).
Please start from this chapter in order to fully understand the content of this example.
Expand Down Expand Up @@ -27,7 +32,7 @@ We are considering the following dummy data as json input:
```
raw_data = {
"data": {
"Breitenänderung": {
"Breitenaenderung": {
"unit": "mm",
"value": 1.0
},
Expand Down Expand Up @@ -67,7 +72,7 @@ A valid mapping for the json defined above may look like this:
{
"iri": "https://w3id.org/steel/ProcessOntology/WidthChange",
"key": "Breitenaenderung",
"unit": "data.Breitenaenderung.unit",
"unit_location": "data.Breitenaenderung.unit",
"value_location": "data.Breitenaenderung.value"
},
{
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/abox/4_csv_wo_metadata.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CSV file without metadata

```{note}
Please follow [this link here](https://github.com/MI-FraunhoferIWM/data2rdf/blob/b29be66cb57beef8bd8f84e2cd588ccb8e17559c/examples/4_csv_wo_metadata.ipynb) in order to access the related jupyter notebook.
```

## General understanding

In this example, we are looking into dummy sensor data which is provided by a csv file. However, we do not have any metadata in this case, but directly start with the time series. Additionaly, each column in this time series is of the same ontological class, but was recorded by a different sensor.
Expand Down
6 changes: 5 additions & 1 deletion docs/examples/abox/5_csv_w_na.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CSV file without metadata and with missing values

```{note}
Please follow [this link here](https://github.com/MI-FraunhoferIWM/data2rdf/blob/b29be66cb57beef8bd8f84e2cd588ccb8e17559c/examples/5_csv_w_na.ipynb) in order to access the related jupyter notebook.
```

## General understanding

In comparision to the [previous example of the csv file without metadata](1.4_csv_wo_metadata.md), we are using the similar data again, but now we have some missing values in the time series. Again, there will be no metadata in this case.
Expand All @@ -17,7 +21,7 @@ For this example, we will consider the following inputs:

For this example, we will consider the following input data:

```{csv}
```
Temperature[°C];Coefficient of thermal exapansion[1/K];Specific heat[J/kgK];Young's modulus[Pa];Poison's ratio[-];Thermal conductivity[W/mK];Density[kg/m3]
20;8.70E-06;8.46E+02;7.47E+10;0.218;0.99;2.47E+03
100;9.00E-06;8.70E+02;7.43E+10;0.223;1.06;
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/abox/6_custom_relations.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Graph with custom relations

```{note}
Please follow [this link here](https://github.com/MI-FraunhoferIWM/data2rdf/blob/b29be66cb57beef8bd8f84e2cd588ccb8e17559c/examples/6_graph_custom_relations.ipynb) in order to access the related jupyter notebook.
```

## General understanding

In this very small example, we would like to generate a graph without quantitative data, but some other alpha-numeric properties, like names or labels. Additionally, we would like to set a custom relation like an annotation property or datatype property between the node of the individual and the data which we parse.
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/tbox/tbox.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# TBox generation from a Python dictionary

```{note}
Please follow [this link here](https://github.com/MI-FraunhoferIWM/data2rdf/blob/b29be66cb57beef8bd8f84e2cd588ccb8e17559c/examples/7_tbox.ipynb) in order to access the related jupyter notebook.
```

## General understanding

data2rdf is able to run the pipeline in tbox mode. In tbox mode, data2rdf generates a class hierarchy of the provided data.
Expand Down
Loading