@prefix IAO: <http://purl.obolibrary.org/obo/IAO_> .
@prefix buildroot: <https://purl.org/packagegraph/ontology/buildroot#> .
@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 prov: <http://www.w3.org/ns/prov#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sec: <https://purl.org/packagegraph/ontology/security#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

buildroot:autotoolsPackage a buildroot:BuildInfrastructure ;
    rdfs:label "autotools-package"@en ;
    rdfs:comment "GNU Autotools (./configure && make && make install)"@en .

buildroot:cargoPackage a buildroot:BuildInfrastructure ;
    rdfs:label "cargo-package"@en ;
    rdfs:comment "Rust/Cargo package"@en .

buildroot:cmakePackage a buildroot:BuildInfrastructure ;
    rdfs:label "cmake-package"@en ;
    rdfs:comment "CMake build system"@en .

buildroot:configOpts a owl:DatatypeProperty ;
    rdfs:label "configuration options"@en ;
    IAO:0000115 "Configuration options passed to ./configure from <PKG>_CONF_OPTS variable. Reveals which optional features are enabled/disabled in this build."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:string .

buildroot:cpeId a owl:DatatypeProperty ;
    rdfs:label "CPE ID"@en ;
    IAO:0000115 "The full CPE 2.3 identifier constructed from <PKG>_CPE_ID_VENDOR and <PKG>_CPE_ID_PRODUCT variables. Used for CVE matching against the NVD database. Critical for security analysis of embedded firmware."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:string .

buildroot:cpeProduct a owl:DatatypeProperty ;
    rdfs:label "CPE product"@en ;
    IAO:0000115 "The CPE product identifier from <PKG>_CPE_ID_PRODUCT variable for CVE matching."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:string .

buildroot:cpeVendor a owl:DatatypeProperty ;
    rdfs:label "CPE vendor"@en ;
    IAO:0000115 "The CPE vendor identifier from <PKG>_CPE_ID_VENDOR variable for CVE matching."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:string .

buildroot:defconfigArch a owl:DatatypeProperty ;
    rdfs:label "defconfig architecture"@en ;
    IAO:0000115 "The target architecture of this defconfig (e.g., 'arm', 'aarch64', 'x86_64')."@en ;
    rdfs:domain buildroot:Defconfig ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:string .

buildroot:defconfigName a owl:DatatypeProperty ;
    rdfs:label "defconfig name"@en ;
    IAO:0000115 "The defconfig filename (e.g., 'raspberrypi4_defconfig', 'qemu_x86_64_defconfig')."@en ;
    rdfs:domain buildroot:Defconfig ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:string .

buildroot:genericPackage a buildroot:BuildInfrastructure ;
    rdfs:label "generic-package"@en ;
    rdfs:comment "Generic package with custom build steps"@en .

buildroot:goPackage a buildroot:BuildInfrastructure ;
    rdfs:label "golang-package"@en ;
    rdfs:comment "Go language package"@en .

buildroot:hostPackage a buildroot:BuildInfrastructure ;
    rdfs:label "host-package"@en ;
    rdfs:comment "Package built for the host (build machine) rather than the target"@en .

buildroot:installStaging a owl:DatatypeProperty ;
    rdfs:label "install staging"@en ;
    IAO:0000115 "Whether the package installs to the staging directory (<PKG>_INSTALL_STAGING = YES), making headers and libraries available to other packages at build time. A proxy for 'this package provides a development API'."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:boolean .

buildroot:installTarget a owl:DatatypeProperty ;
    rdfs:label "install target"@en ;
    IAO:0000115 "Whether the package installs to the target filesystem (<PKG>_INSTALL_TARGET = YES), deploying binaries/libraries to the final image. Packages with installTarget=false are build-only tools."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:boolean .

buildroot:kernelModule a buildroot:BuildInfrastructure ;
    rdfs:label "kernel-module"@en ;
    rdfs:comment "Out-of-tree Linux kernel module"@en .

buildroot:licenseFiles a owl:DatatypeProperty ;
    rdfs:label "license files"@en ;
    IAO:0000115 "The license file paths from <PKG>_LICENSE_FILES variable (space-separated). Buildroot uses these to generate the legal-info manifest for license compliance."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:string .

buildroot:matchesCVE a owl:ObjectProperty ;
    rdfs:label "matches CVE"@en ;
    IAO:0000115 "Associates a Buildroot package with CVE vulnerabilities matched via its CPE identifier. Buildroot's pkg-stats tool performs this matching automatically."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range sec:Vulnerability .

buildroot:mesonPackage a buildroot:BuildInfrastructure ;
    rdfs:label "meson-package"@en ;
    rdfs:comment "Meson build system"@en .

buildroot:pythonPackage a buildroot:BuildInfrastructure ;
    rdfs:label "python-package"@en ;
    rdfs:comment "Python setuptools/flit/poetry package"@en .

buildroot:redistributable a owl:DatatypeProperty ;
    rdfs:label "redistributable"@en ;
    IAO:0000115 "Whether the package's license permits redistribution (<PKG>_REDISTRIBUTE = YES/NO). Buildroot excludes non-redistributable packages from the legal-info tarball."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:boolean .

buildroot:selectedByDefconfig a owl:ObjectProperty ;
    rdfs:label "selected by defconfig"@en ;
    IAO:0000115 "Associates a package with defconfigs that select it. Enables 'what packages are in this board image' queries."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range buildroot:Defconfig .

buildroot:site a owl:DatatypeProperty ;
    rdfs:label "site"@en ;
    IAO:0000115 "The download site URL from <PKG>_SITE variable (e.g., 'https://www.openssl.org/source/'). Identifies the upstream source origin for provenance analysis."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:string .

buildroot:siteMethod a owl:DatatypeProperty ;
    rdfs:label "site method"@en ;
    IAO:0000115 "The download method from <PKG>_SITE_METHOD variable (e.g., 'wget', 'git', 'svn', 'hg', 'local'). Reveals the source fetch protocol for provenance chain analysis."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:string .

buildroot:source a owl:DatatypeProperty ;
    rdfs:label "source"@en ;
    IAO:0000115 "The source archive filename from <PKG>_SOURCE variable (e.g., 'openssl-1.1.1.tar.gz')."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:string .

buildroot:sourceHash a owl:DatatypeProperty ;
    rdfs:label "source hash"@en ;
    IAO:0000115 "The expected hash of the source archive from the .hash file. Buildroot verifies downloads against this hash for reproducibility."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range xsd:string .

buildroot:usesInfrastructure a owl:ObjectProperty ;
    rdfs:label "uses infrastructure"@en ;
    IAO:0000115 "Associates a package with the build infrastructure it uses. Reveals the upstream build system and available build hooks."@en ;
    rdfs:domain buildroot:BuildrootPackage ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:range buildroot:BuildInfrastructure .

buildroot:virtualPackage a buildroot:BuildInfrastructure ;
    rdfs:label "virtual-package"@en ;
    rdfs:comment "Virtual package providing an interface (e.g., virtual/libc)"@en .

buildroot:Defconfig a owl:Class ;
    rdfs:label "Defconfig"@en ;
    IAO:0000115 "A board-specific default configuration (defconfig) saved in configs/ directory. Defconfigs define the complete package selection, toolchain, and kernel configuration for a target board. They are the primary input to Buildroot — running 'make <board>_defconfig' selects all packages for that target."@en ;
    rdfs:comment "A Buildroot board defconfig (saved .config)"@en ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:subClassOf prov:Entity .

buildroot:BuildInfrastructure a owl:Class ;
    rdfs:label "Build Infrastructure"@en ;
    IAO:0000115 "A package infrastructure defining build steps and macros. The infrastructure type (e.g., autotools-package, cmake-package, generic-package, python-package) determines what build variables are available and how the package is configured, compiled, and installed."@en ;
    rdfs:comment "A Buildroot package infrastructure defining the build system"@en ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:subClassOf owl:Thing .

buildroot:BuildrootPackage a owl:Class ;
    rdfs:label "Buildroot Package"@en ;
    IAO:0000115 "A package defined by a .mk file in Buildroot's package/ directory, using Makefile syntax with <PKGNAME>_ prefixed variables. Each package directory contains a .mk file (build logic), Config.in (Kconfig selection), and optionally hash files for source verification."@en ;
    rdfs:comment "A Buildroot package definition"@en ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:subClassOf pkg:SourcePackage .

buildroot: a owl:Ontology ;
    rdfs:label "Buildroot Build System Ontology"@en ;
    dcterms:abstract "Models the Buildroot embedded Linux build system, including package definitions (.mk files), Kconfig-based configuration, download sites, install staging/target directives, and defconfig board configurations. Buildroot is optimized for minimal embedded Linux images with reproducible builds. Packages are defined via Makefile syntax with <PKGNAME>_ prefixed variables." ;
    dcterms:created "2026-04-17"^^xsd:date ;
    dcterms:license <https://creativecommons.org/publicdomain/zero/1.0/> ;
    dcterms:modified "2026-04-21"^^xsd:date ;
    rdfs:comment "Ontology for representing Buildroot packages and build configurations"@en ;
    rdfs:isDefinedBy buildroot: ;
    rdfs:seeAlso <https://purl.org/packagegraph/ontology/buildroot/shapes> ;
    owl:imports pkg: ;
    owl:priorVersion <https://purl.org/packagegraph/ontology/buildroot/0.6.0> ;
    owl:versionIRI <https://purl.org/packagegraph/ontology/buildroot/0.7.0> ;
    owl:versionInfo "0.7.0" .

