@prefix : <https://relay.inferal.com/ontology/typespec/versioning/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix mod: <https://w3id.org/mod#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pubacc: <https://ontology.inferal.com/modules/publication-access/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

:
    a owl:Ontology, pubacc:PublicationManagedOntology ;
    dcterms:accessRights pubacc:PublicAccess ;
    dcterms:title "TypeSpec Versioning Ontology" ;
    dcterms:description "RDFS vocabulary for representing TypeSpec API version chains and version-change annotations in RDF emitted by Inferal Relay." ;
    dcterms:license <https://creativecommons.org/licenses/by/4.0/> ;
    dcterms:source <https://relay.inferal.com/specs/> ;
    vann:preferredNamespacePrefix "tspv" ;
    vann:preferredNamespaceUri "https://relay.inferal.com/ontology/typespec/versioning/" ;
    mod:status "draft" ;
    rdfs:label "TypeSpec Versioning Ontology" ;
    rdfs:comment "This ontology mirrors the TypeSpec versioning semantics used by Inferal Relay RDF output. It records API versions, predecessor chains, merged ontology coverage, and per-resource change annotations." ;
    owl:versionInfo "0.1.0" .

:Version
    a rdfs:Class ;
    rdfs:label "API Version" ;
    rdfs:comment "A specific API version in a TypeSpec version chain." .

:VersionedResource
    a rdfs:Class ;
    rdfs:label "versioned resource" ;
    rdfs:comment "A generated RDF resource or ontology artifact annotated with TypeSpec version coverage or change metadata." .

:previousVersion
    a rdf:Property ;
    rdfs:label "previous version" ;
    rdfs:comment "Links an API version to the immediately previous version in the same TypeSpec version chain." ;
    rdfs:domain :Version ;
    rdfs:range :Version .

:coversVersion
    a rdf:Property ;
    rdfs:label "covers version" ;
    rdfs:comment "Links a merged ontology to an API version covered by that ontology." ;
    rdfs:domain :VersionedResource ;
    rdfs:range :Version .

:addedInVersion
    a rdf:Property ;
    rdfs:label "added in version" ;
    rdfs:comment "Identifies the API version in which a type, property, operation, or other versioned resource was introduced." ;
    rdfs:domain :VersionedResource ;
    rdfs:range :Version .

:removedInVersion
    a rdf:Property ;
    rdfs:label "removed in version" ;
    rdfs:comment "Identifies the API version in which a type, property, operation, or other versioned resource was removed." ;
    rdfs:domain :VersionedResource ;
    rdfs:range :Version .

:renamedInVersion
    a rdf:Property ;
    rdfs:label "renamed in version" ;
    rdfs:comment "Identifies the API version in which a type, property, operation, or other versioned resource was renamed." ;
    rdfs:domain :VersionedResource ;
    rdfs:range :Version .

:madeOptionalInVersion
    a rdf:Property ;
    rdfs:label "made optional in version" ;
    rdfs:comment "Identifies the API version in which a property became optional." ;
    rdfs:domain :VersionedResource ;
    rdfs:range :Version .

:madeRequiredInVersion
    a rdf:Property ;
    rdfs:label "made required in version" ;
    rdfs:comment "Identifies the API version in which a property became required." ;
    rdfs:domain :VersionedResource ;
    rdfs:range :Version .

:typeChangedInVersion
    a rdf:Property ;
    rdfs:label "type changed in version" ;
    rdfs:comment "Identifies the API version in which a property's type changed." ;
    rdfs:domain :VersionedResource ;
    rdfs:range :Version .

:returnTypeChangedInVersion
    a rdf:Property ;
    rdfs:label "return type changed in version" ;
    rdfs:comment "Identifies the API version in which an operation's return type changed." ;
    rdfs:domain :VersionedResource ;
    rdfs:range :Version .

:renamedFrom
    a rdf:Property ;
    rdfs:label "renamed from" ;
    rdfs:comment "Records the previous name of a renamed type, property, operation, or other versioned resource." ;
    rdfs:domain :VersionedResource ;
    rdfs:range xsd:string .

:typeChangedFrom
    a rdf:Property ;
    rdfs:label "type changed from" ;
    rdfs:comment "Records the previous type of a property before a type change." ;
    rdfs:domain :VersionedResource ;
    rdfs:range xsd:string .

:returnTypeChangedFrom
    a rdf:Property ;
    rdfs:label "return type changed from" ;
    rdfs:comment "Records the previous return type of an operation before a return type change." ;
    rdfs:domain :VersionedResource ;
    rdfs:range xsd:string .
