.do

Prepositions in Semantic Patterns

Deep dive into all prepositions (to, from, in, of, at, by, with, for, via, etc.) and their role in GraphDL semantic patterns

TL;DR: Prepositions connect Subjects, Predicates, and Objects to express relationships, directions, and context in semantic patterns. They're always lowercase and create compound predicates that read like natural language.

What Are Prepositions in GraphDL?

Prepositions are lowercase connecting words that enhance semantic patterns by adding direction, location, relationship, or context. They appear between or after predicates to form compound semantic expressions:

// Basic pattern
$.Subject.predicate.Object

// Pattern with preposition
$.Subject.predicate.to.Object
$.Subject.predicate.from.Object.to.AnotherObject
$.Subject.action.with.Object.for.Purpose

Why Prepositions Matter

Natural Language Alignment

Prepositions make semantic patterns read exactly like English:

// Natural: "Send email to user about order"
$.Email.send.to.User.about.Order

// Natural: "Transfer funds from account to account"
$.Funds.transfer.from.Account.to.Account

// Natural: "Assign task to person for project"
$.Task.assign.to.Person.for.Project

Semantic Precision

Prepositions disambiguate relationships and add context:

// Without preposition - ambiguous
$.Organization.employs.Person({
  /* who? where? when? */
})

// With prepositions - precise
$.Organization.employs.Person.in.Department.at.Location.since.Date({
  organization: orgId,
  person: personId,
  department: deptId,
  location: locationId,
  startDate: new Date('2025-01-01'),
})

Core Prepositions

1. to - Direction & Recipient

The to preposition indicates direction, recipient, or destination.

// Send to recipient
await $.Email.send.to.User({
  email: '[email protected]',
  subject: 'Welcome!',
  body: 'Thanks for signing up.',
})

// Transfer to destination
await $.Package.ship.to.Address({
  package: packageId,
  address: {
    street: '123 Main St',
    city: 'San Francisco',
    state: 'CA',
    zip: '94102',
  },
})

// Assign to person
await $.Task.assign.to.Person({
  task: taskId,
  person: personId,
  dueDate: '2025-11-15',
})

// Move to location
await $.Asset.move.to.Warehouse({
  asset: assetId,
  warehouse: warehouseId,
  timestamp: new Date(),
})

Common Patterns:

  • $.Action.send.to.Recipient
  • $.Object.move.to.Location
  • $.Task.assign.to.Person
  • $.Message.deliver.to.Endpoint

2. from - Source & Origin

The from preposition indicates source, origin, or starting point.

// Receive from sender
await $.Shipment.receive.from.Supplier({
  supplier: supplierId,
  items: products,
  warehouse: warehouseId,
})

// Transfer from source
await $.Funds.transfer.from.Account.to.Account({
  sourceAccount: accountId1,
  destinationAccount: accountId2,
  amount: 1000.0,
  currency: 'USD',
})

// Import from system
await $.Data.import.from.System({
  system: 'legacy-crm',
  entity: 'contacts',
  format: 'csv',
})

// Learn from experience
await $.Agent.learn.from.Interaction({
  agent: agentId,
  interaction: interactionId,
  outcome: 'success',
})

Common Patterns:

  • $.Object.receive.from.Source
  • $.Data.import.from.System
  • $.Object.transfer.from.Location.to.Location
  • $.Agent.learn.from.Experience

3. in - Container & Context

The in preposition indicates containment, location, or context.

// Work in context
await $.Person.work.in.Department({
  person: personId,
  department: deptId,
  role: 'Engineer',
})

// Store in location
await $.Document.store.in.Folder({
  document: docId,
  folder: folderId,
  permissions: ['read', 'write'],
})

// Operate in region
await $.Business.operate.in.Region({
  business: businessId,
  region: 'EMEA',
  license: licenseId,
})

// Search in scope
await $.Query.search.in.Database({
  query: 'SELECT * FROM users',
  database: 'production',
  limit: 100,
})

Common Patterns:

  • $.Person.work.in.Organization
  • $.Object.store.in.Container
  • $.Action.perform.in.Context
  • $.Event.occur.in.Timeframe

4. of - Possession & Composition

The of preposition indicates possession, composition, or relationship.

// Member of group
await $.Person.member.of.Organization({
  person: personId,
  organization: orgId,
  membershipType: 'premium',
})

// Part of whole
await $.Component.part.of.Product({
  component: componentId,
  product: productId,
  quantity: 4,
})

// Owner of asset
await $.Person.owner.of.Property({
  person: personId,
  property: propertyId,
  ownership: 1.0, // 100%
})

// Manager of team
await $.Person.manager.of.Team({
  person: personId,
  team: teamId,
  scope: 'full',
})

Common Patterns:

  • $.Person.member.of.Group
  • $.Part.component.of.Whole
  • $.Person.owner.of.Asset
  • $.Metric.measure.of.Performance

5. at - Specific Location & Time

The at preposition indicates a specific point in space or time.

// Located at place
await $.Person.work.at.Location({
  person: personId,
  location: locationId,
  schedule: 'full-time',
})

// Event at time
await $.Meeting.scheduled.at.Time({
  meeting: meetingId,
  time: new Date('2025-11-15T14:00:00Z'),
  duration: 3600, // seconds
})

// Available at endpoint
await $.Service.available.at.Endpoint({
  service: serviceId,
  endpoint: 'https://api.example.com/v1',
  protocol: 'https',
})

// Price at market
await $.Product.priced.at.Amount({
  product: productId,
  amount: 29.99,
  currency: 'USD',
  effectiveDate: new Date(),
})

Common Patterns:

  • $.Object.located.at.Place
  • $.Event.scheduled.at.Time
  • $.Service.available.at.Endpoint
  • $.Price.set.at.Amount

6. by - Agent & Method

The by preposition indicates the agent performing an action or the method used.

// Created by person
await $.Document.created.by.Person({
  document: docId,
  person: personId,
  timestamp: new Date(),
})

// Approved by authority
await $.Request.approved.by.Manager({
  request: requestId,
  manager: managerId,
  comments: 'Looks good',
})

// Delivered by carrier
await $.Package.delivered.by.Carrier({
  package: packageId,
  carrier: 'FedEx',
  signedBy: 'Recipient',
})

// Processed by system
await $.Transaction.processed.by.System({
  transaction: txnId,
  system: 'payment-gateway',
  result: 'success',
})

Common Patterns:

  • $.Object.created.by.Agent
  • $.Action.performed.by.Actor
  • $.Task.completed.by.Person
  • $.Object.delivered.by.Carrier

7. with - Accompaniment & Instrument

The with preposition indicates accompaniment, association, or the instrument used.

// Collaborate with partner
await $.Organization.partner.with.Organization({
  organization: orgId1,
  partner: orgId2,
  agreementType: 'joint-venture',
})

// Pay with method
await $.Customer.pay.with.PaymentMethod({
  customer: customerId,
  paymentMethod: 'credit-card',
  amount: 99.99,
  currency: 'USD',
})

// Integrate with system
await $.Service.integrate.with.System({
  service: serviceId,
  system: 'salesforce',
  apiKey: process.env.SALESFORCE_API_KEY,
})

// Associate with group
await $.Person.associate.with.Group({
  person: personId,
  group: groupId,
  role: 'contributor',
})

Common Patterns:

  • $.Entity.partner.with.Entity
  • $.Action.perform.with.Tool
  • $.Object.integrate.with.System
  • $.Person.collaborate.with.Person

8. for - Purpose & Beneficiary

The for preposition indicates purpose, beneficiary, or intended use.

// Create for purpose
await $.Task.create.for.Project({
  task: taskId,
  project: projectId,
  priority: 'high',
})

// Reserve for person
await $.Resource.reserve.for.Person({
  resource: resourceId,
  person: personId,
  startDate: new Date('2025-11-01'),
  endDate: new Date('2025-11-30'),
})

// Optimize for metric
await $.Algorithm.optimize.for.Performance({
  algorithm: algoId,
  metric: 'throughput',
  target: 10000, // requests/sec
})

// Bill for service
await $.Invoice.create.for.Service({
  customer: customerId,
  service: serviceId,
  amount: 299.0,
  period: '2025-11',
})

Common Patterns:

  • $.Task.create.for.Purpose
  • $.Resource.allocate.for.Project
  • $.Action.perform.for.Benefit
  • $.Payment.charge.for.Service

9. via - Route & Medium

The via preposition indicates the route, medium, or method of transmission.

// Send via channel
await $.Message.send.via.Channel({
  message: messageId,
  channel: 'email',
  recipient: '[email protected]',
})

// Connect via protocol
await $.Client.connect.via.Protocol({
  client: clientId,
  protocol: 'websocket',
  endpoint: 'wss://api.example.com',
})

// Notify via webhook
await $.System.notify.via.Webhook({
  event: eventId,
  webhook: 'https://example.com/webhook',
  method: 'POST',
})

// Authenticate via provider
await $.User.authenticate.via.Provider({
  user: userId,
  provider: 'google-oauth',
  token: accessToken,
})

Common Patterns:

  • $.Message.send.via.Medium
  • $.Connection.establish.via.Protocol
  • $.Notification.deliver.via.Channel
  • $.Auth.verify.via.Provider

10. on - Surface & Trigger

The on preposition indicates a surface, platform, or event trigger.

// Publish on platform
await $.Content.publish.on.Platform({
  content: contentId,
  platform: 'blog',
  publishDate: new Date(),
})

// Run on infrastructure
await $.Application.deploy.on.Infrastructure({
  application: appId,
  infrastructure: 'kubernetes',
  replicas: 3,
})

// React on event
on($.Order.created, async (order) => {
  await $.Email.send.to.Customer({
    customer: order.customerId,
    template: 'order-confirmation',
    data: { order },
  })
})

// Comment on issue
await $.Person.comment.on.Issue({
  person: personId,
  issue: issueId,
  comment: 'This looks good to me!',
})

Common Patterns:

  • $.Content.publish.on.Platform
  • $.Service.run.on.Infrastructure
  • $.Action.trigger.on.Event
  • $.Person.comment.on.Object

Advanced Prepositions

11. about - Topic & Subject Matter

// Notify about event
await $.System.notify.User.about.Event({
  user: userId,
  event: eventId,
  channel: 'email',
})

// Inquire about product
await $.Customer.inquire.about.Product({
  customer: customerId,
  product: productId,
  question: 'What are the dimensions?',
})

// Report about performance
await $.System.report.about.Metrics({
  metrics: metricsId,
  format: 'pdf',
  recipients: [managerId],
})

12. as - Role & Capacity

// Act as agent
await $.Person.act.as.Agent({
  person: personId,
  role: 'administrator',
  scope: 'organization',
})

// Serve as backup
await $.Server.serve.as.Backup({
  server: serverId,
  primary: primaryId,
  mode: 'hot-standby',
})

// Register as vendor
await $.Organization.register.as.Vendor({
  organization: orgId,
  category: 'technology',
  verification: verificationId,
})

13. through - Path & Intermediary

// Route through gateway
await $.Request.route.through.Gateway({
  request: requestId,
  gateway: gatewayId,
  protocol: 'https',
})

// Process through pipeline
await $.Data.process.through.Pipeline({
  data: dataId,
  pipeline: pipelineId,
  stages: ['validate', 'transform', 'load'],
})

// Communicate through intermediary
await $.Message.send.through.Proxy({
  message: messageId,
  proxy: proxyId,
  destination: destinationId,
})

14. during - Temporal Context

// Available during period
await $.Service.available.during.Period({
  service: serviceId,
  startDate: new Date('2025-11-01'),
  endDate: new Date('2025-11-30'),
})

// Maintain during operation
await $.System.maintain.during.Operation({
  system: systemId,
  operation: operationId,
  mode: 'hot-swap',
})

15. before / after - Temporal Order

// Validate before processing
await $.Data.validate.before.Processing({
  data: dataId,
  schema: schemaId,
  strict: true,
})

// Notify after completion
await $.System.notify.after.Completion({
  task: taskId,
  recipients: [userId],
  method: 'email',
})

// Backup before deployment
await $.Database.backup.before.Deployment({
  database: dbId,
  deployment: deploymentId,
  retention: 30, // days
})

16. between - Relationship & Range

// Negotiate between parties
await $.Contract.negotiate.between.Parties({
  party1: orgId1,
  party2: orgId2,
  terms: termsId,
})

// Transfer between accounts
await $.Funds.transfer.between.Accounts({
  source: accountId1,
  destination: accountId2,
  amount: 1000.0,
})

// Synchronize between systems
await $.Data.sync.between.Systems({
  system1: 'crm',
  system2: 'erp',
  frequency: 'hourly',
})

17. among - Multiple Entities

// Distribute among recipients
await $.Reward.distribute.among.Participants({
  reward: rewardId,
  participants: [personId1, personId2, personId3],
  split: 'equal',
})

// Share among team
await $.Resource.share.among.Team({
  resource: resourceId,
  team: teamId,
  permissions: ['read', 'write'],
})

18. under - Authority & Condition

// Operate under license
await $.Business.operate.under.License({
  business: businessId,
  license: licenseId,
  jurisdiction: 'CA',
})

// Work under supervision
await $.Person.work.under.Supervision({
  person: personId,
  supervisor: supervisorId,
  department: deptId,
})

// Execute under conditions
await $.Contract.execute.under.Conditions({
  contract: contractId,
  conditions: conditionsId,
  effective: new Date(),
})

19. over - Authority & Duration

// Manage over period
await $.Project.manage.over.Period({
  project: projectId,
  startDate: new Date('2025-11-01'),
  endDate: new Date('2026-10-31'),
})

// Authority over department
await $.Manager.authority.over.Department({
  manager: managerId,
  department: deptId,
  scope: 'full',
})

20. within - Boundary & Scope

// Complete within timeframe
await $.Task.complete.within.Timeframe({
  task: taskId,
  deadline: new Date('2025-12-01'),
  buffer: 86400, // 1 day in seconds
})

// Operate within budget
await $.Project.operate.within.Budget({
  project: projectId,
  budget: 100000,
  currency: 'USD',
})

// Search within scope
await $.Query.search.within.Scope({
  query: searchTerms,
  scope: 'organization',
  filters: filtersId,
})

21. without - Absence & Exclusion

// Operate without dependency
await $.Service.operate.without.Dependency({
  service: serviceId,
  mode: 'standalone',
  fallback: fallbackId,
})

// Process without approval
await $.Request.process.without.Approval({
  request: requestId,
  authority: 'automated',
  threshold: 100.0,
})

22. near - Proximity

// Locate near point
await $.Store.locate.near.Location({
  location: {
    latitude: 37.7749,
    longitude: -122.4194,
  },
  radius: 10, // kilometers
  limit: 5,
})

// Deploy near users
await $.Service.deploy.near.Users({
  service: serviceId,
  region: 'us-west',
  latency: 'minimize',
})

23. around - Surrounding & Approximation

// Schedule around constraints
await $.Meeting.schedule.around.Constraints({
  meeting: meetingId,
  constraints: constraintsId,
  flexibility: 'moderate',
})

// Organize around theme
await $.Content.organize.around.Theme({
  content: contentIds,
  theme: themeId,
  hierarchy: 'auto',
})

24. beyond - Exceeding & Extension

// Extend beyond scope
await $.Feature.extend.beyond.Scope({
  feature: featureId,
  originalScope: scopeId,
  extension: extensionId,
})

// Scale beyond capacity
await $.System.scale.beyond.Capacity({
  system: systemId,
  currentCapacity: 1000,
  targetCapacity: 5000,
})

Compound Preposition Patterns

Multiple Prepositions

Combine prepositions to create rich semantic expressions:

// Transfer from source to destination via method
await $.Funds.transfer.from.Account.to.Account.via.Wire({
  sourceAccount: accountId1,
  destinationAccount: accountId2,
  amount: 50000,
  method: 'wire-transfer',
  reference: 'INV-2025-001',
})

// Send message to recipient about topic via channel
await $.Message.send.to.Person.about.Project.via.Email({
  recipient: personId,
  project: projectId,
  subject: 'Project Update',
  body: 'The project is on track.',
  channel: 'email',
})

// Assign task to person for project with priority
await $.Task.assign.to.Person.for.Project.with.Priority({
  task: taskId,
  person: personId,
  project: projectId,
  priority: 'high',
  deadline: new Date('2025-12-01'),
})

// Ship product from warehouse to customer via carrier
await $.Product.ship.from.Warehouse.to.Customer.via.Carrier({
  product: productId,
  warehouse: warehouseId,
  customer: customerId,
  carrier: 'UPS',
  trackingNumber: '1Z999AA10123456784',
})

Preposition Flow Diagrams

Message Routing Pattern

graph LR A[Sender] -->|send.via.Channel| B[Channel] B -->|route.through.Gateway| C[Gateway] C -->|deliver.to.Recipient| D[Recipient] D -->|notify.about.Delivery| E[Notification]

Resource Allocation Pattern

graph TD A[Resource Pool] -->|allocate.for.Project| B[Project] B -->|assign.to.Person| C[Person] C -->|work.in.Department| D[Department] D -->|report.to.Manager| E[Manager] E -->|manage.within.Budget| F[Budget]

Data Flow Pattern

graph LR A[Source System] -->|extract.from.Database| B[Data] B -->|transform.via.Pipeline| C[Pipeline] C -->|load.into.Warehouse| D[Data Warehouse] D -->|query.by.Analyst| E[Analyst] E -->|report.to.Stakeholder| F[Stakeholder]

Best Practices

1. Use Natural Word Order

// ✅ Good: Reads like English
$.Email.send.to.User.about.Order

// ❌ Bad: Unnatural word order
$.Email.send.about.Order.to.User

2. Be Specific with Context

// ✅ Good: Specific prepositions add context
$.Person.work.in.Department.at.Location.for.Organization

// ❌ Bad: Missing context
$.Person.work.Department

3. Maintain Consistency

// ✅ Good: Consistent pattern across codebase
$.Package.ship.from.Warehouse.to.Customer
$.Funds.transfer.from.Account.to.Account
$.Message.send.from.Sender.to.Recipient

// ❌ Bad: Inconsistent patterns
$.Package.shipFrom.Warehouse.shipTo.Customer
$.Funds.fromAccount.toAccount.transfer

4. Avoid Redundancy

// ✅ Good: Concise and clear
$.Task.assign.to.Person

// ❌ Bad: Redundant prepositions
$.Task.assign.to.Person.to.Complete

5. Layer Prepositions Logically

// ✅ Good: Logical progression
$.Product.ship.from.Warehouse.to.Customer.via.Carrier

// ❌ Bad: Illogical order
$.Product.ship.via.Carrier.from.Warehouse.to.Customer

Preposition Reference Table

PrepositionMeaningCommon PatternsExample
toDirection, recipientsend.to, move.to, assign.to$.Email.send.to.User
fromSource, originreceive.from, import.from, transfer.from$.Data.import.from.System
inContainer, contextwork.in, store.in, operate.in$.Person.work.in.Department
ofPossession, part ofmember.of, part.of, owner.of$.Person.member.of.Organization
atSpecific location/timelocated.at, scheduled.at, priced.at$.Meeting.scheduled.at.Time
byAgent, methodcreated.by, approved.by, delivered.by$.Document.created.by.Person
withAccompaniment, instrumentpartner.with, pay.with, integrate.with$.Service.integrate.with.System
forPurpose, beneficiarycreate.for, reserve.for, optimize.for$.Task.create.for.Project
viaRoute, mediumsend.via, connect.via, notify.via$.Message.send.via.Channel
onSurface, triggerpublish.on, run.on, comment.on$.Content.publish.on.Platform
aboutTopic, subject matternotify.about, inquire.about, report.about$.System.notify.about.Event
asRole, capacityact.as, serve.as, register.as$.Person.act.as.Agent
throughPath, intermediaryroute.through, process.through$.Data.process.through.Pipeline
duringTemporal contextavailable.during, maintain.during$.Service.available.during.Period
beforeTemporal precedencevalidate.before, backup.before$.Data.validate.before.Processing
afterTemporal sequencenotify.after, cleanup.after$.System.notify.after.Completion
betweenRelationship, rangenegotiate.between, transfer.between$.Funds.transfer.between.Accounts
amongMultiple entitiesdistribute.among, share.among$.Reward.distribute.among.Participants
underAuthority, conditionoperate.under, work.under$.Business.operate.under.License
overAuthority, durationmanage.over, authority.over$.Manager.authority.over.Department
withinBoundary, scopecomplete.within, operate.within$.Task.complete.within.Timeframe
withoutAbsence, exclusionoperate.without, process.without$.Service.operate.without.Dependency
nearProximitylocate.near, deploy.near$.Store.locate.near.Location
aroundSurroundingschedule.around, organize.around$.Meeting.schedule.around.Constraints
beyondExceedingextend.beyond, scale.beyond$.System.scale.beyond.Capacity

Real-World Examples

E-Commerce Fulfillment

import $, { on, send } from 'sdk.do'

// Order lifecycle with rich preposition usage
on($.Order.created, async (order) => {
  // Notify customer about order via email
  await $.Email.send.to.Customer.about.Order.via.SMTP({
    customer: order.customerId,
    order: order.id,
    template: 'order-confirmation',
  })

  // Reserve inventory for order in warehouse
  await $.Inventory.reserve.for.Order.in.Warehouse({
    order: order.id,
    warehouse: order.fulfillmentWarehouseId,
    items: order.items,
  })

  // Create shipment from warehouse to customer via carrier
  await $.Shipment.create.from.Warehouse.to.Customer.via.Carrier({
    warehouse: order.fulfillmentWarehouseId,
    customer: order.customerId,
    carrier: order.shippingMethod,
    items: order.items,
  })
})

// Track shipment through delivery
on.Shipment.departed.from.Warehouse(async (shipment) => {
  // Notify customer about shipment via SMS
  await $.SMS.send.to.Customer.about.Shipment({
    customer: shipment.customerId,
    message: `Your order has shipped via ${shipment.carrier}`,
    trackingNumber: shipment.trackingNumber,
  })

  // Update status in database
  await $.Order.update.in.Database({
    orderId: shipment.orderId,
    status: 'shipped',
    timestamp: new Date(),
  })
})

HR Onboarding

// Employee onboarding workflow
async function onboardEmployee(personId: string, orgId: string, deptId: string) {
  // Assign person to organization in department
  await $.Person.assign.to.Organization.in.Department({
    person: personId,
    organization: orgId,
    department: deptId,
    startDate: new Date(),
  })

  // Provision access for person to systems
  await $.Access.provision.for.Person.to.Systems({
    person: personId,
    systems: ['email', 'slack', 'github'],
    role: 'employee',
  })

  // Create account for person on platform
  await $.Account.create.for.Person.on.Platform({
    person: personId,
    platform: 'company-intranet',
    credentials: await generateCredentials(),
  })

  // Assign mentor to person for onboarding
  await $.Mentor.assign.to.Person.for.Period({
    mentor: await findMentor(deptId),
    person: personId,
    period: 90, // days
    goals: ['learn-systems', 'meet-team'],
  })

  // Send welcome email to person about onboarding
  await $.Email.send.to.Person.about.Onboarding({
    person: personId,
    template: 'welcome',
    attachments: ['handbook.pdf', 'benefits.pdf'],
  })
}

Financial Transaction

// Complex financial transaction with multiple prepositions
async function processPayment(orderId: string) {
  const order = await db.get($.Order, orderId)

  // Authorize payment from customer for order
  const authorization = await $.Payment.authorize.from.Customer.for.Order({
    customer: order.customerId,
    order: orderId,
    amount: order.total,
    currency: order.currency,
  })

  if (authorization.approved) {
    // Capture funds from customer to merchant via gateway
    await $.Funds.capture.from.Customer.to.Merchant.via.Gateway({
      customer: order.customerId,
      merchant: order.merchantId,
      gateway: 'stripe',
      authorization: authorization.id,
      amount: order.total,
    })

    // Record transaction in ledger for audit
    await $.Transaction.record.in.Ledger.for.Audit({
      transaction: authorization.transactionId,
      ledger: 'financial',
      metadata: {
        order: orderId,
        timestamp: new Date(),
      },
    })

    // Notify customer about payment via email
    await $.Email.send.to.Customer.about.Payment({
      customer: order.customerId,
      template: 'payment-confirmation',
      data: { transaction: authorization.transactionId },
    })
  }
}

Supply Chain Management

// Multi-step supply chain with prepositions
on.PurchaseOrder.created(async (po) => {
  // Send order to supplier via EDI
  await $.Order.send.to.Supplier.via.EDI({
    supplier: po.supplierId,
    order: po.id,
    items: po.items,
    deliveryDate: po.requestedDate,
  })

  // Schedule delivery from supplier to warehouse
  await $.Delivery.schedule.from.Supplier.to.Warehouse({
    supplier: po.supplierId,
    warehouse: po.destinationWarehouseId,
    date: po.requestedDate,
    carrier: po.preferredCarrier,
  })
})

on.Delivery.arrived.at.Warehouse(async (delivery) => {
  // Receive goods from supplier in warehouse
  await $.Goods.receive.from.Supplier.in.Warehouse({
    supplier: delivery.supplierId,
    warehouse: delivery.warehouseId,
    items: delivery.items,
    condition: 'inspect',
  })

  // Update inventory in system for tracking
  await $.Inventory.update.in.System.for.Tracking({
    warehouse: delivery.warehouseId,
    items: delivery.items,
    operation: 'increment',
    timestamp: new Date(),
  })

  // Notify procurement about delivery via slack
  await $.Message.send.to.Team.about.Delivery.via.Slack({
    team: 'procurement',
    delivery: delivery.id,
    channel: '#supply-chain',
    message: `Delivery ${delivery.id} arrived at warehouse`,
  })
})

TypeScript Type Safety

Prepositions maintain full type safety through the $ proxy:

import $ from 'sdk.do'

// TypeScript infers correct types based on preposition chain
const task = await $.Task.assign.to.Person.for.Project({
  task: 'task_123',        // Type: string (Task ID)
  person: 'per_456',       // Type: string (Person ID)
  project: 'proj_789',     // Type: string (Project ID)
  deadline: new Date()     // Type: Date
})

// Autocomplete suggests valid prepositions after each verb
$.Order.ship.   // suggests: to, from, via, by, etc.
$.Person.work.  // suggests: in, at, for, with, under, etc.
$.Data.sync.    // suggests: between, with, to, from, via, etc.

// Compile-time errors for invalid combinations
await $.Order.ship.under.License({  // ✗ Type error!
  // Error: 'under' is not a valid preposition for 'ship'
})

Migration from Traditional APIs

Before (REST)

// REST - arbitrary endpoints and parameters
await fetch('/api/orders', { method: 'POST', body: JSON.stringify(orderData) })
await fetch('/api/shipments', { method: 'POST', body: JSON.stringify(shipmentData) })
await fetch('/api/notifications/email', { method: 'POST', body: JSON.stringify(emailData) })

After (Semantic Patterns with Prepositions)

// Semantic - clear, consistent, self-documenting
await $.Order.create.for.Customer({ customer: customerId, items: orderItems })
await $.Shipment.create.from.Warehouse.to.Customer({
  /* ... */
})
await $.Email.send.to.Customer.about.Order({
  /* ... */
})

Next Steps

  1. Practice with Examples - Try implementing the examples above
  2. Explore Pattern Combinations - Experiment with multiple prepositions
  3. Read Verb Guide - Learn about verb conjugation (coming soon - issue #7043)
  4. Study Real Use Cases - See production examples (coming soon)

Pattern Tip: When choosing prepositions, read your semantic pattern aloud. If it sounds like natural English, you've chosen well. The best patterns are the ones that need no explanation.