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

portage:category a owl:DatatypeProperty ;
    rdfs:label "category"@en ;
    IAO:0000115 "The Gentoo package category (e.g., 'dev-libs', 'sys-apps', 'www-client')."@en ;
    rdfs:domain portage:PortagePackage ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:string .

portage:eapi a owl:DatatypeProperty ;
    rdfs:label "EAPI"@en ;
    IAO:0000115 "The Ebuild API version (e.g., '8') determining which functions and features are available in the ebuild."@en ;
    rdfs:domain portage:Ebuild ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:string .

portage:eclassName a owl:DatatypeProperty ;
    rdfs:label "eclass name"@en ;
    IAO:0000115 "The name of the eclass (e.g., 'cmake', 'python-single-r1')."@en ;
    rdfs:domain portage:Eclass ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:string .

portage:hasEbuild a owl:ObjectProperty ;
    rdfs:label "has ebuild"@en ;
    IAO:0000115 "Associates a package with an ebuild for a specific version."@en ;
    rdfs:domain portage:PortagePackage ;
    rdfs:isDefinedBy portage: ;
    rdfs:range portage:Ebuild .

portage:hasUseFlag a owl:ObjectProperty ;
    rdfs:label "has USE flag"@en ;
    IAO:0000115 "Associates an ebuild with a USE flag it supports."@en ;
    rdfs:domain portage:Ebuild ;
    rdfs:isDefinedBy portage: ;
    rdfs:range portage:UseFlag .

portage:inOverlay a owl:ObjectProperty ;
    rdfs:label "in overlay"@en ;
    IAO:0000115 "Associates a package with the overlay repository it comes from."@en ;
    rdfs:domain portage:PortagePackage ;
    rdfs:isDefinedBy portage: ;
    rdfs:range portage:Overlay .

portage:inSlot a owl:ObjectProperty ;
    rdfs:label "in slot"@en ;
    IAO:0000115 "Associates a package version with its installation slot."@en ;
    rdfs:domain portage:PortagePackage ;
    rdfs:isDefinedBy portage: ;
    rdfs:range portage:Slot .

portage:inheritsEclass a owl:ObjectProperty ;
    rdfs:label "inherits eclass"@en ;
    IAO:0000115 "Associates an ebuild with an eclass it inherits."@en ;
    rdfs:domain portage:Ebuild ;
    rdfs:isDefinedBy portage: ;
    rdfs:range portage:Eclass .

portage:isGlobal a owl:DatatypeProperty ;
    rdfs:label "is global"@en ;
    IAO:0000115 "Whether the USE flag is global (defined in profiles/use.desc) vs local (per-package in metadata.xml)."@en ;
    rdfs:domain portage:UseFlag ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:boolean .

portage:iuse a owl:DatatypeProperty ;
    rdfs:label "IUSE"@en ;
    IAO:0000115 "The list of USE flags relevant to this ebuild, with + prefix for default-enabled flags."@en ;
    rdfs:domain portage:Ebuild ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:string .

portage:keywords a owl:DatatypeProperty ;
    rdfs:label "keywords"@en ;
    IAO:0000115 "Architecture keywords (e.g., 'amd64', '~amd64', '-amd64') indicating stability status. ~ prefix means testing, - means explicitly unsupported."@en ;
    rdfs:domain portage:Ebuild ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:string .

portage:requiredUse a owl:DatatypeProperty ;
    rdfs:label "REQUIRED_USE"@en ;
    IAO:0000115 "Boolean expression constraining valid USE flag combinations (e.g., 'exactly-one-of( python_targets_python3_11 python_targets_python3_12 )')."@en ;
    rdfs:domain portage:Ebuild ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:string .

portage:restrict a owl:DatatypeProperty ;
    rdfs:label "restrict"@en ;
    IAO:0000115 "Restrictions on the ebuild (e.g., 'mirror' prevents redistribution, 'fetch' requires manual download, 'test' skips test phase)."@en ;
    rdfs:domain portage:Ebuild ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:string .

portage:slot a owl:DatatypeProperty ;
    rdfs:label "slot"@en ;
    IAO:0000115 "The SLOT value (e.g., '0', '3.12', '0/1.2.3') allowing parallel installation of different versions."@en ;
    rdfs:domain portage:PortagePackage ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:string .

portage:srcUri a owl:DatatypeProperty ;
    rdfs:label "SRC_URI"@en ;
    IAO:0000115 "The source download URI(s) for the package, potentially conditional on USE flags."@en ;
    rdfs:domain portage:Ebuild ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:string .

portage:subslot a owl:DatatypeProperty ;
    rdfs:label "subslot"@en ;
    IAO:0000115 "The SUBSLOT value (after the /) reflecting the ABI version — changes trigger rebuilds of dependent packages."@en ;
    rdfs:domain portage:PortagePackage ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:string .

portage:useFlagDescription a owl:DatatypeProperty ;
    rdfs:label "flag description"@en ;
    IAO:0000115 "Human-readable description of what the USE flag enables."@en ;
    rdfs:domain portage:UseFlag ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:string .

portage:useFlagName a owl:DatatypeProperty ;
    rdfs:label "flag name"@en ;
    IAO:0000115 "The USE flag name (e.g., 'ssl', 'X', 'systemd', 'doc')."@en ;
    rdfs:domain portage:UseFlag ;
    rdfs:isDefinedBy portage: ;
    rdfs:range xsd:string .

portage:Overlay a owl:Class ;
    rdfs:label "Overlay"@en ;
    IAO:0000115 "A supplementary ebuild repository that overlays or extends the main Gentoo repository, providing additional or modified packages."@en ;
    rdfs:comment "An overlay repository (additional ebuild repository)"@en ;
    rdfs:isDefinedBy portage: ;
    rdfs:subClassOf pkg:Repository .

portage:Slot a owl:Class ;
    rdfs:label "Slot"@en ;
    IAO:0000115 "A slot identifier allowing multiple versions of a package to be installed simultaneously (e.g., Python 3.11 and 3.12 in separate slots)."@en ;
    rdfs:comment "A package slot for parallel installation"@en ;
    rdfs:isDefinedBy portage: .

portage:Eclass a owl:Class ;
    rdfs:label "Eclass"@en ;
    IAO:0000115 "A bash library inherited by ebuilds to provide common build patterns (e.g., cmake.eclass, python-single-r1.eclass, rust.eclass)."@en ;
    rdfs:comment "A shared ebuild class providing reusable functionality"@en ;
    rdfs:isDefinedBy portage: .

portage:UseFlag a owl:Class ;
    rdfs:label "USE Flag"@en ;
    IAO:0000115 "A named flag that enables or disables optional functionality at compile time, affecting which dependencies are pulled in and how the software is configured."@en ;
    rdfs:comment "A compile-time feature toggle"@en ;
    rdfs:isDefinedBy portage: .

portage:PortagePackage a owl:Class ;
    rdfs:label "Gentoo Package"@en ;
    IAO:0000115 "A package in the Gentoo ebuild repository, identified by category/name (e.g., dev-libs/openssl), compiled from source with USE flag customization. The installed artifact after building from the ebuild."@en ;
    rdfs:comment "A package in the Gentoo Portage tree"@en ;
    rdfs:isDefinedBy portage: ;
    rdfs:subClassOf pkg:BinaryPackage .

portage:Ebuild a owl:Class ;
    rdfs:label "Ebuild"@en ;
    IAO:0000115 "A bash script following the EAPI specification that defines how to fetch, configure, compile, install, and test a specific version of a Gentoo package. This is the source package representation — it contains build instructions that produce the binary package."@en ;
    rdfs:comment "An ebuild script defining how to build a specific version"@en ;
    rdfs:isDefinedBy portage: ;
    rdfs:subClassOf pkg:SourcePackage .

portage: a owl:Ontology ;
    rdfs:label "Gentoo Portage Ontology"@en ;
    dcterms:abstract "Models Gentoo's source-based packaging system including ebuilds, USE flags, slots/subslots, keyword masking, EAPI versions, eclasses, and overlays. Gentoo's compile-from-source model with granular USE flag customization is unique among Linux distributions." ;
    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 Gentoo packages, ebuilds, and the Portage system"@en ;
    rdfs:isDefinedBy portage: ;
    rdfs:seeAlso <https://purl.org/packagegraph/ontology/portage/shapes> ;
    owl:imports pkg: ;
    owl:priorVersion <https://purl.org/packagegraph/ontology/portage/0.6.0> ;
    owl:versionIRI <https://purl.org/packagegraph/ontology/portage/0.7.0> ;
    owl:versionInfo "0.7.0" .

