Entities (entity/*)
data type |
entity/* |
content types |
text/csv, application/json, application/X-lines+json |
The entity/* data type describes the most generic entity format.
See Entities for more details.
Data Types
entity/list
The data contains a list of entities.
entity/stream
The data contains a streamable list of entities that can be consumed line by line.
Allowed serialization formats for this type are: text/csv and application/X-lines+json.
Plugins may treat application/json as application/X-lines+json if this data type is set.
However, they must fall back to processing the file in a non streaming manner if that fails.
entity/numeric
Aside from the entity ID and href attributes every other attribute must be numeric (or a list of numbers).
Example:
ID,x,y,z
entA,1,0.7,5
entB,0.5,1,3
entity/vector
Stronger than numeric, as every attribute aside from ID and href must be a single number.
The dimensions must be ordered lexicographically if order is important and the serialization format may not preserve attribute order (e.g. JSON).
Example:
ID,x,y,z
entA,1,0.7,5
entB,0.5,1,3
entity/shaped_vector
Similar as enitity/vector, with the addition that each vector has a shape.
The dimensions may not start with shape and be ordered lexicographically if order is important and the serialization format may not preserve attribute order (e.g. JSON).
The shapes must start with shape and be ordered lexicographically if order is important and the serialization format may not preserve attribute order (e.g. JSON).
Example:
ID,shape0,shape1,dim0,dim1,dim3,dim4
entA,2,2,0.5,1,0.7,5
entB,2,2,3,0.5,1,3
entity/matrix
Same as numeric, every attribute aside from ID and href must be a single number (or a list of numbers).
Additionally, every attribute aside from ID and href must be an entity id.
Indexing the matrix should be done row first, meaning that the first index is for the row and the second for the column.
Example:
ID,entA,entB
entA,1,0.7
entB,0.5,1
matrix["entA"] # Entity(ID="entA", entA=1, entB=0.7)
matrix["entA"]["entB"] # 0.7
matrix["entB"]["entA"] # 0.5
entity/label
Each entity has only three attributes ID, href and label. The label attribute can be any type of object.
Example:
ID,label
entA,"cat"
entB,"dog"
entity/attribute-metadata
The entities should be interpreted as attribute metadata entities describing properties of attributes of other entities.
See also
Content Types
Entities text/csv
Download: entities.csv
ID,href,color
paintA,example.com/paints/paintA,#8a2be2
paintB,example.com/paints/paintA,#e9322d
Entities application/json
Download: entities.json
[
{"ID": "paintA","href": "example.com/paints/paintA","color": "#8a2be2"},
{"ID": "paintB","href": "example.com/paints/paintB","color": "#e9322d"}
]
Entities application/X-lines+json
Download: entities-lines.json
{"ID": "paintA","href": "example.com/paints/paintA","color": "#8a2be2"}
{"ID": "paintB","href": "example.com/paints/paintB","color": "#e9322d"}