@prefix : <https://ontology.inferal.com/modules/git/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix mod: <https://w3id.org/mod#> .
@prefix ord: <https://ontology.inferal.com/modules/ordering/> .
@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 ;
    owl:imports ord: ;
    dcterms:title "Git Ontology" ;
    dcterms:description "A content-addressed model of Git repositories, objects, tree entries, ordered commit ancestry, tags, references, and resolvable object stores." ;
    dcterms:license <https://creativecommons.org/licenses/by/4.0/> ;
    dcterms:source <https://git-scm.com/docs/gitformat-pack>, <https://git-scm.com/docs/gitrepository-layout>, ord: ;
    vann:preferredNamespacePrefix "git" ;
    vann:preferredNamespaceUri "https://ontology.inferal.com/modules/git/" ;
    mod:status "draft" ;
    rdfs:comment "The module separates Git graph identity from payload custody. Object identifiers and graph edges may be represented without embedding blob bytes; an explicit or repository-default object store can make those objects materializable. Commit-parent topology specializes broad Ordering precedence without claiming order-theoretic adjacency." ;
    owl:versionInfo "0.1.0" .

:Repository
    a rdfs:Class ;
    rdfs:label "Git repository" ;
    rdfs:comment "A Git repository description containing content-addressed objects and references under one object-format algorithm." .

:ObjectStore
    a rdfs:Class ;
    rdfs:label "Git object store" ;
    rdfs:comment "A location from which Git object payloads can be resolved by object identifier. Access may require a processor or protocol understood by the consumer." .

:GitObject
    a rdfs:Class ;
    rdfs:label "Git object" ;
    rdfs:comment "A content-addressed object in a Git object database. Its identifier is computed by the repository's object-format algorithm over the Git object header and payload." .

:Blob
    a rdfs:Class ;
    rdfs:subClassOf :GitObject ;
    rdfs:label "Git blob" ;
    rdfs:comment "A Git object whose payload is uninterpreted file content. The payload need not be embedded in RDF when it is resolvable from an object store." .

:Tree
    a rdfs:Class ;
    rdfs:subClassOf :GitObject ;
    rdfs:label "Git tree" ;
    rdfs:comment "A Git object containing ordered name, mode, and object-identifier entries." .

:Commit
    a rdfs:Class ;
    rdfs:subClassOf :GitObject, ord:Comparable ;
    rdfs:label "Git commit" ;
    rdfs:comment "A Git object that names one root tree, zero or more ordered parent commits, identity headers, and a message." .

:CommitAncestryOrdering
    a ord:PartialOrdering ;
    rdfs:label "Git commit ancestry ordering" ;
    rdfs:comment "The canonical partial ordering in which a Git commit follows each recorded parent and precedes each child. Disconnected histories remain incomparable, and the relation does not treat every recorded parent as an order-theoretic immediate predecessor." .

:Tag
    a rdfs:Class ;
    rdfs:subClassOf :GitObject ;
    rdfs:label "annotated Git tag" ;
    rdfs:comment "A Git tag object that names another Git object and carries tag metadata. Lightweight tags are references, not instances of this class." .

:GitlinkCommit
    a rdfs:Class ;
    rdfs:subClassOf :GitObject ;
    rdfs:label "gitlink commit identity" ;
    rdfs:comment "A repository-scoped resource carrying the content-addressed identity of a commit selected by a 160000 tree entry but absent from the containing repository's described object database. It is distinct from a complete Commit resource and does not assert availability of the commit payload or topology." .

:TreeEntry
    a rdfs:Class ;
    rdfs:label "Git tree entry" ;
    rdfs:comment "One ordered occurrence in a tree, preserving its raw name bytes, mode, and target object." .

:CommitParent
    a rdfs:Class ;
    rdfs:label "Git commit parent occurrence" ;
    rdfs:comment "One ordered parent occurrence in a commit. Parent order is part of commit identity and is therefore represented explicitly." .

:Reference
    a rdfs:Class ;
    rdfs:label "Git reference" ;
    rdfs:comment "A named Git reference, including HEAD and references under refs/." .

:DirectReference
    a rdfs:Class ;
    rdfs:subClassOf :Reference ;
    rdfs:label "direct Git reference" ;
    rdfs:comment "A Git reference whose value is an object identifier." .

:SymbolicReference
    a rdfs:Class ;
    rdfs:subClassOf :Reference ;
    rdfs:label "symbolic Git reference" ;
    rdfs:comment "A Git reference whose value is another reference name, including a symbolic HEAD pointing to an unborn branch." .

:objectFormat
    a rdf:Property ;
    rdfs:label "object format" ;
    rdfs:comment "The Git object identifier algorithm used by a repository, currently sha1 or sha256." ;
    rdfs:domain :Repository ;
    rdfs:range xsd:string .

:hasObject
    a rdf:Property ;
    rdfs:label "has Git object" ;
    rdfs:comment "Associates a repository description with an object present in its described object database. A gitlink may select an external commit that is not a value of this property." ;
    rdfs:domain :Repository ;
    rdfs:range :GitObject .

:hasReference
    a rdf:Property ;
    rdfs:label "has Git reference" ;
    rdfs:comment "Associates a repository description with a reference, including HEAD." ;
    rdfs:domain :Repository ;
    rdfs:range :Reference .

:defaultObjectStore
    a rdf:Property ;
    rdfs:label "default object store" ;
    rdfs:comment "Names the object store used for repository objects that do not carry an explicit payloadStore value." ;
    rdfs:domain :Repository ;
    rdfs:range :ObjectStore .

:payloadStore
    a rdf:Property ;
    rdfs:label "payload store" ;
    rdfs:comment "Overrides the repository default with the store from which this object's payload can be resolved." ;
    rdfs:domain :GitObject ;
    rdfs:range :ObjectStore .

:accessIRI
    a rdf:Property ;
    rdfs:label "object store access IRI" ;
    rdfs:comment "An access location for an object store. The IRI scheme determines the resolver; file IRIs may identify local Git repositories." ;
    rdfs:domain :ObjectStore ;
    rdfs:range xsd:anyURI .

:objectId
    a rdf:Property ;
    rdfs:label "Git object identifier" ;
    rdfs:comment "The lowercase hexadecimal Git object identifier, interpreted using the containing repository's objectFormat." ;
    rdfs:domain :GitObject ;
    rdfs:range xsd:string .

:hasTreeEntry
    a rdf:Property ;
    rdfs:label "has tree entry" ;
    rdfs:comment "Associates a tree with one ordered entry occurrence." ;
    rdfs:domain :Tree ;
    rdfs:range :TreeEntry .

:entryIndex
    a rdf:Property ;
    rdfs:label "tree entry index" ;
    rdfs:comment "Zero-based occurrence index in the byte ordering encoded by the tree object." ;
    rdfs:domain :TreeEntry ;
    rdfs:range xsd:nonNegativeInteger .

:entryNameBytes
    a rdf:Property ;
    rdfs:label "tree entry name bytes" ;
    rdfs:comment "The entry's exact single path-component bytes, encoded as xsd:base64Binary." ;
    rdfs:domain :TreeEntry ;
    rdfs:range xsd:base64Binary .

:entryMode
    a rdf:Property ;
    rdfs:label "tree entry mode" ;
    rdfs:comment "The Git tree-entry mode in canonical octal text, such as 100644, 100755, 120000, 160000, or 40000." ;
    rdfs:domain :TreeEntry ;
    rdfs:range xsd:string .

:entryObject
    a rdf:Property ;
    rdfs:label "tree entry object" ;
    rdfs:comment "Names the blob, tree, commit, or gitlink commit identity selected by a tree entry. A 160000 gitlink may select a commit absent from the containing repository's object database." ;
    rdfs:domain :TreeEntry ;
    rdfs:range :GitObject .

:commitTree
    a rdf:Property ;
    rdfs:label "commit tree" ;
    rdfs:comment "Names the root tree recorded by a commit." ;
    rdfs:domain :Commit ;
    rdfs:range :Tree .

:hasParent
    a rdf:Property ;
    rdfs:label "has commit parent occurrence" ;
    rdfs:comment "Associates a commit with one ordered parent occurrence." ;
    rdfs:domain :Commit ;
    rdfs:range :CommitParent .

:parentIndex
    a rdf:Property ;
    rdfs:label "commit parent index" ;
    rdfs:comment "Zero-based order of a parent header in the commit object." ;
    rdfs:domain :CommitParent ;
    rdfs:range xsd:nonNegativeInteger .

:parentCommit
    a rdf:Property ;
    rdfs:label "parent commit" ;
    rdfs:comment "Names the commit selected by a parent occurrence." ;
    rdfs:domain :CommitParent ;
    rdfs:range :Commit .

:hasParentCommit
    a rdf:Property ;
    rdfs:subPropertyOf ord:follows ;
    rdfs:label "has parent commit" ;
    rdfs:comment "Relates a commit to a commit selected by one of its parent occurrences. The OWL addendum derives this relation from hasParent followed by parentCommit; it specializes broad ord:follows without asserting ord:immediatelyFollows." ;
    rdfs:domain :Commit ;
    rdfs:range :Commit .

:tagTarget
    a rdf:Property ;
    rdfs:label "tag target" ;
    rdfs:comment "Names the Git object selected by an annotated tag object." ;
    rdfs:domain :Tag ;
    rdfs:range :GitObject .

:referenceName
    a rdf:Property ;
    rdfs:label "reference name" ;
    rdfs:comment "The complete Git reference name, such as HEAD or refs/heads/main." ;
    rdfs:domain :Reference ;
    rdfs:range xsd:string .

:pointsToObject
    a rdf:Property ;
    rdfs:label "points to Git object" ;
    rdfs:comment "Names the object identifier value of a direct reference." ;
    rdfs:domain :DirectReference ;
    rdfs:range :GitObject .

:symbolicTargetName
    a rdf:Property ;
    rdfs:label "symbolic target name" ;
    rdfs:comment "The reference name stored as the value of a symbolic reference. It may name an unborn reference absent from the described graph." ;
    rdfs:domain :SymbolicReference ;
    rdfs:range xsd:string .
