Get Started¶
This page walks you through the smallest possible OO-LD schema, step by step. If you are not familiar yet with JSON Schema or JSON-LD, you may first want to look at dedicated tutorials like the OSW JSON Schema Tutorial and the OSW JSON-LD Tutorial.
Step 1 - Write a schema that is also a context¶
The core idea of OO-LD is that a single document is at once a valid JSON Schema and a reference-able JSON-LD remote context. Start from a plain JSON Schema and add an @context:
{
"$schema": "https://oo-ld.org/latest/meta/oold-meta-schema.json",
"$id": "Minimal.schema.json",
"@context": {
"schema": "http://schema.org/",
"name": "schema:name"
},
"title": "Minimal",
"type": "object",
"properties": {
"name": { "type": "string", "description": "Name of the thing" }
}
}
$schema: https://oo-ld.org/latest/meta/oold-meta-schema.json
$id: Minimal.schema.json
'@context':
schema: http://schema.org/
name: schema:name
title: Minimal
type: object
properties:
name:
type: string
description: Name of the thing
- The JSON Schema part (
type,properties, …) describes the structure of the object. - The
@contextpart maps thenameproperty to the semantic termschema:name, describing its meaning. $idgives the schema a stable identity and$schemadeclares the OO-LD dialect (the meta-schema).
!!! note "JSON or YAML?" JSON is the canonical notation for OO-LD. YAML is an equivalent, more human-friendly rendering as long as it stays within the JSON-compatible subset (no anchors, tags, or implicit typing surprises), so every example here has a "View as YAML" tab. See the specification's Notation section for the normative rule.
Step 2 - Try it in the playground¶
You can explore this exact example - validation, UI generation, and RDF output - in the interactive playground.
Step 3 - Validate schemas in this repository¶
This repository ships example schemas under examples/ and the OO-LD meta-schema under meta/. To validate them locally:
npm install
npm run validate
Next steps¶
- Basic Concepts - how a schema doubles as a context, and how inheritance works.
- Composition - assemble complex types from reusable building blocks.
- Schema Instances - how instance documents reference their schema and carry identity and type.