OWL Generation#
The publish-owl command generates OWL/RDF
from a COGS model. It writes the graph as standards-compliant W3C Turtle to one
UTF-8 file named <Settings.Slug>.ttl (media type text/turtle). RDF/XML
and a compatibility .owl copy are not generated.
Important
OWL/RDF is the authoritative COGS ontology and class-semantics output, with
the two explicit authority exceptions documented under OWL2002 and
OWL2003 below. It is not a JSON/XML serialization or instance-validation
schema. Collection order and unsupported lexical facets remain within the
generated JSON Schema and XSD instance contracts.
The canonical capability list and diagnostic ranges are in Publisher Conformance and Projections.
Mapping#
item types and composite types map to classes whose RDF local names retain the exact PascalCase COGS type name, with
rdfs:subClassOfpreserving COGS inheritanceevery exact property name maps to one shared camelCase property IRI; no owning-class prefix is added, and its
rdfs:labelretains the exact COGS property namerelationships map to object properties and primitive-valued properties map to datatype properties;
langStringmaps tordf:langStringcogsDatemaps to a datatype union ofxsd:dateTime,xsd:date,xsd:gYearMonth,xsd:gYear, andxsd:duration; each instance literal uses its active arm’s XSD datatypeeach local property declaration maps to an
owl:allValuesFromrestriction, and cardinalities map to separate qualified OWL restrictions, attached to the owning class throughrdfs:subClassOfroot item identification fields map to
owl:hasKeysupported lexical facets map to OWL datatype restrictions; an enumeration combined with other supported facets becomes a data-range intersection
namespace and version metadata come from model settings unless overridden
Calendar datatype domains#
OWL ranges retain the native XSD datatype IRIs and RDF instances use typed XSD
literals. COGS limits the calendar year of dateTime, date,
gYearMonth, and gYear to a nonzero signed 32-bit integer. OWL 2 DL
cannot express that local component restriction uniformly for these XSD
datatypes, so generated runtimes and COGS instance validation enforce it.
This is an instance lexical-domain boundary, not an additional exception to
OWL’s authority over the modeled ontology and class semantics.
RDF term naming#
COGS uses one naming contract anywhere a publisher emits or identifies an RDF
model term. Class terms retain the exact COGS type name, so Recipe maps to
<https://example.org/model#Recipe>. Property terms use word-aware camelCase,
so Shade maps to <https://example.org/model#shade>. Acronym boundaries
are handled as words: ID becomes id, URLValue becomes urlValue,
XMLPrefix becomes xmlPrefix, and DDIMaintenanceAgencyID becomes
ddiMaintenanceAgencyId. Separators are word boundaries, so Display-Name
becomes displayName. COGS does not append language-keyword escapes to RDF
terms.
The effective RDF term base retains a namespace that already ends in # or
/; otherwise COGS appends #. The command’s namespace override follows
the same rule. This convention affects RDF terms only. Exact JSON and XML wire
names, generated class names, and source CSV names remain unchanged.
Distinct COGS names are not aliases merely because they camelize alike. Normal
DTO validation reports COGS-VAL-PROP-008 when, for example, URLValue
and UrlValue would both produce urlValue anywhere in identification,
an identification mixin, an item, or a composite. Direct OWL publication of a
manually connected model repeats this guard as OWL1002 before opening the
publication transaction. No legacy PascalCase property aliases are emitted.
Turtle presentation and semantic repeatability#
Restrictions are anonymous RDF resources. The Turtle writer places them inline
among the owning class’s rdfs:subClassOf values, keeping the constraint next
to the class it describes. For example, a local range and a separate
cardinality constraint can be read directly from one class definition:
:Recipe a owl:Class ;
rdfs:subClassOf
[ a owl:Restriction ;
owl:onProperty :shade ;
owl:allValuesFrom xsd:string ;
rdfs:comment "Shade used by this recipe." ] ,
[ a owl:Restriction ;
owl:onProperty :shade ;
owl:onDataRange xsd:string ;
owl:qualifiedCardinality 1 ] .
COGS generates the same standards-compliant semantic RDF graph on every run.
An RDF blank-node label is local serialization notation rather than the
identity of a restriction. Prefix aliases, triple order, and Turtle formatting
likewise do not change the graph. The regeneration gate therefore parses both
Turtle artifacts and requires strict RDF graph isomorphism. It checks ground
triples exactly, partitions anonymous-node triples into blank-node-connected
components, and matches those components with dotNetRDF Graph.Equals. This
avoids a pathological whole-graph search for large ontologies with many
independent restrictions without weakening equality. A changed IRI, literal,
datatype, language tag, restriction comment, cardinality, or blank-node
subgraph fails that comparison even when the Turtle text remains syntactically
valid. Non-Turtle generated artifacts continue to be compared byte-for-byte.
OWL2002: property-local subtype exclusion#
COGS applies AllowSubtypes to each property. A property that declares a
concrete item or composite base with AllowSubtypes blank or false
accepts exactly that declared type even when the base has descendants. The
descendants remain valid types elsewhere in the model; the exclusion applies
only at that property.
An OWL object-property range of a base class also accepts instances of its
subclasses. A qualified cardinality restriction on that same base class does
not make the class exact. Closing the property to the base itself would require
negative or complement axioms over a currently known descendant set, which is
not the open-world, extensible class contract emitted by COGS. The publisher
therefore retains the authoritative declared range and emits OWL2002 to
identify the one local rule it cannot enforce.
For example, DDI Lifecycle declares the following property (columns not relevant to the example are omitted):
Property |
Data type |
Cardinality |
|
|---|---|---|---|
|
|
|
blank ( |
CodeValueType has concrete descendants including CountryCodeType,
KindOfDataType, and ContentDateOffsetType. COGS accepts exactly
CodeValueType at
WeightingMethodology.TypeOfWeightingMethodology. The OWL range is
CodeValueType, so normal subclass semantics also admit those descendants.
When the exact controlled-vocabulary value is intended, leave
AllowSubtypes blank or false and retain the warning as the explicit OWL
exception. Set AllowSubtypes=true only when descendant values are genuinely
valid; do not broaden the COGS model merely to silence OWL2002. JSON Schema,
XSD, and the generated runtimes continue to enforce the property-local rule.
OWL2003: abstract direct instances#
COGS abstract item and composite types cannot be instance discriminators. OWL
has no native abstract-class modifier: declaring a resource as an owl:Class
and giving it subclasses does not require every member to be known as a member
of one of those subclasses. Under open-world semantics, more information or
additional subclasses may always exist.
DDI Lifecycle illustrates this with the abstract item Agent. It is the base
class for the concrete items Individual and Organization:
Agent (Abstract)
|-- Individual
`-- Organization
COGS forbids a full item whose discriminator is Agent. OWL correctly states
that every Individual and Organization is an Agent, but it cannot
enforce that every Agent is known to be one of those current concrete
descendants without closing the class to a fixed union. The publisher preserves
the class and inheritance axioms and emits OWL2003 for this exception.
Do not remove Abstract merely to silence the warning. OWL2003 records an
expected difference between the closed COGS instance rule and OWL’s open-world
class semantics; it does not indicate a malformed model or failed publication.
Native scalar restrictions#
Local datatype ranges include safe-integer limits. OWL2007 discloses
that decimal interchange stability and temporal precision require COGS
validation. These lexical constraints remain outside OWL class authority.