§ 5@vector embeddings
Vector embeddings sit awkwardly in classical JSON-LD: they're not IRIs, not literals, and they explode RDF graphs. The
@vector container preserves them through expansion and validates dimensionality at parse time.Input
Output
{
"termDefinition": {
"embedding": {
"@id": "https://example.org/embedding",
"@container": "@vector",
"@dimensions": 4
}
},
"document": {
"@context": {
"embedding": {
"@container": "@vector",
"@dimensions": 4
}
},
"@type": "Document",
"title": "FLAIRS-39 paper",
"embedding": [
0.9,
0.1,
0.4,
0.2
]
},
"validateA": {
"valid": true,
"errors": []
},
"validateB": {
"valid": true,
"errors": []
},
"cosineSimilarity": 0.9940023209537981
}