.do
Core Concepts

nouns

Types of entities - people, places, things, ideas

nouns

Entity type definitions (nouns) that define the schema, validation, and behavior for resources in the semantic data model.

Overview

The nouns primitive defines entity types (like Business, User, Product) with schemas, validation rules, and relationships, forming the foundation of the semantic $.Subject.predicate.Object pattern.

Quick Example

import { nouns } from 'sdk.do'

// Define a noun (entity type)
const Business = await nouns.define({
  name: 'Business',
  description: 'A commercial organization',
  schema: {
    name: { type: 'string', required: true },
    industry: { type: 'string', enum: ['Technology', 'Healthcare', 'Finance'] },
    revenue: { type: 'number', min: 0 },
    status: { type: 'string', default: 'active' },
  },
  relationships: {
    owns: ['Brand', 'Product'],
    employs: ['User'],
    locatedIn: ['Location'],
  },
})

// Use the noun to create resources
const acme = await Business.create({
  name: 'Acme Inc',
  industry: 'Technology',
})

Core Capabilities

  • Schema Definition - Define fields, types, and constraints
  • Validation Rules - Built-in and custom validation
  • Relationship Types - Define how nouns relate to each other
  • Inheritance - Nouns can extend other nouns
  • Lifecycle Hooks - Custom logic for create/update/delete

Access Methods

SDK

TypeScript/JavaScript library for noun definitions

await nouns.define({ name: 'Business', schema: { name: 'string', industry: 'string' } })

SDK Documentation

CLI

Command-line tool for noun management

do noun define Business --schema schema.json

CLI Documentation

API

REST/RPC endpoints for noun definitions

curl -X POST https://api.do/v1/nouns -d '{"name":"Business","schema":{...}}'

API Documentation

MCP

Model Context Protocol for AI-driven noun definition

Define a noun "Business" with fields: name (required string), industry (string), revenue (number)

MCP Documentation