Tabular Data

Item:OSW7d3292e5104f45b1be4fc23901fae4fa
Tabular Data [OSW7d3292e5104f45b1be4fc23901fae4fa]
ID OSW7d3292e5104f45b1be4fc23901fae4fa
UUID 7d3292e5-104f-45b1-be4f-c23901fae4fa
Label Tabular Data
Machine compatible name TabularData
Ontology equivalents
Statements (outgoing)
Statements (incoming)
Keywords

Description

No description found
Item
Type(s)/Category(s) Tutorial
CreativeWork
Article
Tutorial
Prerequisites (required) JSON-LD Tutorial
Prerequisites (optional)
Follow-up (recommended)

View as slide show

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

http://dataprotocols.org/json-table-schema/

jsondata
type
"Category:OSW494f660e6a714a1a9681c517bbb975da"
uuid"7d3292e5-104f-45b1-be4f-c23901fae4fa"
name"TabularData"
label
text"Tabular Data"
lang"en"
text"Tabellarische Daten"
lang"de"
required_predecessor
"Item:OSW911488771ea449a6a34051f8213d7f2f"