Unified Knowledge Ontology
type: Ontology
version IRI: https://cleveragents.ai/ontology/uko/0.1.0
comment: CleverAgents knowledge representation layers 0-3

InformationUnit
type: Class
comment: The root of every UKO node. Anything that can appear in an actor's context.

Container
type: Class
subclass of: InformationUnit
comment: An information unit that contains other information units (file, module, class, section).

Atom
type: Class
subclass of: InformationUnit
comment: A leaf-level information unit (function body, paragraph, config value).

Annotation
type: Class
subclass of: InformationUnit
comment: Metadata attached to another information unit (comment, docstring, attribute).

Boundary
type: Class
subclass of: InformationUnit
comment: An interface point between containers (export, API endpoint, public method signature).

contains
type: ObjectProperty
domain: Container
range: InformationUnit
comment: Parent contains child (e.g., module contains class).

references
type: ObjectProperty
domain: InformationUnit
range: InformationUnit
comment: Weak reference (e.g., a function mentions a type in a docstring).

dependsOn
type: ObjectProperty
domain: InformationUnit
range: InformationUnit
comment: Strong dependency (e.g., import, inheritance, call).

hasRendering
type: DatatypeProperty
domain: InformationUnit
range: string
comment: A rendered text representation of this node at a specific detail depth. Multiple renderings at different depths may exist for the same node. The depth is indicated by the associated uko:renderingDepth value.

renderingDepth
type: DatatypeProperty
domain: InformationUnit
range: nonNegativeInteger
comment: The integer detail depth at which the associated uko:hasRendering was produced. Paired with uko:hasRendering via a blank node or reification.

hasFullContent
type: DatatypeProperty
domain: InformationUnit
range: string
comment: Shorthand for the maximum-depth rendering of this node (complete, unabridged content). Equivalent to uko:hasRendering at the domain's maximum depth.

sourceResource
type: ObjectProperty
domain: InformationUnit
comment: The CleverAgents Resource (by ULID) this node was extracted from.

sourcePath
type: DatatypeProperty
domain: InformationUnit
range: string
comment: Path within the resource (e.g., file path relative to the resource root).

sourceRange
type: DatatypeProperty
domain: InformationUnit
range: string
comment: Byte or line range within the source file (e.g., '42:1-87:0').

validFrom
type: DatatypeProperty
domain: InformationUnit
range: dateTime

validUntil
type: DatatypeProperty
domain: InformationUnit
range: dateTime

isCurrent
type: DatatypeProperty
domain: InformationUnit
range: boolean

isRevisionOf
type: ObjectProperty
domain: InformationUnit
range: InformationUnit
comment: Links a revised node to its predecessor.

Module
type: Class
subclass of: Container
comment: A source code module (file, package, namespace).

Callable
type: Class
subclass of: Atom
comment: Any callable unit (function, method, procedure, lambda).

TypeDefinition
type: Class
subclass of: Atom
comment: A type or schema definition (class, struct, interface, enum, typedef).

TestCase
type: Class
subclass of: Atom
comment: A test case or test function.

Import
type: Class
subclass of: Annotation
comment: An import/include/require statement.

hasReturnType
type: DatatypeProperty
domain: Callable
range: string

hasParameters
type: DatatypeProperty
domain: Callable
range: string
comment: JSON-encoded parameter list.

testsCallable
type: ObjectProperty
domain: TestCase
range: Callable
comment: Links a test case to the callable it tests.

Document
type: Class
subclass of: Container
comment: A complete document (article, report, manual, specification).

Part
type: Class
subclass of: Container
comment: A top-level division of a document (e.g., Part I, Part II).

Chapter
type: Class
subclass of: Container
comment: A chapter within a document or part.

Section
type: Class
subclass of: Container
comment: A numbered or titled section within a chapter.

Subsection
type: Class
subclass of: Section
comment: A subsection nested within a section (arbitrary depth).

Paragraph
type: Class
subclass of: Atom
comment: A paragraph of prose text.

CodeBlock
type: Class
subclass of: Atom
comment: An inline code listing or example within a document.

Figure
type: Class
subclass of: Atom
comment: A figure, diagram, or image with an optional caption.

Table
type: Class
subclass of: Atom
comment: A tabular data element within a document.

BlockQuote
type: Class
subclass of: Atom
comment: A quoted passage from another source.

ListBlock
type: Class
subclass of: Atom
comment: An ordered or unordered list.

Footnote
type: Class
subclass of: Annotation
comment: A footnote or endnote.

Citation
type: Class
subclass of: Annotation
comment: A bibliographic citation or reference.

Comment
type: Class
subclass of: Annotation
comment: An editorial comment or annotation (e.g., HTML comment, review note).

TableOfContents
type: Class
subclass of: Boundary
comment: The document's table of contents -- an interface into the document's structure.

Index
type: Class
subclass of: Boundary
comment: A back-of-book index or keyword index.

Glossary
type: Class
subclass of: Boundary
comment: A glossary of terms defined in the document.

discussesTopic
type: ObjectProperty
sub property of: references
domain: InformationUnit
range: InformationUnit
comment: Semantic relationship: this unit discusses a topic that is the subject of another unit.

cites
type: ObjectProperty
sub property of: references
domain: InformationUnit
range: Citation
comment: This unit cites a bibliographic reference.

crossReferences
type: ObjectProperty
sub property of: references
domain: InformationUnit
range: InformationUnit
comment: Explicit cross-reference (e.g., 'see Section 3.2').

precedes
type: ObjectProperty
domain: InformationUnit
range: InformationUnit
comment: Reading order: this unit comes before the target unit.

headingLevel
type: DatatypeProperty
domain: Section
range: integer
comment: The nesting depth of this section (1 = top-level, 2 = subsection, etc.).

headingText
type: DatatypeProperty
domain: Section
range: string
comment: The title/heading text of this section.

wordCount
type: DatatypeProperty
domain: InformationUnit
range: integer
comment: Word count of the text content in this unit.

language
type: DatatypeProperty
domain: Document
range: string
comment: Natural language of the document (e.g., 'en', 'fr').

topicKeywords
type: DatatypeProperty
domain: InformationUnit
range: string
comment: JSON-encoded list of topic keywords extracted from this unit.

Database
type: Class
subclass of: Container
comment: A database instance containing schemas.

Schema
type: Class
subclass of: Container
comment: A database schema (namespace for tables, views, etc.).

Table
type: Class
subclass of: Container
comment: A database table containing columns.

View
type: Class
subclass of: Container
comment: A database view (virtual table defined by a query).

Column
type: Class
subclass of: Atom
comment: A column within a table or view.

StoredProcedure
type: Class
subclass of: Atom
comment: A stored procedure or function in the database.

Trigger
type: Class
subclass of: Atom
comment: A database trigger.

Migration
type: Class
subclass of: Atom
comment: A schema migration (DDL change script).

Constraint
type: Class
subclass of: Annotation
comment: A column or table constraint (NOT NULL, UNIQUE, CHECK, etc.).

Index
type: Class
subclass of: Annotation
comment: A database index on one or more columns.

ColumnComment
type: Class
subclass of: Annotation
comment: A COMMENT ON COLUMN annotation in the database.

ForeignKey
type: Class
subclass of: Boundary
comment: A foreign key constraint -- an interface point between tables.

APIEndpoint
type: Class
subclass of: Boundary
comment: A database-level API endpoint (e.g., PostgREST, GraphQL).

foreignKeyTo
type: ObjectProperty
sub property of: dependsOn
domain: Column
range: Column
comment: Foreign key relationship from this column to a column in another table.

viewReferences
type: ObjectProperty
sub property of: dependsOn
domain: View
range: Table
comment: This view's query references columns from the target table.

procedureAccesses
type: ObjectProperty
sub property of: dependsOn
domain: StoredProcedure
range: Table
comment: This stored procedure reads from or writes to the target table.

triggerFires
type: ObjectProperty
sub property of: dependsOn
domain: Trigger
range: Table
comment: This trigger fires on events on the target table.

migrationAlters
type: ObjectProperty
sub property of: dependsOn
domain: Migration
range: Table
comment: This migration modifies the schema of the target table.

dataType
type: DatatypeProperty
domain: Column
range: string
comment: SQL data type (e.g., 'VARCHAR(255)', 'INTEGER', 'JSONB').

isNullable
type: DatatypeProperty
domain: Column
range: boolean

isPrimaryKey
type: DatatypeProperty
domain: Column
range: boolean

rowEstimate
type: DatatypeProperty
domain: Table
range: long
comment: Estimated row count from database statistics.

viewDefinition
type: DatatypeProperty
domain: View
range: string
comment: The SQL query that defines this view.

procedureBody
type: DatatypeProperty
domain: StoredProcedure
range: string
comment: The SQL/PL body of the stored procedure.

Service
type: Class
subclass of: Container
comment: A deployable service or application.

ConfigBlock
type: Class
subclass of: Container
comment: A configuration block or section (e.g., a YAML map, TOML table).

DeploymentUnit
type: Class
subclass of: Container
comment: A deployment unit (e.g., Kubernetes Deployment, Docker Compose service).

ConfigKey
type: Class
subclass of: Atom
comment: A configuration key-value pair.

EnvironmentVariable
type: Class
subclass of: Atom
comment: An environment variable definition.

Endpoint
type: Class
subclass of: Boundary
comment: A network endpoint (HTTP route, gRPC service, message queue).

Port
type: Class
subclass of: Boundary
comment: A network port binding.

connectsTo
type: ObjectProperty
sub property of: dependsOn
domain: Service
range: Service
comment: This service connects to or depends on the target service.

exposes
type: ObjectProperty
domain: Service
range: Endpoint
comment: This service exposes the target endpoint.

Class
subclass of: TypeDefinition
subclass of: Container
comment: An OO class that contains methods and attributes.

Interface
type: Class
subclass of: TypeDefinition
subclass of: Boundary
comment: An interface or abstract base class.

Method
type: Class
subclass of: Callable
comment: A method defined within a class.

Attribute
type: Class
subclass of: Atom
comment: A class or instance attribute.

inheritsFrom
type: ObjectProperty
sub property of: dependsOn
domain: Class
range: Class

implements
type: ObjectProperty
sub property of: dependsOn
domain: Class
range: Interface

PureFunction
type: Class
subclass of: Callable
comment: A pure function with no side effects.

TypeClass
type: Class
subclass of: TypeDefinition
subclass of: Boundary
comment: A type class defining a set of operations for types.

Monad
type: Class
subclass of: TypeDefinition
comment: A monadic type encapsulating computation context.

ProceduralFunction
type: Class
subclass of: Callable
comment: A procedural function declaration.

GlobalVariable
type: Class
subclass of: Atom
comment: A global variable declaration.

HeaderFile
type: Class
subclass of: Container
comment: A header file defining exported declarations.

StructDefinition
type: Class
subclass of: TypeDefinition
comment: A C-style struct type definition.

Macro
type: Class
subclass of: Atom
comment: A preprocessor macro definition.