The C4 architecture ontology¶
The architecture explorer describes a codebase with the C4 model: people, software systems, containers, components and code, how they relate, and how they collaborate in runtime scenarios. This folder gives that description a formal vocabulary, so the RDF graph every explorer exports means something outside the plugin.
The graph is the architecture, complete. Every explorer page exports its model as RDF (Turtle, JSON-LD, N-Triples, .rete), and the graph holds everything needed to recreate every diagram: the map at every level, each lifecycle, every use case as a collaboration or sequence diagram, and the Data view (schemas, tables and classes with their fields, the lines between identifiers, and which steps read and write them). A page rebuilt from the graph alone is identical to the original (the plugin checks this with check-roundtrip.mjs).
The C4 model is Simon Brown's work. This ontology is an independent formalisation of it for this plugin; it is not endorsed by Simon Brown or by c4model.com.
Files¶
| File | What | IRI |
|---|---|---|
c4.ttl |
Core: the architecture. OWL 2 | https://caviri.github.io/c4-model-agentic-plugin/ontology/c4, terms c4: = …/ontology/c4# |
c4-data.ttl |
Data: the schemas the architecture keeps its data in, their entities and fields, the identifiers that connect them across stores, relations, and what steps read and write. OWL 2, imports the core | …/ontology/c4-data, terms c4d: = …/ontology/c4-data# |
c4-view.ttl |
View: how the explorer draws it. OWL 2, imports the core | …/ontology/c4-view, terms c4v: = …/ontology/c4-view# |
c4-shapes.ttl |
SHACL shapes every exported graph meets: core, data and view modules | …/ontology/c4-shapes.ttl |
- c4-coherence-shapes.ttl: the explorer's coherence rules (flows that no arrow carries, data a step cannot reach, a queue with one side, containers that call each other, lifecycles with unreachable states, …) as SHACL-SPARQL constraints, written from the template by check-coherence.mjs --write-shapes. Run with pyshacl -s c4-coherence-shapes.ttl architecture.ttl; the rules: skills/architecture-explorer/references/coherence-rules.md. |
||
c4-history.ttl |
History: versions of an architecture as named graphs, with PROV-O provenance and RDF 1.2 changesets. OWL 2 | …/ontology/c4-history, terms c4h: = …/ontology/c4-history# |
c4-history-shapes.ttl |
SHACL shapes every history dataset meets | …/ontology/c4-history-shapes.ttl |
c4-stories.ttl |
User stories: the stories told about a system (as a person, I want, so that), the personas they are told for, the scenario steps each one covers, acceptance criteria and the code behind them, the screens seen at a step, and readers' notes on those screens. OWL 2, imports the core | …/ontology/c4-stories, terms c4us: = …/ontology/c4-stories# |
c4-stories-shapes.ttl |
SHACL shapes every user stories graph meets | …/ontology/c4-stories-shapes.ttl |
alignments.ttl |
optional SKOS mappings to schema.org, Dublin Core, PROV-O, and for the data module to CSVW, SHACL, OWL / RDFS, DCAT | …/ontology/alignments.ttl |
EXTENDING.md |
how to add terms of your own, with a worked example | |
examples/deployment.ttl, examples/deployment-shapes.ttl |
that example: deployment facts and data classification | https://example.org/ontology/deployment |
All of them are published with the documentation site under https://caviri.github.io/c4-model-agentic-plugin/ontology/, so the namespaces resolve: https://caviri.github.io/c4-model-agentic-plugin/ontology/c4#Container opens the term reference at Container, and /ontology/c4.ttl downloads the Turtle. Version 0.1.0, Apache-2.0, like the rest of the repository.
Core and view¶
An architecture is described in two modules, in the spirit of BPMN's separation of model and Diagram Interchange, plus a module for its data (and c4h: describes how it all changes over time, c4us: the user stories told about it):
c4:(core) says what the architecture is: elements, relationships, scenarios and their steps, states, use cases, sources in the repository. This is what you query, merge with other graphs, or reason over.c4d:(data) says what data it keeps and moves: schemas, entities, fields, the references between them, relations, and which steps read and write what. It is architecture too (a consumer that dropsc4v:keeps it); it is a module of its own so that a graph without data does not need it.c4v:(view) says how the explorer shows it: the order of every list, grid positions inside a box, colours and dashed lines, icons, which boxes the map opens with, the pinned board, the legend, level names, toolbar texts, link templates. Everyc4v:property is an OWL annotation property, so a reasoner draws no conclusions from it.
A consumer that only cares about the architecture can drop every c4v: triple and lose nothing of its meaning. Recreating the page needs both.
The C4 levels as classes¶
| Level | C4 abstraction | Class | Explorer node type |
|---|---|---|---|
| 1 · System context | person | c4:Person |
person |
| 1 | software system | c4:SoftwareSystem, with c4:ExternalSystem (not yours) and c4:SiblingSystem (yours, outside the boundary) |
system, ext, sibling |
| 2 · Containers | container (an application or a data store) | c4:Container, with c4:DataStore |
container, store |
| 3 · Components | component | c4:Component |
component |
| 4 · Code | code element | c4:CodeElement |
code |
| owner + 1 | state of a lifecycle (beyond core C4) | c4:State |
state |
All of them are c4:Elements and carry their level as c4:level. Containment is dcterms:isPartOf (and dcterms:hasPart the other way); top-level elements are part of the c4:Model. The exported data writes every superclass out (a data store is typed c4:Element, c4:Container and c4:DataStore), so SPARQL without a reasoner and SHACL see the hierarchy.
classDiagram
direction LR
Element <|-- Person
Element <|-- SoftwareSystem
SoftwareSystem <|-- ExternalSystem
SoftwareSystem <|-- SiblingSystem
Element <|-- Container
Container <|-- DataStore
Element <|-- Component
Element <|-- CodeElement
Element <|-- State
Relationship <|-- Transition
Model --> Element : hasPart
Element --> Element : isPartOf / uses
Relationship --> Element : source / target
State --> State : transitionsTo
Scenario --> Step : hasStep
Step --> Element : source / target
Scenario --> Person : primaryActor
Element --> ImageObject : schema image
Element --> Variant : inVariant
Person, SoftwareSystem, Container, Component, CodeElement and State are pairwise disjoint, as are Element, Relationship, Model, Variant, Scenario and Step; so are ExternalSystem and SiblingSystem.
Relationships¶
Every relationship is a resource, c4:Relationship, with exactly one c4:source, one c4:target and a label (rdfs:label: what happens along it, such as POST /orders). c4:summaryLabel names the higher-level relationship it belongs to, which the explorer shows when both ends are folded into their containers. For quick queries the exporter also writes a shortcut triple, source c4:uses target.
Use cases: scenarios and steps¶
A c4:Scenario is a C4 dynamic diagram: numbered c4:Steps (c4:hasStep, ordered by schema:position), each a message from a c4:source element to a c4:target element, with a label and, for an answer, c4:isReply true. The explorer draws the same scenario as a collaboration diagram, a sequence diagram or a step table, at any level.
A scenario can also be read as a use case (beyond core C4, after Cockburn's template). All optional:
| Property | Model field | Meaning |
|---|---|---|
c4:primaryActor |
actor |
the person (c4:Person) whose goal it serves |
c4:goal |
goal |
what that person wants |
c4:trigger |
trigger |
the event that starts it |
c4:precondition |
preconditions |
what must hold before it starts, one value each |
c4:outcome |
outcome |
what holds when it has succeeded |
Each scenario also has a flow colour in the view module, c4v:tone (the model's color), used for its arrows and step numbers in the Dynamic view and for its steps painted on the map. It is written only when the model sets one; without it the explorer gives each scenario a distinct tone by order, so a graph without c4v:tone redraws the same colours.
Images¶
Elements, relationships, scenarios and steps can have pictures: a screenshot of what a user sees at a step, a diagram, a photo, or a mock-up. Each is a schema:ImageObject, linked with schema:image and described with schema.org where schema.org has the term, and with three core terms where it does not:
| Property | Model field | Meaning |
|---|---|---|
schema:contentUrl |
src |
its address: an http(s) IRI, or an xsd:anyURI literal for a path next to the model or a data: URI |
c4:altText |
alt |
the text alternative: what it shows, for readers who cannot see it (required) |
schema:caption |
caption |
the caption shown under it |
schema:creditText |
credit |
who made it, where it comes from |
c4:imageKind |
kind |
screenshot, diagram, photo or illustration |
c4:illustrative |
illustrative |
true for a mock-up or wireframe, not a capture of the real thing |
c4v:order |
(list position) | its place among the images of what it shows |
The images are part of what the graph describes, so a page recreated from the graph shows the same pictures (with their files next to the graph, or carried in it as data: URIs, which makes the graph large: see the explorer's RDF graph reference).
Icons¶
A box, an arrow, a scenario, a schema or an entity can carry a small icon: a glyph for what it is (a user, a queue, a bucket) or the logo of its technology. Icons are presentation, so they are in the view module:
| Term | Model field | Meaning |
|---|---|---|
c4v:icon |
icon |
the icon, as a reference: a built-in name (database), tabler:<name> (Tabler Icons, MIT), si:<slug> (a Simple Icons logo, CC0; the logo stays a trademark of its owner), the key of an icon definition, a file, an https URL or a data: URI |
c4v:iconColor |
iconColor |
brand (a logo in its own colours) or a tone |
c4v:IconDefinition |
an entry of icons |
an icon the model carries itself, linked from the model with c4v:iconDefinition: c4v:iconKey, c4v:svg (the markup, as a literal), rdfs:label, dcterms:source, dcterms:license |
c4v:iconStyle, c4v:showIcons |
view.icons, view.showIcons |
the page's default: mono or brand colours; false to open with icons hidden |
A library icon is named by its reference alone: the graph does not copy the SVG of a logo it can name, and the explorer's build fetches it again (pinned versions of Tabler Icons and Simple Icons). Vendor cloud icon sets (AWS, Azure, Google Cloud) are not open source and are never fetched. An icon says nothing a c4:technology does not: a consumer that wants to know what a container runs on reads c4:technology, not c4v:icon.
Data: schemas, entities, fields¶
The data module describes the data models a system keeps, drawn by the explorer's Data view: relational schemas, JSON Schemas and API payloads, ontologies, JSON-LD contexts, object-store key layouts, queue messages. A model without them exports no c4d: triple.
| Class | What | Model |
|---|---|---|
c4d:Schema |
a data model that lives somewhere: c4d:livesIn an element (a data store, a container, a component), with c4d:schemaKind (relational, document, json-schema, ontology, object-store, queue, api, other), c4d:format, c4d:namespace |
schemas[] |
c4d:Entity |
a table, view, class, object, enum, collection, document, bucket, message or type, c4d:inSchema its schema; c4d:entityKind when the model names it; c4d:definedBy the code elements that define it; c4d:represents the ontology term it stores |
entities[] |
c4d:Table (c4d:View), c4d:Enumeration |
the entity kinds that differ in structure; written for the kind in effect (the schema kind's default when the entity names none), so ?e a c4d:Table finds every table |
kind |
c4d:Field |
a column, property, attribute or key segment, c4d:inEntity its entity at schema:position: c4d:declaredType, c4d:isPrimaryKey, c4d:isRequired, c4d:isUnique, c4d:isMultiValued, c4d:defaultValue, c4d:allowedValue, c4d:references (an entity or a field: a foreign key, an object key, an id copied into a file, a job argument), c4d:isSoft, c4d:onDelete, c4d:holdsStateOf (the element whose lifecycle its values are) |
fields[] |
c4d:Index |
an index of an entity: c4d:indexFields (an rdf:List), c4d:isUnique |
indexes[] |
c4d:Relation |
a link between entities or fields that is not a field's own reference: c4d:from, c4d:to, c4d:relationKind (ref, contains, extends, maps, assoc), multiplicities, c4d:isSoft |
relations[] |
c4d:DataItem |
an entity or a field: what references, relations and c4d:reads / c4d:writes (on c4:Step and c4:Relationship) point at |
classDiagram
direction LR
DataItem <|-- Entity
DataItem <|-- Field
Entity <|-- Table
Table <|-- View
Entity <|-- Enumeration
Schema --> Element : livesIn
Entity --> Schema : inSchema
Field --> Entity : inEntity
Entity --> Index : hasIndex
Entity --> Element : definedBy
Field --> DataItem : references
Field --> Element : holdsStateOf
Relation --> DataItem : from / to
Step --> DataItem : reads / writes
Relationship --> DataItem : reads / writes
From the example project's graph, trimmed:
:dataschema:pg a c4d:Schema ;
rdfs:label "PostgreSQL schema" ;
c4d:schemaKind "relational" ;
c4d:livesIn :postgres .
:entity:tasks a c4d:DataItem, c4d:Entity, c4d:Table ;
rdfs:label "tasks" ;
c4d:inSchema :dataschema:pg ;
c4d:hasField :field:tasks.id, :field:tasks.image_id, :field:tasks.status ;
c4d:definedBy :models .
:field:tasks.image_id a c4d:DataItem, c4d:Field ;
c4d:inEntity :entity:tasks ;
schema:position 2 ;
rdfs:label "image_id" ;
c4d:declaredType "INTEGER" ;
c4d:isRequired true ; c4d:isUnique true ;
c4d:references :field:images.id ;
c4d:onDelete "cascade" .
:field:tasks.status a c4d:DataItem, c4d:Field ;
c4d:allowedValue "pending", "in_progress", "submitted", "approved", "rejected" ;
c4d:holdsStateOf :lifecycle .
:step:upload:17 c4d:writes :field:images.thumbnail_key, :field:images.width, :field:images.height .
Describing data, not being it. A table that stores annotations c4d:represents the ontology class iat:Annotation; it is not an instance or a subclass of it, and the mapping to CSVW (c4d:Table close to csvw:Schema, c4d:Field to csvw:Column), SHACL (node and property shapes) and OWL lives in alignments.ttl as SKOS mappings, never equivalences: a reasoner told that a table is an owl:Class would treat its rows as instances of it.
States and transitions¶
A lifecycle (the status of an order, a task) is a set of c4:States inside the element that owns it, one level below it. Moves between states are c4:Transitions, relationships whose ends are both states and whose label is the event; the shortcut is c4:transitionsTo. c4:initial and c4:final mark where the lifecycle starts and ends. States are an extension beyond core C4.
User stories¶
The user-stories skill writes its pages as graphs too, when asked (build-stories.mjs --rdf, stories-rdf.mjs, or the page's Download ▾ → Stories as an RDF graph), in the terms of c4-stories.ttl (c4us:). A c4us:UserStory is told for an actor (c4us:actor: the architecture's c4:Person, or a c4us:Persona), says what they want and why (c4us:want, c4us:soThat), covers a range of a scenario's steps (c4us:scenario, c4us:firstStep, c4us:lastStep, c4us:coversStep: the architecture graph's c4:Scenario and c4:Step resources), has acceptance criteria (c4us:AcceptanceCriterion, split into Given / when / then when written so), code references (c4us:CodeReference, with the core's c4:path and c4:line) and screens (c4us:Screen, seen at a c4:Step, each with one or more c4us:ScreenViews: desktop, tablet, phone). The stories graph uses the architecture graph's base, so loaded together, SPARQL follows a story to the steps it covers and on to the elements those steps touch.
Readers' notes (c4us:Note, with c4us:Pins) go into a graph only when its writer is asked for them, and the collection says so (c4us:withFeedback): they are people's words. The audio of a voice note never does; a note says that it has one, how long it is and the file it is extracted to. c4-stories-shapes.ttl checks a stories graph on its own; the merged graph still meets c4-shapes.ttl (a screen view is not a schema:ImageObject). The mapping, the IRIs and tested queries are in the user-stories skill's references/stories-graph.md.
An example¶
From the graph of the example project (examples/image-annotation-tool), trimmed. In Turtle the empty prefix : is the model's own base IRI.
@prefix c4: <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4#> .
@prefix c4v: <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-view#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix schema: <https://schema.org/> .
@prefix : <urn:architecture:image-annotation-tool:> .
:postgres a c4:Element, c4:Container, c4:DataStore ;
rdfs:label "PostgreSQL" ;
dcterms:identifier "postgres" ;
c4:tag "DATA STORE · POSTGRES 16" ;
c4:level 2 ;
c4:technology "PostgreSQL 16" ;
c4:path "db/migrations/001_init.sql" ;
dcterms:isPartOf :iat ;
c4v:order 8 ;
c4v:column 1 ;
c4v:row 1 .
:st-submitted a c4:Element, c4:State ;
rdfs:label "submitted" ;
c4:level 4 ;
dcterms:isPartOf :lifecycle ;
c4:transitionsTo :st-approved, :st-rejected .
:rel:35 a c4:Relationship, c4:Transition ;
c4:source :st-pending ;
c4:target :st-in-progress ;
rdfs:label "claim · annotator" ;
c4v:order 35 .
:scenario:annotate a c4:Scenario ;
rdfs:label "Annotate + submit" ;
c4:primaryActor :annotator ;
c4:goal "Get the next image annotated with labelled boxes and handed over for review." ;
c4:trigger "The annotator opens /annotate, which asks the API for the next task." ;
c4:outcome "The task is submitted with at least one box (an empty submit is refused with 422) and appears in the review queue." ;
c4:hasStep :step:annotate:1, :step:annotate:2, :step:annotate:3 .
:step:annotate:3 a c4:Step ;
c4:inScenario :scenario:annotate ;
schema:position 3 ;
c4:source :client ;
c4:target :claim-next ;
rdfs:label "POST /api/tasks/next" .
From the explorer to the graph and back¶
The mapping lives in one place, the template's <script id="rdf"> (window.archRdf), used by the page's export menu, its editor, and the build scripts. Field by field it is documented in the explorer's RDF graph reference (skills/architecture-explorer/references/rdf-graph.md), which also lists the few documented normalisations of the way back.
- Out: the page's
export ▾menu (JSON-LD, Turtle,.rete), the editor's download bar, andbuild-explorer.mjs, which writesarchitecture.jsonldandarchitecture.ttlnext to every page. - Back:
archRdf.fromTriples(triples)rebuilds the model;model-from-rdf.mjs graph.ttl model.jswrites it, andbuild-explorer.mjs graph.ttl index.htmlbuilds the page straight from a graph. - Your own terms: an
rdfobject on any node, edge or scenario, with the namespaces declared inMODEL.rdf.prefixes; see EXTENDING.md.
Validate with SHACL¶
c4-shapes.ttl checks what a graph must meet: one label, id, level (1–4) and parent per element; one address, one alt text and one owner per image; exactly one source and one target element and a label per relationship; position, source, target and scenario per step; containers inside software systems and components inside containers; transitions between states; a person as the primary actor; an order for everything the explorer lists; one icon per owner, a known icon colour, a key and an SVG per icon definition. For the data module: a kind and a place in the model per schema, one schema per entity, one entity and one position per field, references, relations, indexes, reads and writes that resolve to entities and fields of the graph, the known kinds, onDelete values and multiplicities, a lifecycle for c4d:holdsStateOf, values for an enumeration. It is SHACL Core without sh:or/sh:not, so every engine gives the same report.
// rete-graph (npm), in Node or the browser
const g = await rete.open(await rete.build(turtle, 'ttl'));
console.log(g.shacl(shapesTurtle)); // { conforms: true, results: [] }
Any SHACL engine works (Apache Jena shacl validate, TopBraid, RDF4J). The shapes need only the data graph: the exported data names its superclasses itself. A user stories graph is checked with c4-stories-shapes.ttl the same way (pyshacl -s c4-stories-shapes.ttl -df turtle stories.ttl).
Domain and range axioms in c4.ttl are few on purpose. They make a reasoner infer (anything that c4:uses something is a c4:Element), they never report an error. Checking is what the shapes are for.
Download and query¶
| Format | From |
|---|---|
Turtle .ttl |
the page's export menu, or architecture.ttl next to a built page |
JSON-LD .jsonld |
the same places |
.rete |
the export menu (fetches the builder once), or build-explorer.mjs with the rete CLI or the rete-graph package |
A .rete file is a whole graph in one file, queryable with SPARQL without a server:
rete build architecture.ttl -o architecture.rete
rete sparql architecture.rete 'PREFIX c4: <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?scenario ?actor WHERE { ?s a c4:Scenario ; rdfs:label ?scenario ; c4:primaryActor/rdfs:label ?actor }'
The RDF graph reference has tested queries: containers and their technologies, everything that depends on an element, what an element uses, the steps of a scenario, use cases, state transitions, elements nothing points at, the layout of a box, and for the data module where each table lives, which steps write a column of a table, the entities that store an ontology class, and every soft reference across stores.
Extending it¶
Add terms in a namespace of your own, never in c4:, c4d: or c4v:; prefer subclasses and subproperties; give every term a label, a definition and a source; ship SHACL shapes with them. EXTENDING.md says why and how, with a worked example from model fields to Turtle and a SPARQL query, and how to extend the data module (an entity kind of your own, a team's data dictionary).
Versioning¶
owl:versionInfo "0.1.0". Until 1.0, terms may still change; every change is listed here. From 1.0 on, each release gets an owl:versionIRI whose file stays published, and terms are deprecated (owl:deprecated true, dcterms:isReplacedBy) for at least one minor version before they go.
Added in 0.1.0, after the first publication (no term changed meaning): the user stories module c4-stories.ttl (c4us:, version 0.1.0) with its shapes c4-stories-shapes.ttl and SKOS mappings in alignments.ttl; the data module c4-data.ttl (c4d:, version 0.1.0); in the view module c4v:valueList, c4v:definedByList, c4v:readList and c4v:writeList, and c4v:order, c4v:column, c4v:row, c4v:tone, c4v:dashed, c4v:noteList, c4v:technologyList now also apply to schemas, entities, indexes and relations; in the shapes, a data module section and c4s:LineNeedsPathShape accepting a field's line in the file of its entity; in the history module, the element kinds schema, entity, field and relation. Icons, in the view module: the class c4v:IconDefinition and the properties c4v:icon, c4v:iconColor, c4v:iconDefinition, c4v:iconKey, c4v:svg, c4v:iconStyle and c4v:showIcons, with their shapes (c4s:IconShape, c4s:IconColorShape, c4s:IconDefinitionShape, and the model's view settings).
Changes from the earlier, unpublished vocabulary (arch: = urn:arch-explorer:vocab#, used by exports before 0.1.0):
| Before | Now | Why |
|---|---|---|
arch: Term |
c4: Term |
a published, dereferenceable namespace |
arch:step |
c4:hasStep |
a class and a property differed only in case (Step, step) |
arch:scenario |
c4:inScenario |
the same; pairs with c4:inVariant |
arch:reply |
c4:isReply |
a boolean reads as a flag |
arch:kind |
c4v:style |
a colour, not a classification; presentation belongs to the view module |
arch:dashed |
c4v:dashed |
presentation |
JSON-LD terms changed with them (kind → style, step → hasStep, scenario → inScenario, reply → isReply). Other differences: data stores are also typed c4:Container and external and sibling systems c4:SoftwareSystem; the model's dcterms:identifier, c4:branch and c4:variantDimension are written only when the model sets them; and everything in c4v:, the use-case properties and dcterms:conformsTo are new.
Design decisions¶
- IRIs on GitHub Pages. The namespace lives on the project's documentation site, so it resolves today with no other service: a term IRI opens its documentation. The trade-off: the IRIs depend on the repository's name and host, and GitHub Pages cannot do content negotiation (a client asking for Turtle at
…/ontology/c4gets HTML; the Turtle is at…/ontology/c4.ttl). A w3id.org redirect (such ashttps://w3id.org/c4-arch/) would give permanent IRIs and content negotiation, and is the step to take before 1.0; changing the namespace then is what the rename table is for. - Hash namespaces. All terms of a module are in one document, small enough to fetch whole;
…/c4#Containerneeds no server rule. - Mappings, not equivalences. Links to schema.org and others are SKOS mappings in a separate file.
owl:equivalentClasswould make a reasoner treat everyschema:SoftwareApplicationas ac4:SoftwareSystem, with all the C4 axioms. - Kinds as literals, classes where they earn it. Schema, entity and relation kinds are plain literals checked by the shapes (
c4d:schemaKind "relational"), written exactly as the model gives them, so the way back is lossless. Only the entity kinds with a structure of their own have classes (c4d:Table,c4d:View,c4d:Enumeration), written for the kind in effect, as the core writesc4:levelfrom the class. - Field order is part of the data. A table's column order is part of its definition (and of CSVW's), so a field's place is
schema:position, as a step's, notc4v:order. - Plain integers. Levels, lines, positions and orders are written as
xsd:integerliterals, so a SPARQL pattern such asc4:level 2matches; the OWL ranges (xsd:positiveInteger) still hold, and the shapes check the bounds.
Data module (c4d:)¶
The data section above is c4-data.ttl (prefix c4d:, namespace
https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data#). Every class and property is listed in the
data term reference; its shapes are the data module section of c4-shapes.ttl, and its
mappings to CSVW, SHACL, OWL / RDFS and DCAT are in alignments.ttl. Schemas and data
shows the explorer's Data view that the module describes, and how a model's data layer is written or imported.
History module (c4h:)¶
A third module describes an architecture over time: c4-history.ttl (prefix c4h:,
namespace https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-history#), with its SHACL shapes in
c4-history-shapes.ttl. Each version of a model is a named graph in the core and view terms;
c4h: and PROV-O say which commit, merge, release or pull request produced it and who it is attributed to, and RDF 1.2
reifiers describe every triple added or removed between two versions. The terms are listed in the
history term reference; History and diffs shows how the architecture-history
skill builds such datasets from git.
User stories module (c4us:)¶
c4-stories.ttl (prefix c4us:, namespace
https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-stories#) describes what the
user-stories skill tells about a system: stories, the personas they are told for, the part of a
scenario each covers, acceptance criteria and the code behind them, the screens seen at a step and their views, and,
only when asked for, readers' notes on those screens. Its graphs use the architecture graph's base, so the two load
together. Every term is in the user stories term reference; graphs are checked with
c4-stories-shapes.ttl; the mapping, the IRIs and tested queries are in
The stories as an RDF graph.
Source
This page is ontology/README.md in the repository. Every term is documented in the core term reference, the data term reference, the view term reference, the history term reference and the user stories term reference, generated from the Turtle files. Schemas and data shows the data module at work in the explorer.