@prefix IAO: <http://purl.obolibrary.org/obo/IAO_> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix gomod: <https://purl.org/packagegraph/ontology/gomod#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pkg: <https://purl.org/packagegraph/ontology/core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

gomod:containsPackage a owl:ObjectProperty ;
    rdfs:label "contains package"@en ;
    IAO:0000115 "Associates a module with a Go package it contains."@en ;
    rdfs:domain gomod:GoModule ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range gomod:GoPackage .

gomod:excludes a owl:ObjectProperty ;
    rdfs:label "excludes"@en ;
    IAO:0000115 "A module version excluded via an exclude directive in go.mod."@en ;
    rdfs:domain gomod:GoModule ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range gomod:GoModule .

gomod:goSum a owl:DatatypeProperty ;
    rdfs:label "go.sum hash"@en ;
    IAO:0000115 "The cryptographic hash from go.sum (h1: prefix, SHA-256 of module zip), used by the Go toolchain for integrity verification via the checksum database (sum.golang.org)."@en ;
    rdfs:domain gomod:GoModule ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range xsd:string .

gomod:goVersion a owl:DatatypeProperty ;
    rdfs:label "go version"@en ;
    IAO:0000115 "The minimum Go version required by the module, declared in the 'go' directive of go.mod."@en ;
    rdfs:domain gomod:GoModule ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range xsd:string .

gomod:hasReplace a owl:ObjectProperty ;
    rdfs:label "has replace directive"@en ;
    IAO:0000115 "Associates a module with a replace directive in its go.mod."@en ;
    rdfs:domain gomod:GoModule ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range gomod:ReplaceDirective .

gomod:importPath a owl:DatatypeProperty ;
    rdfs:label "import path"@en ;
    IAO:0000115 "The full import path of the Go package (module path + subdirectory)."@en ;
    rdfs:domain gomod:GoPackage ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range xsd:string .

gomod:isIndirect a owl:DatatypeProperty ;
    rdfs:label "is indirect"@en ;
    IAO:0000115 "Whether this dependency is indirect (not directly imported but required by a direct dependency), marked with // indirect in go.mod."@en ;
    rdfs:domain gomod:GoModule ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range xsd:boolean .

gomod:isRetracted a owl:DatatypeProperty ;
    rdfs:label "is retracted"@en ;
    IAO:0000115 "Whether this module version has been retracted by the author via a retract directive in go.mod."@en ;
    rdfs:domain gomod:GoModule ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range xsd:boolean .

gomod:modulePath a owl:DatatypeProperty,
        owl:FunctionalProperty ;
    rdfs:label "module path"@en ;
    IAO:0000115 "The canonical module path (e.g., 'github.com/go-chi/chi/v5'), which uniquely identifies the module and determines its import path."@en ;
    rdfs:domain gomod:GoModule ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range xsd:string .

gomod:replacementPath a owl:DatatypeProperty ;
    rdfs:label "replacement path"@en ;
    IAO:0000115 "The replacement module path or local directory in a replace directive."@en ;
    rdfs:domain gomod:ReplaceDirective ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range xsd:string .

gomod:replacementVersion a owl:DatatypeProperty ;
    rdfs:label "replacement version"@en ;
    IAO:0000115 "The version of the replacement module, if specified."@en ;
    rdfs:domain gomod:ReplaceDirective ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range xsd:string .

gomod:retractRationale a owl:DatatypeProperty ;
    rdfs:label "retract rationale"@en ;
    IAO:0000115 "The reason provided for retracting a module version."@en ;
    rdfs:domain gomod:GoModule ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range xsd:string .

gomod:servedBy a owl:ObjectProperty ;
    rdfs:label "served by"@en ;
    IAO:0000115 "Associates a module with the Go proxy that serves it."@en ;
    rdfs:domain gomod:GoModule ;
    rdfs:isDefinedBy gomod: ;
    rdfs:range gomod:GoProxy .

gomod:GoProxy a owl:Class ;
    rdfs:label "Go Module Proxy"@en ;
    IAO:0000115 "A caching proxy server that serves Go module zip archives and metadata, such as the default proxy.golang.org or a private GOPROXY."@en ;
    rdfs:comment "A Go module proxy (e.g., proxy.golang.org)"@en ;
    rdfs:isDefinedBy gomod: ;
    rdfs:subClassOf pkg:Repository .

gomod:GoPackage a owl:Class ;
    rdfs:label "Go Package"@en ;
    IAO:0000115 "A directory of Go source files within a module that can be imported by its full path (module path + subdirectory)."@en ;
    rdfs:comment "A single importable Go package within a module"@en ;
    rdfs:isDefinedBy gomod: .

gomod:ReplaceDirective a owl:Class ;
    rdfs:label "Replace Directive"@en ;
    IAO:0000115 "A directive in go.mod that substitutes one module version with another module path or local directory, used for forks, vendoring, or local development."@en ;
    rdfs:comment "A go.mod replace directive"@en ;
    rdfs:isDefinedBy gomod: .

gomod:GoModule a owl:Class ;
    rdfs:label "Go Module"@en ;
    IAO:0000115 "A versioned collection of Go packages, identified by a module path declared in go.mod, and distributed as a source zip archive through a module proxy. Go modules contain source code that is compiled during go build."@en ;
    rdfs:comment "A Go module identified by its module path"@en ;
    rdfs:isDefinedBy gomod: ;
    rdfs:subClassOf pkg:SourcePackage .

gomod: a owl:Ontology ;
    rdfs:label "Go Modules Ontology"@en ;
    dcterms:abstract "Models Go modules including module paths, semantic import versioning, go.sum integrity hashes, replace/exclude directives, and the Go module proxy system. Captures the distinction between modules (versioned collections) and packages (importable units)." ;
    dcterms:created "2026-04-14"^^xsd:date ;
    dcterms:license <https://creativecommons.org/publicdomain/zero/1.0/> ;
    dcterms:modified "2026-04-21"^^xsd:date ;
    rdfs:comment "Ontology for representing Go modules and packages"@en ;
    rdfs:isDefinedBy gomod: ;
    rdfs:seeAlso <https://purl.org/packagegraph/ontology/gomod/shapes> ;
    owl:imports pkg: ;
    owl:priorVersion <https://purl.org/packagegraph/ontology/gomod/0.6.0> ;
    owl:versionIRI <https://purl.org/packagegraph/ontology/gomod/0.7.0> ;
    owl:versionInfo "0.7.0" .

