Item:OSW7d3292e5104f45b1be4fc23901fae4fa
(Install package: OSW Docs - Core) |
(Update package: OSW Docs - Core) |
||
| Line 422: | Line 422: | ||
</div> | </div> | ||
</div> | </div> | ||
== Data Tables Schema == | |||
http://dataprotocols.org/json-table-schema/ | |||
Latest revision as of 07:08, 13 November 2024
| Tabular Data | |
|---|---|
| ID | OSW7d3292e5104f45b1be4fc23901fae4fa |
| UUID | 7d3292e5-104f-45b1-be4f-c23901fae4fa |
| Label | Tabular Data |
| Machine compatible name | TabularData |
| Statements (outgoing) | |
| Statements (incoming) | |
|
|
|
Description
No description found
| Item | |
|---|---|
| Type(s)/Category(s) | Tutorial |
| Creative Work |
|---|
| Article |
|---|
| Tutorial | |
|---|---|
| Prerequisites (required) | JSON-LD Tutorial |
| Prerequisites (optional) | |
| Follow-up (recommended) | |
Tabular Data: JSON-Representation
Table
| id | name | number |
|---|---|---|
| row1 | test1 | 1e12 |
| row2 | test2 | 2 |
| row3 | test3 | 3 |
JSON - id as key
{
"content": {
"row1": {"id": "row1", "name": "test1", "number": "1e12"},
"row2": {"id": "row2", "name": "test2", "number": 2},
"row3": {"id": "row3", "name": "test3", "number": 3}
}
}
JSON - index as key
{
"content": [
{"id": "row1", "name": "test1", "number": "1e12"},
{"id": "row2", "name": "test2", "number": 2},
{"id": "row3", "name": "test3", "number": 3}
]
}
Tabular Data: JSON-LD Mapping
- map each column to a term
- set a default language
- misuse language tag as unit tag - not recommended
JSON - id as key with context
{
"@context": {
"test": "http://test.voc/",
"name": {"@id": "test:name", "@language": "en"},
"number": {"@id": "test:number", "@language": "Volt"},
"content": {"@container": "@index", "@id": "test:hasRow", "@index": "test:HasId"}
},
"content": {
"row1": {"id": "row1", "name": "test1", "number": "1e12"},
"row2": {"id": "row2", "name": "test2", "number": 2},
"row3": {"id": "row3", "name": "test3", "number": 3}
}
}
Mapping
| Subject | Predicate | Object | Language |
|---|---|---|---|
| _:b0 | http://test.voc/hasRow | _:b1 | |
| _:b0 | http://test.voc/hasRow | _:b2 | |
| _:b0 | http://test.voc/hasRow | _:b3 | |
| _:b1 | http://test.voc/HasId | row1 | |
| _:b1 | http://test.voc/name | test1 | en |
| _:b1 | http://test.voc/number | 1e12 | volt |
| _:b2 | http://test.voc/HasId | row2 | |
| _:b2 | http://test.voc/name | test2 | en |
| _:b2 | http://test.voc/number | 2 | |
| _:b3 | http://test.voc/HasId | row3 | |
| _:b3 | http://test.voc/name | test3 | en |
| _:b3 | http://test.voc/number | 3 |
Tabular Data: JSON-LD Mapping
- map each column to a term
- set a default language
- misuse language tag as unit tag - not recommended
JSON - index as key with context
{
"@context": {
"test": "http://test.voc/",
"id": "test:hasId",
"name": {"@id": "test:name", "@language": "en"},
"number": {"@id": "test:number", "@language": "Volt"},
"content": {"@container": "@index", "@id": "test:hasRow", "@index": "test:HasId"}
},
"content": [
{"id": "row1", "name": "test1", "number": "1e12"},
{"id": "row2", "name": "test2", "number": 2},
{"id": "row3", "name": "test3", "number": 3}
]
}
Mapping
| Subject | Predicate | Object | Language |
|---|---|---|---|
| _:b0 | http://test.voc/hasRow | _:b1 | |
| _:b0 | http://test.voc/hasRow | _:b2 | |
| _:b0 | http://test.voc/hasRow | _:b3 | |
| _:b1 | http://test.voc/hasId | row1 | |
| _:b1 | http://test.voc/name | test1 | en |
| _:b1 | http://test.voc/number | 1e12 | volt |
| _:b2 | http://test.voc/hasId | row2 | |
| _:b2 | http://test.voc/name | test2 | en |
| _:b2 | http://test.voc/number | 2 | |
| _:b3 | http://test.voc/hasId | row3 | |
| _:b3 | http://test.voc/name | test3 | en |
| _:b3 | http://test.voc/number | 3 |
Tabular Data: JSON-LD Mapping
- alternative mapping with named nodes
JSON - index as key with context
{
"@context": {
"test": "http://test.voc/",
"id": {"@id": "@id", "@context": {"@base": "http://test.voc/"}},
"name": {"@id": "test:name", "@language": "en"},
"number": {"@id": "test:number", "@language": "Volt"},
"content": {"@container": "@index", "@id": "test:hasRow", "@index": "test:HasId", "@context": {"@base": "http://test.voc/"}}
},
"@id": "test:myTable",
"content": [
{"id": "row1", "name": "test1", "number": "1e12"},
{"id": "row2", "name": "test2", "number": 2},
{"id": "row3", "name": "test3", "number": 3}
]
}
Mapping
| Subject | Predicate | Object | Language |
|---|---|---|---|
| http://test.voc/myTable | http://test.voc/hasRow | http://test.voc/row1 | |
| http://test.voc/myTable | http://test.voc/hasRow | http://test.voc/row2 | |
| http://test.voc/myTable | http://test.voc/hasRow | http://test.voc/row3 | |
| http://test.voc/row1 | http://test.voc/name | test1 | en |
| http://test.voc/row1 | http://test.voc/number | 1e12 | volt |
| http://test.voc/row2 | http://test.voc/name | test2 | en |
| http://test.voc/row2 | http://test.voc/number | 2 | |
| http://test.voc/row3 | http://test.voc/name | test3 | en |
| http://test.voc/row3 | http://test.voc/number | 3 |
Tabular Data: JSON-LD Mapping
JSON - index as key with context, header meta data
{
"@context": {
"test": "http://test.voc/",
"id": {"@id": "@id", "@context": {"@base": "http://test.voc/"}},
"name": {"@id": "test:name", "@language": "en"},
"number": {"@id": "test:number"},
"property": {"@id": "test:hasProperty", "@type": "@id"},
"unit": {"@id": "test:hasUnit", "@type": "@id"},
"header": {"@container": "@index", "@id": "test:hasColumn", "@index": "test:HasId", "@context": {"@base": "http://test.voc/"}},
"content": {"@container": "@index", "@id": "test:hasRow", "@index": "test:HasId", "@context": {"@base": "http://test.voc/"}}
},
"@id": "test:myTable",
"header": [
{"id": "column1", "name": "id", "property": "test:hasId"},
{"id": "column2", "name": "name", "property": "test:hasName"},
{"id": "column3", "name": "number", "property": "test:hasNumber", "unit": "test:volt"}
],
"content": [
{"id": "row1", "name": "test1", "number": "1e12"},
{"id": "row2", "name": "test2", "number": 2},
{"id": "row3", "name": "test3", "number": 3}
]
}
Mapping
| Subject | Predicate | Object |
|---|---|---|
| http://test.voc/column1 | http://test.voc/hasProperty | http://test.voc/hasId |
| http://test.voc/column1 | http://test.voc/name | id |
| http://test.voc/column2 | http://test.voc/hasProperty | http://test.voc/hasName |
| http://test.voc/column2 | http://test.voc/name | name |
| http://test.voc/column3 | http://test.voc/hasProperty | http://test.voc/hasNumber |
| http://test.voc/column3 | http://test.voc/hasUnit | http://test.voc/volt |
| http://test.voc/column3 | http://test.voc/name | number |
| http://test.voc/myTable | http://test.voc/hasColumn | http://test.voc/column1 |
| http://test.voc/myTable | http://test.voc/hasColumn | http://test.voc/column2 |
| http://test.voc/myTable | http://test.voc/hasColumn | http://test.voc/column3 |
| http://test.voc/myTable | http://test.voc/hasRow | http://test.voc/row1 |
| http://test.voc/myTable | http://test.voc/hasRow | http://test.voc/row2 |
| http://test.voc/myTable | http://test.voc/hasRow | http://test.voc/row3 |
| http://test.voc/row1 | http://test.voc/name | test1 |
| http://test.voc/row1 | http://test.voc/number | 1e12 |
| http://test.voc/row2 | http://test.voc/name | test2 |
| http://test.voc/row2 | http://test.voc/number | 2 |
| http://test.voc/row3 | http://test.voc/name | test3 |
| http://test.voc/row3 | http://test.voc/number | 3 |
Data Tables Schema
jsondata
| type |
| ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| uuid | "7d3292e5-104f-45b1-be4f-c23901fae4fa" | ||||||||||
| name | "TabularData" | ||||||||||
| label |
| ||||||||||
| required_predecessor |
|