Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.
Rust ai-nativedescription-logicsformal-verificationinfrastructure-as-codeisabelle-languageknowledge-graphleanlean4mcpmcp-serverontologyowlowl2reasoningrustshaclsparqltheorem-proving
# MIT License
#
# Copyright (c) 2025
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# baseURI: http://example.org/ontology/boro-building-ai
#
# AI-generated BORO/4D building ontology.
# Same domain coverage as the hand-crafted version, but with pragmatic
# simplifications: fewer intermediate classes, direct relationships,
# valid 4D patterns without bureaucratic overhead.
@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 vann: <http://purl.org/vocab/vann/> .
@prefix ies: <http://ies.data.gov.uk/ontology/ies4#> .
@prefix boroa: <http://example.org/ontology/boro-building-ai#> .
# ============================================================================
# Ontology
# ============================================================================
<http://example.org/ontology/boro-building-ai> a owl:Ontology ;
rdfs:label "BORO Building Domain (AI-generated)"^^xsd:string ;
rdfs:comment "AI-generated 4D building ontology. Covers the same domain as the hand-crafted version but with pragmatic simplifications: Entity+State pairs only where temporal variation matters, no speculative ClassOf hierarchies, and fewer intermediate abstractions."^^xsd:string ;
owl:imports <http://ies.data.gov.uk/ontology/ies4> ;
dcterms:title "BORO Building Domain (AI-generated)"^^xsd:string ;
dcterms:description "Pragmatic 4D building ontology generated by Claude."^^xsd:string ;
dcterms:license <https://opensource.org/licenses/MIT> ;
vann:preferredNamespacePrefix "boroa"^^xsd:string ;
vann:preferredNamespaceUri "http://example.org/ontology/boro-building-ai#"^^xsd:string .
# ============================================================================
# Entities and their States
# Only Entity+State pairs where temporal variation is genuinely needed.
# BuildingElement subtypes (Wall, Roof, Window, Door) are omitted as
# separate entities -- they are modelled as part-of relationships from
# Building, with classification via ies:similarEntity where needed.
# ============================================================================
boroa:Building a rdfs:Class ;
rdfs:label "Building"^^xsd:string ;
rdfs:comment "A permanent man-made structure. Whole-life 4D individual."^^xsd:string ;
rdfs:subClassOf ies:Facility, ies:Asset .
boroa:BuildingState a rdfs:Class ;
rdfs:label "Building State"^^xsd:string ;
rdfs:comment "A temporal part of a Building."^^xsd:string ;
rdfs:subClassOf ies:State .
boroa:Floor a rdfs:Class ;
rdfs:label "Floor"^^xsd:string ;
rdfs:comment "A storey within a Building."^^xsd:string ;
rdfs:subClassOf ies:PartOfFacility .
boroa:Room a rdfs:Class ;
rdfs:label "Room"^^xsd:string ;
rdfs:comment "An enclosed space within a Building."^^xsd:string ;
rdfs:subClassOf ies:PartOfFacility .
boroa:RoomState a rdfs:Class ;
rdfs:label "Room State"^^xsd:string ;
rdfs:comment "A temporal part of a Room, capturing time-varying properties like occupancy or function."^^xsd:string ;
rdfs:subClassOf ies:State .
boroa:Dwelling a rdfs:Class ;
rdfs:label "Dwelling"^^xsd:string ;
rdfs:comment "A self-contained residential unit, which may be a whole Building or part of one."^^xsd:string ;
rdfs:subClassOf ies:PartOfFacility .
boroa:DwellingState a rdfs:Class ;
rdfs:label "Dwelling State"^^xsd:string ;
rdfs:comment "A temporal part of a Dwelling."^^xsd:string ;
rdfs:subClassOf ies:State .
# ============================================================================
# Events
# ============================================================================
boroa:OccupancyEvent a rdfs:Class ;
rdfs:label "Occupancy Event"^^xsd:string ;
rdfs:comment "The start or end of occupancy of a Dwelling or Room."^^xsd:string ;
rdfs:subClassOf ies:Event .
boroa:ConstructionEvent a rdfs:Class ;
rdfs:label "Construction Event"^^xsd:string ;
rdfs:comment "The construction of a Building."^^xsd:string ;
rdfs:subClassOf ies:Event .
boroa:DemolitionEvent a rdfs:Class ;
rdfs:label "Demolition Event"^^xsd:string ;
rdfs:comment "The demolition of a Building."^^xsd:string ;
rdfs:subClassOf ies:Event .
boroa:RenovationEvent a rdfs:Class ;
rdfs:label "Renovation Event"^^xsd:string ;
rdfs:comment "A renovation or refurbishment of a Building or Dwelling."^^xsd:string ;
rdfs:subClassOf ies:Event .
# ============================================================================
# BoundingStates
# Only the essential lifecycle markers. OccupiedState/VacatedState are
# handled via OccupancyEvent + generic ies:BoundingState rather than
# dedicated subclasses.
# ============================================================================
boroa:ConstructedState a rdfs:Class ;
rdfs:label "Constructed State"^^xsd:string ;
rdfs:comment "Marks the beginning of a Building's existence."^^xsd:string ;
rdfs:subClassOf ies:BoundingState .
boroa:DemolishedState a rdfs:Class ;
rdfs:label "Demolished State"^^xsd:string ;
rdfs:comment "Marks the end of a Building's existence."^^xsd:string ;
rdfs:subClassOf ies:BoundingState .
# ============================================================================
# Object Properties
# Direct relationships without intermediate proxy classes.
# ============================================================================
boroa:containsFloor a owl:ObjectProperty ;
rdfs:label "contains Floor"^^xsd:string ;
rdfs:comment "A Building contains this Floor."^^xsd:string ;
rdfs:domain boroa:Building ;
rdfs:range boroa:Floor ;
rdfs:subPropertyOf ies:isPartOf .
boroa:containsRoom a owl:ObjectProperty ;
rdfs:label "contains Room"^^xsd:string ;
rdfs:comment "A Floor contains this Room."^^xsd:string ;
rdfs:domain boroa:Floor ;
rdfs:range boroa:Room ;
rdfs:subPropertyOf ies:isPartOf .
boroa:containsDwelling a owl:ObjectProperty ;
rdfs:label "contains Dwelling"^^xsd:string ;
rdfs:comment "A Building contains this Dwelling."^^xsd:string ;
rdfs:domain boroa:Building ;
rdfs:range boroa:Dwelling ;
rdfs:subPropertyOf ies:isPartOf .
boroa:occupiedBy a owl:ObjectProperty ;
rdfs:label "occupied By"^^xsd:string ;
rdfs:comment "The Person occupying a Dwelling during this state."^^xsd:string ;
rdfs:domain boroa:DwellingState ;
rdfs:range ies:Person ;
rdfs:subPropertyOf ies:relationship .
boroa:targetOfRenovation a owl:ObjectProperty ;
rdfs:label "target Of Renovation"^^xsd:string ;
rdfs:comment "The Building or Dwelling targeted by a renovation."^^xsd:string ;
rdfs:domain boroa:RenovationEvent ;
rdfs:range boroa:Building ;
rdfs:subPropertyOf ies:relationship .
# ============================================================================
# Datatype Properties
# ============================================================================
boroa:floorArea a owl:DatatypeProperty ;
rdfs:label "floor Area"^^xsd:string ;
rdfs:comment "Floor area in square metres."^^xsd:string ;
rdfs:domain boroa:Room ;
rdfs:range xsd:decimal ;
rdfs:subPropertyOf ies:attribute .
boroa:yearConstructed a owl:DatatypeProperty ;
rdfs:label "year Constructed"^^xsd:string ;
rdfs:comment "Year the Building was constructed."^^xsd:string ;
rdfs:domain boroa:Building ;
rdfs:range xsd:gYear ;
rdfs:subPropertyOf ies:attribute .
boroa:numberOfFloors a owl:DatatypeProperty ;
rdfs:label "number Of Floors"^^xsd:string ;
rdfs:comment "Number of above-ground storeys."^^xsd:string ;
rdfs:domain boroa:Building ;
rdfs:range xsd:integer ;
rdfs:subPropertyOf ies:attribute .
# ============================================================================
# Named Individuals
# Use ies:similarEntity to classify without creating ClassOf hierarchies.
# Room types, building types, etc. are handled via ies:similarEntity
# pointing to well-known individuals rather than via powertype classes.
# ============================================================================
boroa:DetachedHouse a ies:ClassOfEntity ;
rdfs:label "Detached House"^^xsd:string .
boroa:SemiDetachedHouse a ies:ClassOfEntity ;
rdfs:label "Semi-Detached House"^^xsd:string .
boroa:TerracedHouse a ies:ClassOfEntity ;
rdfs:label "Terraced House"^^xsd:string .
boroa:FlatBlock a ies:ClassOfEntity ;
rdfs:label "Flat / Apartment Block"^^xsd:string .
boroa:Kitchen a ies:ClassOfEntity ;
rdfs:label "Kitchen"^^xsd:string .
boroa:Bathroom a ies:ClassOfEntity ;
rdfs:label "Bathroom"^^xsd:string .
boroa:Bedroom a ies:ClassOfEntity ;
rdfs:label "Bedroom"^^xsd:string .
boroa:LivingRoom a ies:ClassOfEntity ;
rdfs:label "Living Room"^^xsd:string .