@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .

@prefix vann: <http://purl.org/vocab/vann/> .
@prefix voaf: <http://purl.org/vocommons/voaf#> .
@prefix dce:  <http://purl.org/dc/elements/1.1/> .
@prefix dct:  <http://purl.org/dc/terms/> .
@prefix widoco:	<https://w3id.org/widoco/vocab#>.

@base          <https://w3id.org/fm/thing/ontology#> .
@prefix :      <https://w3id.org/fm/thing/ontology#> .
@prefix thing: <https://w3id.org/fm/thing/ontology#> .

#################################################################
#    Thing ontology
#################################################################

<https://w3id.org/fm/thing/ontology> 
    rdf:type owl:Ontology ;
    vann:preferredNamespaceUri    "https://w3id.org/fm/thing/ontology#" ;
    vann:preferredNamespacePrefix "thing" ;
    owl:versionIRI <https://w3id.org/fm/thing/ontology/1.0.0>;
    owl:versionInfo "1.0.0" ;
    rdfs:label "The Thing Ontology"@en ;
    rdfs:comment "A core ontology for production related concepts";
    dct:created  "2025-11-01"^^xsd:date ;
    dct:modified "2026-01-08"^^xsd:date ;
    dct:issued   "2026-01-08"^^xsd:date ;
    dce:title "The Thing Ontology"@en ;
    dct:subject "top"@en;

    dce:abstract '''
The core Ontology for production related concepts (Product, Process, Resource). It provides
2 ubiquitous aspects: hierarchical structure and type-instance relationship.
An Entity is an object in the application domain. A SubEntity represents a child in the 
hierarchical structure. A Definition represents a type in the type-instance relationship.
'''@en;

    widoco:introduction '''
The ontology supports 2 transversal aspects
- **hierarchy** (or parent-child relationship):
  - things (elements) are composed of sub-things (sub-elements)
- **definition** (or type instance relationship):
  - things (entities) are defined by other things (definitions)

Hiearchy can be for instance:
- for a Product, its parts, which are typically reified relations to other (sub) Products
- for a Process, its steps, which are typically reified relations to other (sub) Processes

Definitions can be for instance:
- for a Product, its design, or its make
- for a Product with variability, values for the variation points
- for a Process excution, a reusable description of the things to be performed.
'''@en;

    dce:description '''
The following concepts are formalized:
- an **Entity** is an instance
- a **Definition** is information common to a set of instances
- a **SubEntity** is a (reified) reference to a child of the Entity

```mermaid
classDiagram
    class Entity  
    class Definition:::definition 
    class SubDefinition:::definition 

    Entity o-- SubEntity: subEntity
    Definition o-- SubDefinition: subDefinition
    Definition --|> Entity
    SubDefinition --|> SubEntity
    Entity --> Definition : entityDefinition
    SubEntity --> Entity : subEntityEntity
    SubDefinition --> Definition : subDefinitionDefinition
    SubEntity --> SubDefinition : subEntityDefinition

    classDef default fill:#f96,color:black
    classDef definition fill:#e9edc9,color:black
```
'''@en.  

# entities
thing:Entity
    rdf:type owl:Class;
    rdfs:comment '''An Entity is something either with a parent-child relationship, or with a definition relationship, or with both'''@en.

thing:SubEntity
    rdf:type owl:Class;
    rdfs:comment '''An SubEntity is the reified parent-child relationship: it represents a child of some parent Entity (but is not the child)'''@en.

thing:subEntity
    rdf:type owl:ObjectProperty;
    rdfs:domain thing:Entity;
    rdfs:range thing:SubEntity.

thing:subEntityEntity
    rdf:type owl:ObjectProperty;
    rdf:type owl:FunctionalProperty;
    rdfs:domain thing:SubEntity;
    rdfs:range thing:Entity.

thing:hasSubEntity
    rdf:type owl:ObjectProperty;
    rdfs:domain thing:Entity;
    rdfs:range thing:Entity;
    owl:propertyChainAxiom (
         thing:subEntity 
         thing:subEntityEntity
    ).

# definitions
thing:entityDefinition 
    rdf:type owl:ObjectProperty;
    rdfs:domain thing:Entity;
    rdfs:range thing:Definition;
    rdfs:comment '''The definition(s) associated witht the subject entity'''@en.

thing:Definition
    rdf:type owl:Class;
    rdfs:subClassOf thing:Entity; # a Definition can be defined (by a meta Definition); is this feature useful?
    rdfs:comment '''A Definition is some data shared by a group of Entities, describing (defining) some aspect common to these entities'''@en.

thing:subEntityDefinition 
    rdf:type owl:ObjectProperty;
    rdfs:domain thing:SubEntity;
    rdfs:range thing:SubDefinition;
    rdfs:comment '''The definition(s) associated witht the subject entity'''@en.

thing:SubDefinition
    rdf:type owl:Class;
    rdfs:subClassOf thing:SubEntity;
    rdfs:comment '''An SubDefinition is the reified parent-child relationship: it represents a child of some parent Definition (but is not the child)'''@en.

thing:subDefinition
    rdf:type owl:ObjectProperty;
    rdfs:subPropertyOf thing:subEntity;
    rdfs:domain thing:Definition;
    rdfs:range thing:SubDefinition.

thing:subDefinitionDefinition
    rdf:type owl:ObjectProperty;
    rdfs:subPropertyOf thing:subEntityEntity;
    rdf:type owl:FunctionalProperty;
    rdfs:domain thing:SubDefinition;
    rdfs:range thing:Definition.

thing:hasSubDefinition
    rdf:type owl:ObjectProperty;
    rdfs:subPropertyOf thing:hasSubEntity;
    rdfs:domain thing:Definition;
    rdfs:range thing:Definition;
    owl:propertyChainAxiom (
         thing:subDefinition 
         thing:subDefinitionDefinition
    ).

# Serialization annotations added by generate_docs.py
<https://w3id.org/fm/thing/ontology>
    <https://w3id.org/widoco/vocab#turtleSerialization> "thing.ttl" ;
    <https://w3id.org/widoco/vocab#rdfxmlSerialization> "thing.rdf" ;
    <https://w3id.org/widoco/vocab#ntSerialization> "thing.nt" ;
    <https://w3id.org/widoco/vocab#jsonldSerialization> "thing.jsonld" .
