This directory provides the JSON-LD and Hydra semantic overlay for the SourceOS/SociOS specification. These files make the schema types and REST API self-describing to Linked Data tooling.
| File | Purpose |
|---|---|
context.jsonld |
JSON-LD @context mapping schema type names to stable IRIs under https://schemas.srcos.ai/v2/ |
hydra.jsonld |
A hydra:ApiDocumentation document describing the REST API's supported classes and operations |
fog-vocabulary.jsonld |
Additive fog vocabulary seed for FogVault / FogCompute types and key predicates |
agent-machine-model-carry-context.jsonld |
Additive context slice for SourceOS model carry and Agent Machine runtime facts/receipts |
agent-machine-model-carry-hydra.jsonld |
Additive Hydra slice for SourceOS model carry and Agent Machine runtime classes |
The Agent Machine / Model Carry slice currently contributes an additive semantic vocabulary covering:
SourceOSModelCarryRefInferenceProviderModelResidencyPlacementFactAgentMachineReceipt
This vocabulary is intentionally staged as additive slice files so it can be reviewed independently before being folded into the global context.jsonld and hydra.jsonld files.
The fog layer currently contributes a seed semantic vocabulary in fog-vocabulary.jsonld covering:
TopicTopicEnvelopeReplicationPolicyContentRefOfferWorkOrderUsageReceiptSettlementEvent
This vocabulary is intentionally lightweight and is expected to be folded into the broader semantic overlay as the fog contract family stabilizes.
Include the context in any JSON document to make it a JSON-LD document:
{
"@context": "https://schemas.srcos.ai/v2/context.jsonld",
"@type": "Dataset",
"id": "urn:srcos:dataset:health_obs"
}Or embed the context inline:
{
"@context": {
"srcos": "https://schemas.srcos.ai/v2/",
"Dataset": "srcos:Dataset"
}
}The context maps:
id→@id(everyidfield becomes the node's IRI)type→@type(everytypefield becomes the node's RDF type)- schema type names to
srcos:<TypeName>IRIs - selected cross-vocabulary terms such as
prov:wasGeneratedBy,prov:used,prov:wasAssociatedWith
The Hydra document is a machine-readable API description that extends the JSON-LD context. It can be served at /.well-known/hydra to make the API self-describing.
The document lists every resource class supported by the API with its supported operations (HTTP methods), expected inputs, and returned types.
npm install -g jsonld-cli
jsonld frame --frame '{"@type":"Dataset"}' examples/dataset.jsonjsonld format --output-format nquads examples/dataset.jsoncurl https://api.srcos.local/.well-known/hydra | python3 -m json.toolWhen adding a new first-class schema type:
- Add a mapping to
context.jsonld:"NewType": "srcos:NewType" - Add a
hydra:supportedClassentry tohydra.jsonldwith at minimumhydra:title,hydra:description, and the applicablehydra:supportedOperationentries. - Update this README's file table and any additive vocabulary seeds if the new type is being staged incrementally.
See CONTRIBUTING.md for the full guide.
- JSON-LD 1.1
- Hydra Core Vocabulary
- W3C PROV-O — used for
ProvenanceRecordmappings