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

pypi:Sdist a owl:Class ;
    rdfs:label "Source Distribution"@en ;
    IAO:0000115 "A Python source distribution containing the raw source code and build instructions, requiring a build step before installation."@en ;
    rdfs:comment "A source distribution (.tar.gz)"@en ;
    rdfs:isDefinedBy pypi: ;
    rdfs:subClassOf pypi:PythonPackage .

pypi:authorEmail a owl:DatatypeProperty ;
    rdfs:label "author email"@en ;
    IAO:0000115 "Email address of the package author from PKG-INFO or pyproject.toml metadata. Semantically equivalent to foaf:mbox but preserved as string for direct metadata extraction. For FOAF integration, this value can be lifted to mailto: URIs."@en ;
    rdfs:comment "Email address from package metadata (semantically equivalent to foaf:mbox)"@en ;
    rdfs:domain pypi:PythonPackage ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range xsd:string .

pypi:buildBackend a owl:DatatypeProperty ;
    rdfs:label "build backend"@en ;
    IAO:0000115 "The PEP 517 build backend used to build the package, e.g., 'setuptools.build_meta', 'hatchling', 'flit_core'."@en ;
    rdfs:domain pypi:PythonPackage ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range xsd:string .

pypi:classifierString a owl:DatatypeProperty ;
    rdfs:label "classifier string"@en ;
    IAO:0000115 "The full trove classifier string, e.g., 'Development Status :: 5 - Production/Stable'."@en ;
    rdfs:domain pypi:Classifier ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range xsd:string .

pypi:entryPointName a owl:DatatypeProperty ;
    rdfs:label "entry point name"@en ;
    IAO:0000115 "The name of the entry point (e.g., the CLI command name for console_scripts)."@en ;
    rdfs:domain pypi:EntryPoint ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range xsd:string .

pypi:entryPointTarget a owl:DatatypeProperty ;
    rdfs:label "entry point target"@en ;
    IAO:0000115 "The Python module:callable target of the entry point, e.g., 'mypackage.cli:main'."@en ;
    rdfs:domain pypi:EntryPoint ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range xsd:string .

pypi:extraDependsOn a owl:ObjectProperty ;
    rdfs:label "extra depends on"@en ;
    IAO:0000115 "A dependency required when a specific extra (optional feature group) is installed. Extras are optional — the base package works without them."@en ;
    rdfs:domain pypi:Extra ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range pypi:PythonPackage ;
    rdfs:subPropertyOf pkg:suggests .

pypi:extraName a owl:DatatypeProperty ;
    rdfs:label "extra name"@en ;
    IAO:0000115 "The name of the optional feature group (extras_require key)."@en ;
    rdfs:domain pypi:Extra ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range xsd:string .

pypi:hasClassifier a owl:ObjectProperty ;
    rdfs:label "has classifier"@en ;
    IAO:0000115 "Associates a package with a trove classifier."@en ;
    rdfs:domain pypi:PythonPackage ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range pypi:Classifier .

pypi:hasEntryPoint a owl:ObjectProperty ;
    rdfs:label "has entry point"@en ;
    IAO:0000115 "Associates a package with an entry point (console script or plugin)."@en ;
    rdfs:domain pypi:PythonPackage ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range pypi:EntryPoint .

pypi:hasExtra a owl:ObjectProperty ;
    rdfs:label "has extra"@en ;
    IAO:0000115 "Associates a package with an optional feature group."@en ;
    rdfs:domain pypi:PythonPackage ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range pypi:Extra .

pypi:projectUrl a owl:DatatypeProperty ;
    rdfs:label "project URL"@en ;
    IAO:0000115 "A labeled project URL from the project-urls metadata (e.g., Documentation, Changelog, Bug Tracker)."@en ;
    rdfs:domain pypi:PythonPackage ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range xsd:string .

pypi:requiresPython a owl:DatatypeProperty ;
    rdfs:label "requires python"@en ;
    IAO:0000115 "Python version constraint specifier (PEP 440), e.g., '>=3.8' or '>=3.10,<4'."@en ;
    rdfs:domain pypi:PythonPackage ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range xsd:string .

pypi:sha256Digest a owl:DatatypeProperty ;
    rdfs:label "SHA-256 digest"@en ;
    IAO:0000115 "SHA-256 hash of the distribution file, used for integrity verification by pip."@en ;
    rdfs:domain pypi:PythonPackage ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range xsd:string .

pypi:wheelTag a owl:DatatypeProperty ;
    rdfs:label "wheel tag"@en ;
    IAO:0000115 "The compatibility tag of the wheel (python-abi-platform), e.g., 'cp312-cp312-manylinux_2_17_x86_64'."@en ;
    rdfs:domain pypi:Wheel ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range xsd:string .

pypi:yanked a owl:DatatypeProperty ;
    rdfs:label "yanked"@en ;
    IAO:0000115 "Whether this version has been yanked from PyPI (hidden from default resolution but still installable)."@en ;
    rdfs:domain pypi:PythonPackage ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range xsd:boolean .

pypi:yankedReason a owl:DatatypeProperty ;
    rdfs:label "yanked reason"@en ;
    IAO:0000115 "The reason provided for yanking this version from PyPI."@en ;
    rdfs:domain pypi:PythonPackage ;
    rdfs:isDefinedBy pypi: ;
    rdfs:range xsd:string .

pypi:Wheel a owl:Class ;
    rdfs:label "Wheel"@en ;
    IAO:0000115 "A pre-built Python distribution in PEP 427 wheel format, containing compiled extensions and ready-to-install files."@en ;
    rdfs:comment "A built distribution in wheel (.whl) format"@en ;
    rdfs:isDefinedBy pypi: ;
    rdfs:subClassOf pypi:PythonPackage .

pypi:Classifier a owl:Class ;
    rdfs:label "Trove Classifier"@en ;
    IAO:0000115 "A hierarchical classification string from the PyPI trove system describing the package's maturity, license, topic, or Python version compatibility."@en ;
    rdfs:comment "A PyPI trove classifier categorizing the package"@en ;
    rdfs:isDefinedBy pypi: .

pypi:EntryPoint a owl:Class ;
    rdfs:label "Entry Point"@en ;
    IAO:0000115 "A named reference to a Python callable exposed via the entry_points mechanism, used for CLI scripts and plugin systems."@en ;
    rdfs:comment "A console script or plugin entry point"@en ;
    rdfs:isDefinedBy pypi: .

pypi:Extra a owl:Class ;
    rdfs:label "Extra"@en ;
    IAO:0000115 "A named group of optional dependencies (extras_require) that can be installed with pip install package[extra]."@en ;
    rdfs:comment "An optional feature group with additional dependencies"@en ;
    rdfs:isDefinedBy pypi: .

pypi:PythonPackage a owl:Class ;
    rdfs:label "Python Package"@en ;
    IAO:0000115 "A Python package distributed through the Python Package Index, described by pyproject.toml or setup.py metadata. PyPI primarily distributes source distributions (sdists) as .tar.gz archives containing setup.py and source code; pre-built wheels are specialized binary artifacts."@en ;
    rdfs:comment "A package published to PyPI"@en ;
    rdfs:isDefinedBy pypi: ;
    rdfs:subClassOf pkg:SourcePackage .

pypi: a owl:Ontology ;
    rdfs:label "PyPI Package Ontology"@en ;
    dcterms:abstract "Models PyPI packages including wheels, sdists, classifiers, extras, entry points, and PEP 517 build backends. Captures the Python-specific packaging metadata from pyproject.toml, setup.py, and PKG-INFO." ;
    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 Python packages distributed through PyPI"@en ;
    rdfs:isDefinedBy pypi: ;
    rdfs:seeAlso <https://purl.org/packagegraph/ontology/pypi/shapes> ;
    owl:imports pkg: ;
    owl:priorVersion <https://purl.org/packagegraph/ontology/pypi/0.6.0> ;
    owl:versionIRI <https://purl.org/packagegraph/ontology/pypi/0.7.0> ;
    owl:versionInfo "0.7.0" .

