# The C4 data ontology (data module) of c4-model-agentic-plugin.
#
# The data an architecture keeps and moves: schemas (a relational schema, a JSON Schema, an ontology, a JSON-LD
# context, an object-store key layout, queue messages, an API's payloads), the entities they define (tables, views,
# classes, objects, enumerations, buckets, messages …) with their fields, the identifiers that connect fields across
# entities and stores, and the relations between entities beyond those references. It ties that data to the rest of the
# architecture: a schema lives in an element of the map (a data store, a container, a component), an entity is defined
# by code elements, a field's values can be the states of a lifecycle, and the steps of a scenario (and relationships)
# say which entities and fields they read and write.
#
# Builds on the core module (c4.ttl, c4:). How the explorer draws the data (the order of lists, positions inside a
# schema's cluster, colours) is in the view module (c4-view.ttl, c4v:).
#
# Design rules, the same as the core module's:
#   - Domain and range axioms cause inference, not validation, so there are few of them, only where the conclusion is
#     always right. Checking a graph is the job of the SHACL shapes, "data module" section of c4-shapes.ttl.
#   - This module describes how a system keeps data, not the data itself, and not the terms it stores: an entity that
#     stores the ontology class iat:Annotation is linked to it with c4d:represents, never made owl:sameAs or a
#     subclass of it. A table described here is not an owl:Class, a field is not an rdf:Property.
#   - Reused terms keep their meaning (rdfs:label, dcterms:identifier, dcterms:description, dcterms:isPartOf,
#     schema:position, and the core's c4:path, c4:line, c4:link, c4:technology, c4:note); links to CSVW, SHACL, OWL,
#     DCAT and schema.org are SKOS mappings in alignments.ttl.
#   - Kinds are plain literals checked by the shapes (c4d:schemaKind, c4d:entityKind, c4d:relationKind), written as the
#     model gives them. Only the kinds whose entities differ in structure have a class (c4d:Table, c4d:View,
#     c4d:Enumeration); the exporter writes those classes for the kind in effect, so `?e a c4d:Table` finds every table,
#     also one whose kind is the default of its relational schema. Superclasses are written out (c4d:DataItem,
#     c4d:Entity), as in the core.

@prefix c4d:     <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data#> .
@prefix c4:      <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix schema:  <https://schema.org/> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#> .
@prefix vann:    <http://purl.org/vocab/vann/> .

<https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data>
    a owl:Ontology ;
    owl:imports <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4> ;
    dcterms:title "C4 data ontology"@en ;
    dcterms:description """Data module of the C4 architecture ontology: the schemas a software architecture keeps its data in (relational schemas, JSON Schemas, ontologies, JSON-LD contexts, object-store layouts, queue messages, API payloads), their entities and fields, the identifiers that connect fields across entities and stores, the relations between entities, where each schema lives in the architecture, the code that defines each entity, and what each scenario step reads and writes. The architecture explorer of c4-model-agentic-plugin exports its Data view in these terms; with the core and view modules the graph holds everything needed to redraw it."""@en ;
    dcterms:creator "caviri" ;
    dcterms:license <https://www.apache.org/licenses/LICENSE-2.0> ;
    dcterms:created "2026-11-25"^^xsd:date ;
    dcterms:modified "2026-11-25"^^xsd:date ;
    owl:versionInfo "0.1.0" ;
    vann:preferredNamespacePrefix "c4d" ;
    vann:preferredNamespaceUri "https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data#" ;
    rdfs:seeAlso <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data/> , <https://www.w3.org/TR/tabular-metadata/> ;
    skos:note """Pre-1.0: terms may still change. Changes are listed in the plugin's ontology README."""@en .

#################################################################
#  Reused terms, declared so that OWL 2 DL tools load the file
#################################################################

dcterms:title       a owl:AnnotationProperty .
dcterms:description a owl:AnnotationProperty .
dcterms:identifier  a owl:AnnotationProperty .
dcterms:source      a owl:AnnotationProperty .
dcterms:creator     a owl:AnnotationProperty .
dcterms:license     a owl:AnnotationProperty .
dcterms:created     a owl:AnnotationProperty .
dcterms:modified    a owl:AnnotationProperty .
dcterms:isPartOf    a owl:ObjectProperty .
schema:position     a owl:DatatypeProperty .
skos:definition     a owl:AnnotationProperty .
skos:scopeNote      a owl:AnnotationProperty .
skos:note           a owl:AnnotationProperty .
skos:example        a owl:AnnotationProperty .
vann:preferredNamespacePrefix a owl:AnnotationProperty .
vann:preferredNamespaceUri    a owl:AnnotationProperty .

#################################################################
#  Classes
#################################################################

c4d:Schema a owl:Class ;
    rdfs:label "Schema"@en ;
    skos:definition "A data model that lives somewhere in the architecture: the definition of the entities one store, container or component keeps, sends or receives. A relational schema, a JSON Schema, an ontology, a JSON-LD context, the key layout of an object store, the messages of a queue, the payloads of an API."@en ;
    rdfs:comment "Exported schemas carry dcterms:identifier (the model id), rdfs:label (the name), c4d:schemaKind, usually c4d:livesIn (the element it lives in), and dcterms:isPartOf the c4:Model. Its entities point at it with c4d:inSchema."@en ;
    dcterms:source <https://caviri.github.io/c4-model-agentic-plugin/reference/explorer-data-model/> ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:DataItem a owl:Class ;
    rdfs:label "Data item"@en ;
    skos:definition "An entity or one of its fields: what a field's reference, a relation, and a step's reads and writes point at. Abstract: every data item is also a c4d:Entity or a c4d:Field."@en ;
    rdfs:comment "Exists so that one constraint covers both (a reference may name a whole entity, its identifier, or one field), without logical constraints that some SHACL engines skip."@en ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:Entity a owl:Class ;
    rdfs:subClassOf c4d:DataItem ;
    rdfs:label "Entity"@en ;
    skos:definition "One kind of record a schema defines: a table or a view, an ontology class, a JSON object type, an enumeration, a document collection, a bucket and its key layout, a queue message, or another type. Its fields are c4d:Field resources in order."@en ;
    rdfs:comment "Its kind is c4d:entityKind when the model gives one; otherwise the default of its schema's kind (relational: table, ontology: class, json-schema, api and document: object, object-store: bucket, queue: message, other: type). An entity of kind enum lists c4d:allowedValue instead of fields."@en ;
    dcterms:source <https://caviri.github.io/c4-model-agentic-plugin/reference/explorer-data-model/> ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:Table a owl:Class ;
    rdfs:subClassOf c4d:Entity ;
    rdfs:label "Table"@en ;
    skos:definition "An entity that is a table of a relational database (or a view of one): rows of the same columns, with a primary key, foreign keys and indexes."@en ;
    rdfs:comment "Written for an entity whose kind in effect is table or view, so `?e a c4d:Table` finds the tables of a relational schema whether or not each names its kind."@en ;
    dcterms:source <https://www.w3.org/TR/tabular-metadata/#schemas> ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:View a owl:Class ;
    rdfs:subClassOf c4d:Table ;
    rdfs:label "View"@en ;
    skos:definition "A table defined by a query over other tables rather than stored: it can be read, and usually not written."@en ;
    dcterms:source <https://www.postgresql.org/docs/current/sql-createview.html> ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:Enumeration a owl:Class ;
    rdfs:subClassOf c4d:Entity ;
    rdfs:label "Enumeration"@en ;
    skos:definition "An entity that is a closed list of values (a SQL enum type, a JSON Schema enum, an OWL class given by owl:oneOf): it has c4d:allowedValue values instead of fields."@en ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

[] a owl:AllDisjointClasses ;
    owl:members ( c4d:Table c4d:Enumeration ) .

c4d:Field a owl:Class ;
    rdfs:subClassOf c4d:DataItem ;
    rdfs:label "Field"@en ;
    skos:definition "One named part of an entity: a column of a table, a property of an object or a class, an attribute, a segment of an object key, an argument of a message. Its place among the fields of its entity is schema:position."@en ;
    rdfs:comment "Its name (rdfs:label) is unique inside its entity and may contain a dot (a JSON path such as bbox.0). A field can reference an entity or another field (c4d:references): this field holds that entity's identifier, or that field's value."@en ;
    dcterms:source <https://www.w3.org/TR/tabular-metadata/#columns> ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:Index a owl:Class ;
    rdfs:label "Index"@en ;
    skos:definition "An index of an entity over some of its fields, in order, possibly unique: what a database keeps to find rows by those fields."@en ;
    dcterms:source <https://www.postgresql.org/docs/current/sql-createindex.html> ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:Relation a owl:Class ;
    rdfs:label "Relation"@en ;
    skos:definition "A link between two data items that is not a field's own reference: a reference declared apart (a composite or many-to-many key), a containment (a document embedding another), an extension (a subclass, allOf), a mapping (the same thing in another schema: a table and the ontology class it stores), or a named association (an ontology object property)."@en ;
    rdfs:comment "One c4d:from and one c4d:to (an entity or a field), c4d:relationKind (ref when absent: ref, contains, extends, maps, assoc), an optional label, multiplicities at both ends, and c4d:isSoft. A maps relation has no direction."@en ;
    dcterms:source <https://caviri.github.io/c4-model-agentic-plugin/reference/explorer-data-model/> ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

[] a owl:AllDisjointClasses ;
    owl:members ( c4d:Entity c4d:Field ) .

# data is not a box of the map, a relationship, a scenario or a step
[] a owl:AllDisjointClasses ;
    owl:members ( c4:Element c4:Relationship c4:Model c4:Variant c4:Scenario c4:Step c4d:Schema c4d:DataItem c4d:Index c4d:Relation ) .

#################################################################
#  Where the data lives, what defines it, what uses it
#################################################################

c4d:livesIn a owl:ObjectProperty ;
    rdfs:label "lives in"@en ;
    skos:definition "The element of the architecture a schema lives in: usually a data store (PostgreSQL, an object store, a queue), or a container or component for an API's payloads or an in-process format."@en ;
    # safe: only schemas live somewhere, and only in elements
    rdfs:domain c4d:Schema ;
    rdfs:range c4:Element ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:definedBy a owl:ObjectProperty ;
    rdfs:label "defined by"@en ;
    skos:definition "A code element (or component) that defines or maps the entity: the ORM class of a table, the Pydantic model of a payload, the SQL file, the job that writes a file."@en ;
    rdfs:comment "Not rdfs:isDefinedBy, which names the vocabulary a term belongs to."@en ;
    rdfs:domain c4d:Entity ;
    rdfs:range c4:Element ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:holdsStateOf a owl:ObjectProperty ;
    rdfs:label "holds state of"@en ;
    skos:definition "The element whose lifecycle the field's values are: the element that owns the c4:State elements those values name (tasks.status holds the state of the task lifecycle)."@en ;
    rdfs:domain c4d:Field ;
    rdfs:range c4:Element ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:reads a owl:ObjectProperty ;
    rdfs:label "reads"@en ;
    skos:definition "An entity (its rows, objects or messages) or a field that a scenario step, or a relationship in general, reads."@en ;
    rdfs:comment "On c4:Step and on c4:Relationship. Their order, for the page, is c4v:readList."@en ;
    # no domain: steps and relationships
    rdfs:range c4d:DataItem ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:writes a owl:ObjectProperty ;
    rdfs:label "writes"@en ;
    skos:definition "An entity or a field that a scenario step, or a relationship in general, writes: inserts, updates or deletes."@en ;
    rdfs:comment "On c4:Step and on c4:Relationship. Their order, for the page, is c4v:writeList."@en ;
    rdfs:range c4d:DataItem ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

#################################################################
#  Structure: schema → entity → field, indexes
#################################################################

c4d:hasEntity a owl:ObjectProperty ;
    rdfs:label "has entity"@en ;
    skos:definition "An entity the schema defines."@en ;
    owl:inverseOf c4d:inSchema ;
    rdfs:domain c4d:Schema ;
    rdfs:range c4d:Entity ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:inSchema a owl:ObjectProperty ;
    rdfs:label "in schema"@en ;
    skos:definition "The schema that defines the entity."@en ;
    rdfs:domain c4d:Entity ;
    rdfs:range c4d:Schema ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:hasField a owl:ObjectProperty ;
    rdfs:label "has field"@en ;
    skos:definition "A field of the entity. The order of the fields is their schema:position."@en ;
    owl:inverseOf c4d:inEntity ;
    rdfs:domain c4d:Entity ;
    rdfs:range c4d:Field ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:inEntity a owl:ObjectProperty ;
    rdfs:label "in entity"@en ;
    skos:definition "The entity the field belongs to."@en ;
    rdfs:domain c4d:Field ;
    rdfs:range c4d:Entity ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:hasIndex a owl:ObjectProperty ;
    rdfs:label "has index"@en ;
    skos:definition "An index of the entity."@en ;
    rdfs:domain c4d:Entity ;
    rdfs:range c4d:Index ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:indexFields a owl:ObjectProperty ;
    rdfs:label "index fields"@en ;
    skos:definition "The fields an index covers, as an rdf:List in their order (the order of a composite index matters to the database)."@en ;
    rdfs:domain c4d:Index ;
    rdfs:range rdf:List ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

#################################################################
#  Identifiers and links between data
#################################################################

c4d:references a owl:ObjectProperty ;
    rdfs:label "references"@en ;
    skos:definition "What the field's values identify: an entity (the field holds its identifier, the value of its primary key) or a field (the field holds that field's value). A foreign key, an object key stored in a table, an id copied into a JSON file, a job argument."@en ;
    rdfs:comment "The store may not enforce it: see c4d:isSoft. Multiplicities follow: from the field's side 0..1 when it is unique, else 0..*; at the target 1 when the field is required or a primary key, else 0..1."@en ;
    rdfs:domain c4d:Field ;
    rdfs:range c4d:DataItem ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:from a owl:ObjectProperty ;
    rdfs:label "from"@en ;
    skos:definition "The data item a relation starts from: the referencing, containing, extending or mapped one."@en ;
    rdfs:domain c4d:Relation ;
    rdfs:range c4d:DataItem ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:to a owl:ObjectProperty ;
    rdfs:label "to"@en ;
    skos:definition "The data item a relation goes to: the referenced, contained, extended or mapped one."@en ;
    rdfs:domain c4d:Relation ;
    rdfs:range c4d:DataItem ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:represents a owl:AnnotationProperty ;
    rdfs:label "represents"@en ;
    skos:definition "The term an entity or a field is when it comes from an ontology or a JSON-LD context (an OWL class, an RDF property, a JSON-LD term's IRI), or the $id of a JSON Schema: an IRI, or an xsd:anyURI literal for a relative reference such as #/definitions/image."@en ;
    rdfs:comment "An annotation property, because its value is an IRI or a literal, and because it must not make the entity the term: never owl:sameAs or owl:equivalentClass. A table that stores annotations represents iat:Annotation; it is not an instance or a subclass of it."@en ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

#################################################################
#  Datatype properties: schemas
#################################################################

c4d:schemaKind a owl:DatatypeProperty ;
    rdfs:label "schema kind"@en ;
    skos:definition "What sort of data model a schema is: relational, document, json-schema, ontology, object-store, queue, api or other. It decides the default kind of its entities and how the explorer names them (table, class, object)."@en ;
    rdfs:domain c4d:Schema ;
    rdfs:range xsd:string ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:format a owl:DatatypeProperty ;
    rdfs:label "format"@en ;
    skos:definition "The language the schema's source is written in: sql, json-schema, openapi, owl, rdfs, shacl, jsonld-context, prisma, graphql, protobuf, avro, orm, or another."@en ;
    rdfs:comment "A free string; the values listed are the known ones. Not dcterms:format, which is a media type or extent."@en ;
    rdfs:domain c4d:Schema ;
    rdfs:range xsd:string ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:namespace a owl:DatatypeProperty ;
    rdfs:label "namespace"@en ;
    skos:definition "For an ontology or a JSON-LD context: the namespace IRI its classes and properties live in, as an xsd:anyURI literal (a namespace is not a resource of its own)."@en ;
    skos:example "https://example.org/iat#"^^xsd:anyURI ;
    rdfs:domain c4d:Schema ;
    rdfs:range xsd:anyURI ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

#################################################################
#  Datatype properties: entities and fields
#################################################################

c4d:entityKind a owl:DatatypeProperty ;
    rdfs:label "entity kind"@en ;
    skos:definition "What sort of entity it is, when the model says so: table, view, class, object, enum, collection, document, bucket, message or type. Without it, the default of its schema's kind applies."@en ;
    rdfs:domain c4d:Entity ;
    rdfs:range xsd:string ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:declaredType a owl:DatatypeProperty ;
    rdfs:label "declared type"@en ;
    skos:definition "The type of a field as its source writes it: INTEGER, TEXT, TIMESTAMPTZ, string, number[], xsd:dateTime, iat:Label."@en ;
    rdfs:comment "A string, never interpreted: types of different languages do not map one to one."@en ;
    rdfs:domain c4d:Field ;
    rdfs:range xsd:string ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:isPrimaryKey a owl:DatatypeProperty ;
    rdfs:label "is primary key"@en ;
    skos:definition "True for a field that is (part of) the identifier of its entity: a table's primary key, an @id, an object key. Written only when true."@en ;
    rdfs:domain c4d:Field ;
    rdfs:range xsd:boolean ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:isRequired a owl:DatatypeProperty ;
    rdfs:label "is required"@en ;
    skos:definition "True for a field that always has a value: NOT NULL, listed in a JSON Schema's required, sh:minCount 1. A primary key is required without saying so. Written only when true."@en ;
    rdfs:domain c4d:Field ;
    rdfs:range xsd:boolean ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:isUnique a owl:DatatypeProperty ;
    rdfs:label "is unique"@en ;
    skos:definition "True for a field whose values are unique among the records of its entity (UNIQUE), or for an index that enforces uniqueness. Written only when true."@en ;
    # no domain: fields and indexes
    rdfs:range xsd:boolean ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:isMultiValued a owl:DatatypeProperty ;
    rdfs:label "is multi-valued"@en ;
    skos:definition "True for a field that holds a list: a JSON array, a property with sh:maxCount above 1, a to-many property. Written only when true."@en ;
    rdfs:domain c4d:Field ;
    rdfs:range xsd:boolean ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:defaultValue a owl:DatatypeProperty ;
    rdfs:label "default value"@en ;
    skos:definition "The value a field gets when none is given, as its source writes it: now(), 'pending', 0."@en ;
    rdfs:comment "A string as written, or a number or boolean when the model gives one."@en ;
    rdfs:domain c4d:Field ;
    rdfs:range rdfs:Literal ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:allowedValue a owl:DatatypeProperty ;
    rdfs:label "allowed value"@en ;
    skos:definition "One of the values a field may take (CHECK … IN, a JSON enum, sh:in), or one value of an enumeration. One triple per value; their order, for the page, is c4v:valueList."@en ;
    # no domain: fields and enumerations
    rdfs:range rdfs:Literal ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:referenceLabel a owl:DatatypeProperty ;
    rdfs:label "reference label"@en ;
    skos:definition "What the line of a field's reference says in the Data view: uploaded by, object key."@en ;
    rdfs:domain c4d:Field ;
    rdfs:range xsd:string ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:isSoft a owl:DatatypeProperty ;
    rdfs:label "is soft"@en ;
    skos:definition "Whether the store leaves a reference unenforced: true for a key into another store, an id copied into a file, a job argument; false for a reference the database checks (a foreign key). Written as the model gives it, false included."@en ;
    rdfs:comment "Without it, a reference within one schema is enforced and a reference across two schemas is soft: a reference that crosses schemas and is enforced all the same says false."@en ;
    # no domain: fields and relations
    rdfs:range xsd:boolean ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:onDelete a owl:DatatypeProperty ;
    rdfs:label "on delete"@en ;
    skos:definition "What the store does to the referencing record when the referenced one is deleted: cascade, set null, restrict, no action or set default."@en ;
    rdfs:domain c4d:Field ;
    rdfs:range xsd:string ;
    dcterms:source <https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK> ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

#################################################################
#  Datatype properties: relations
#################################################################

c4d:relationKind a owl:DatatypeProperty ;
    rdfs:label "relation kind"@en ;
    skos:definition "What a relation means, when the model says so: ref (holds or uses the identifier of: the default), contains (composition, nesting, a document embedding another), extends (a subclass, allOf, inheritance), maps (the same thing in another schema; no direction) or assoc (a named association, an ontology object property)."@en ;
    rdfs:domain c4d:Relation ;
    rdfs:range xsd:string ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:fromCardinality a owl:DatatypeProperty ;
    rdfs:label "from cardinality"@en ;
    skos:definition "How many of the relation's from side take part, for one of the other side: 1, 0..1, 0..* (also written *) or 1..*."@en ;
    rdfs:domain c4d:Relation ;
    rdfs:range xsd:string ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .

c4d:toCardinality a owl:DatatypeProperty ;
    rdfs:label "to cardinality"@en ;
    skos:definition "How many of the relation's to side take part, for one of the other side: 1, 0..1, 0..* (also written *) or 1..*."@en ;
    rdfs:domain c4d:Relation ;
    rdfs:range xsd:string ;
    rdfs:isDefinedBy <https://caviri.github.io/c4-model-agentic-plugin/ontology/c4-data> .
