@prefix IAO: <http://purl.obolibrary.org/obo/IAO_> .
@prefix cpan: <https://purl.org/packagegraph/ontology/cpan#> .
@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#> .

cpan:abstractText a owl:DatatypeProperty ;
    rdfs:label "abstract"@en ;
    IAO:0000115 "One-line description of the distribution from the META abstract field."@en ;
    rdfs:domain cpan:Distribution ;
    rdfs:isDefinedBy cpan: ;
    rdfs:range xsd:string .

cpan:authorPAUSEID a owl:DatatypeProperty ;
    rdfs:label "PAUSE ID"@en ;
    IAO:0000115 "The author's PAUSE (Perl Authors Upload Server) ID, typically an uppercase handle."@en ;
    rdfs:domain cpan:CPANAuthor ;
    rdfs:isDefinedBy cpan: ;
    rdfs:range xsd:string .

cpan:containsModule a owl:ObjectProperty ;
    rdfs:label "contains module"@en ;
    IAO:0000115 "Associates a distribution with the modules it provides."@en ;
    rdfs:domain cpan:Distribution ;
    rdfs:isDefinedBy cpan: ;
    rdfs:range cpan:Module .

cpan:mainModule a owl:DatatypeProperty ;
    rdfs:label "main module"@en ;
    IAO:0000115 "The primary module name of the distribution (typically matches the distribution name)."@en ;
    rdfs:domain cpan:Distribution ;
    rdfs:isDefinedBy cpan: ;
    rdfs:range xsd:string .

cpan:maturity a owl:DatatypeProperty ;
    rdfs:label "maturity"@en ;
    IAO:0000115 "The distribution maturity level: 'released' for stable, 'developer' for development/testing versions."@en ;
    rdfs:domain cpan:Distribution ;
    rdfs:isDefinedBy cpan: ;
    rdfs:range xsd:string .

cpan:moduleName a owl:DatatypeProperty ;
    rdfs:label "module name"@en ;
    IAO:0000115 "The Perl module name using :: namespace separator (e.g., 'Moose::Role')."@en ;
    rdfs:domain cpan:Module ;
    rdfs:isDefinedBy cpan: ;
    rdfs:range xsd:string .

cpan:provides a owl:DatatypeProperty ;
    rdfs:label "provides"@en ;
    IAO:0000115 "JSON-encoded list of module names provided by this distribution."@en ;
    rdfs:domain cpan:Distribution ;
    rdfs:isDefinedBy cpan: ;
    rdfs:range xsd:string .

cpan:publishedTo a owl:ObjectProperty ;
    rdfs:label "published to"@en ;
    IAO:0000115 "Associates a distribution with the CPAN repository it was published to."@en ;
    rdfs:domain cpan:Distribution ;
    rdfs:isDefinedBy cpan: ;
    rdfs:range cpan:CPANRepository .

cpan:uploadedBy a owl:ObjectProperty ;
    rdfs:label "uploaded by"@en ;
    IAO:0000115 "Associates a distribution with the CPAN author who uploaded it."@en ;
    rdfs:domain cpan:Distribution ;
    rdfs:isDefinedBy cpan: ;
    rdfs:range cpan:CPANAuthor .

cpan:CPANRepository a owl:Class ;
    rdfs:label "CPAN Repository"@en ;
    IAO:0000115 "A CPAN mirror serving Perl distributions, such as cpan.org or a local minicpan."@en ;
    rdfs:comment "A CPAN mirror or registry"@en ;
    rdfs:isDefinedBy cpan: ;
    rdfs:subClassOf pkg:Repository .

cpan:CPANAuthor a owl:Class ;
    rdfs:label "CPAN Author"@en ;
    IAO:0000115 "A PAUSE account (Perl Authors Upload Server) representing a developer's identity on CPAN. Modeled as a ContributorAccount rather than a Contributor role, since a PAUSE ID is an account identifier, not a role assignment."@en ;
    rdfs:comment "A CPAN author account with a PAUSE ID"@en ;
    rdfs:isDefinedBy cpan: ;
    rdfs:subClassOf pkg:ContributorAccount .

cpan:Module a owl:Class ;
    rdfs:label "Module"@en ;
    IAO:0000115 "A single Perl module (.pm file) that can be imported via 'use' or 'require'. A distribution may contain multiple modules."@en ;
    rdfs:comment "A Perl module within a CPAN distribution"@en ;
    rdfs:isDefinedBy cpan: .

cpan:Distribution a owl:Class ;
    rdfs:label "CPAN Distribution"@en ;
    IAO:0000115 "A Perl distribution on CPAN containing one or more modules, described by metadata files (META.json, META.yml) and a Makefile.PL or Build.PL."@en ;
    rdfs:comment "A distribution published to CPAN"@en ;
    rdfs:isDefinedBy cpan: ;
    rdfs:subClassOf pkg:SourcePackage .

cpan: a owl:Ontology ;
    rdfs:label "CPAN Package Ontology"@en ;
    dcterms:abstract "Models CPAN (Comprehensive Perl Archive Network) distributions including modules, PAUSE author IDs, maturity levels, and CPAN-specific metadata. Instances are dual-typed as both pkg:Package and cpan:Distribution." ;
    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 CPAN distributions and the Perl ecosystem"@en ;
    rdfs:isDefinedBy cpan: ;
    rdfs:seeAlso <https://purl.org/packagegraph/ontology/cpan/shapes> ;
    owl:imports pkg: ;
    owl:priorVersion <https://purl.org/packagegraph/ontology/cpan/0.6.0> ;
    owl:versionIRI <https://purl.org/packagegraph/ontology/cpan/0.7.0> ;
    owl:versionInfo "0.7.0" .

