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

apk:apkChecksum a owl:DatatypeProperty ;
    rdfs:label "APK checksum"@en ;
    IAO:0000115 "The content hash of the package (Q1 prefix = SHA-1 of the control+data portion)."@en ;
    rdfs:domain apk:ApkPackage ;
    rdfs:isDefinedBy apk: ;
    rdfs:range xsd:string .

apk:apkOrigin a owl:DatatypeProperty ;
    rdfs:label "origin"@en ;
    IAO:0000115 "The origin package name — the APKBUILD that produced this package (one APKBUILD can produce multiple subpackages)."@en ;
    rdfs:domain apk:ApkPackage ;
    rdfs:isDefinedBy apk: ;
    rdfs:range xsd:string .

apk:branchName a owl:DatatypeProperty ;
    rdfs:label "branch name"@en ;
    IAO:0000115 "The Alpine branch identifier (e.g., 'v3.20', 'edge')."@en ;
    rdfs:domain apk:ApkBranch ;
    rdfs:isDefinedBy apk: ;
    rdfs:range xsd:string .

apk:buildDate a owl:DatatypeProperty ;
    rdfs:label "build date"@en ;
    IAO:0000115 "Unix timestamp of when the package was built."@en ;
    rdfs:domain apk:ApkPackage ;
    rdfs:isDefinedBy apk: ;
    rdfs:range xsd:long .

apk:builtFromAbuild a owl:ObjectProperty ;
    rdfs:label "built from APKBUILD"@en ;
    IAO:0000115 "Associates a package with the APKBUILD script that produced it."@en ;
    rdfs:domain apk:ApkPackage ;
    rdfs:isDefinedBy apk: ;
    rdfs:range apk:AbuildScript .

apk:inBranch a owl:ObjectProperty ;
    rdfs:label "in branch"@en ;
    IAO:0000115 "Associates a repository with its Alpine release branch."@en ;
    rdfs:domain apk:ApkRepository ;
    rdfs:isDefinedBy apk: ;
    rdfs:range apk:ApkBranch .

apk:inRepository a owl:ObjectProperty ;
    rdfs:label "in repository"@en ;
    IAO:0000115 "Associates a package with the Alpine repository (main/community/testing) it belongs to."@en ;
    rdfs:domain apk:ApkPackage ;
    rdfs:isDefinedBy apk: ;
    rdfs:range apk:ApkRepository .

apk:installIf a owl:DatatypeProperty ;
    rdfs:label "install if"@en ;
    IAO:0000115 "Conditional install trigger — this package is automatically installed when all listed packages are present."@en ;
    rdfs:domain apk:ApkPackage ;
    rdfs:isDefinedBy apk: ;
    rdfs:range xsd:string .

apk:providerPriority a owl:DatatypeProperty ;
    rdfs:label "provider priority"@en ;
    IAO:0000115 "Priority when multiple packages provide the same virtual, higher value wins."@en ;
    rdfs:domain apk:ApkPackage ;
    rdfs:isDefinedBy apk: ;
    rdfs:range xsd:integer .

apk:repoName a owl:DatatypeProperty ;
    rdfs:label "repository name"@en ;
    IAO:0000115 "The repository name within the branch (main, community, or testing)."@en ;
    rdfs:domain apk:ApkRepository ;
    rdfs:isDefinedBy apk: ;
    rdfs:range xsd:string .

apk:triggers a owl:DatatypeProperty ;
    rdfs:label "triggers"@en ;
    IAO:0000115 "Filesystem paths that trigger this package's trigger script when modified by another package."@en ;
    rdfs:domain apk:ApkPackage ;
    rdfs:isDefinedBy apk: ;
    rdfs:range xsd:string .

apk:usesMusl a owl:DatatypeProperty ;
    rdfs:label "uses musl"@en ;
    IAO:0000115 "Whether the package is built against musl libc (true for Alpine, distinguishes from glibc-based distributions)."@en ;
    rdfs:domain apk:ApkPackage ;
    rdfs:isDefinedBy apk: ;
    rdfs:range xsd:boolean .

apk:AbuildScript a owl:Class ;
    rdfs:label "APKBUILD Script"@en ;
    IAO:0000115 "A shell script defining how to build an Alpine package from source, located in the aports repository."@en ;
    rdfs:comment "An abuild build script (APKBUILD)"@en ;
    rdfs:isDefinedBy apk: .

apk:ApkBranch a owl:Class ;
    rdfs:label "Alpine Branch"@en ;
    IAO:0000115 "An Alpine Linux release branch, either a stable release (v3.20, v3.19) or the rolling edge branch."@en ;
    rdfs:comment "An Alpine release branch (e.g., v3.20, edge)"@en ;
    rdfs:isDefinedBy apk: .

apk:ApkRepository a owl:Class ;
    rdfs:label "APK Repository"@en ;
    IAO:0000115 "A repository containing Alpine packages indexed by APKINDEX.tar.gz, organized by branch and repository name (main, community, testing)."@en ;
    rdfs:comment "An Alpine package repository"@en ;
    rdfs:isDefinedBy apk: ;
    rdfs:subClassOf pkg:Repository .

apk:ApkPackage a owl:Class ;
    rdfs:label "Alpine Package"@en ;
    IAO:0000115 "A binary package in Alpine APK format, managed by apk-tools, typically built against musl libc."@en ;
    rdfs:comment "An APK package for Alpine Linux"@en ;
    rdfs:isDefinedBy apk: ;
    rdfs:subClassOf pkg:BinaryPackage .

apk: a owl:Ontology ;
    rdfs:label "Alpine APK Package Ontology"@en ;
    dcterms:abstract "Models Alpine Linux packages including the APKINDEX format, abuild build system, virtual packages, install-if triggers, and the musl libc distinction. Alpine is the foundation of most container base images." ;
    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 Alpine Linux packages and the apk-tools ecosystem"@en ;
    rdfs:isDefinedBy apk: ;
    rdfs:seeAlso <https://purl.org/packagegraph/ontology/apk/shapes> ;
    owl:imports pkg: ;
    owl:priorVersion <https://purl.org/packagegraph/ontology/apk/0.6.0> ;
    owl:versionIRI <https://purl.org/packagegraph/ontology/apk/0.7.0> ;
    owl:versionInfo "0.7.0" .

