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

cargo:buildDependsOn a owl:ObjectProperty ;
    rdfs:label "build depends on"@en ;
    IAO:0000115 "A dependency required only by the build script (build.rs)."@en ;
    rdfs:domain cargo:Crate ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range cargo:Crate ;
    rdfs:subPropertyOf pkg:buildDependsOn .

cargo:categorySlug a owl:DatatypeProperty ;
    rdfs:label "category slug"@en ;
    IAO:0000115 "The URL slug identifying the category on crates.io."@en ;
    rdfs:domain cargo:CrateCategory ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range xsd:string .

cargo:crateChecksum a owl:DatatypeProperty ;
    rdfs:label "crate checksum"@en ;
    IAO:0000115 "SHA-256 checksum of the .crate archive from the crates.io index."@en ;
    rdfs:domain cargo:Crate ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range xsd:string .

cargo:devDependsOn a owl:ObjectProperty ;
    rdfs:label "dev depends on"@en ;
    IAO:0000115 "A development-only dependency used for tests, benchmarks, and examples. These dependencies are only required during development, testing, and building, not at runtime."@en ;
    rdfs:domain cargo:Crate ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range cargo:Crate ;
    rdfs:subPropertyOf pkg:buildDependsOn .

cargo:downloads a owl:DatatypeProperty ;
    rdfs:label "downloads"@en ;
    IAO:0000115 "Total download count from crates.io (point-in-time claim, not ground truth)."@en ;
    rdfs:domain cargo:Crate ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range xsd:integer .

cargo:edition a owl:DatatypeProperty ;
    rdfs:label "edition"@en ;
    IAO:0000115 "The Rust edition the crate uses (2015, 2018, 2021, 2024), which determines language and compiler behavior."@en ;
    rdfs:domain cargo:Crate ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range xsd:string .

cargo:featureEnables a owl:ObjectProperty ;
    rdfs:label "feature enables"@en ;
    IAO:0000115 "A feature that is transitively enabled when this feature is activated."@en ;
    rdfs:domain cargo:Feature ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range cargo:Feature .

cargo:featureName a owl:DatatypeProperty ;
    rdfs:label "feature name"@en ;
    IAO:0000115 "The name of the feature flag as declared in [features] in Cargo.toml."@en ;
    rdfs:domain cargo:Feature ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range xsd:string .

cargo:hasBuildScript a owl:DatatypeProperty ;
    rdfs:label "has build script"@en ;
    IAO:0000115 "Whether the crate has a build.rs build script that runs before compilation."@en ;
    rdfs:domain cargo:Crate ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range xsd:boolean .

cargo:hasFeature a owl:ObjectProperty ;
    rdfs:label "has feature"@en ;
    IAO:0000115 "Associates a crate with a feature flag it defines."@en ;
    rdfs:domain cargo:Crate ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range cargo:Feature .

cargo:hasTarget a owl:ObjectProperty ;
    rdfs:label "has target"@en ;
    IAO:0000115 "Associates a crate with a build target it provides."@en ;
    rdfs:domain cargo:Crate ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range cargo:Target .

cargo:inCategory a owl:ObjectProperty ;
    rdfs:label "in category"@en ;
    IAO:0000115 "Associates a crate with a crates.io category."@en ;
    rdfs:domain cargo:Crate ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range cargo:CrateCategory .

cargo:isDefaultFeature a owl:DatatypeProperty ;
    rdfs:label "is default feature"@en ;
    IAO:0000115 "Whether the feature is enabled by default (listed in the 'default' feature set)."@en ;
    rdfs:domain cargo:Feature ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range xsd:boolean .

cargo:links a owl:DatatypeProperty ;
    rdfs:label "links"@en ;
    IAO:0000115 "The native library this crate links to via a build script (links field in Cargo.toml). Ensures only one crate links to a given native library."@en ;
    rdfs:domain cargo:Crate ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range xsd:string .

cargo:msrv a owl:DatatypeProperty ;
    rdfs:label "minimum supported Rust version"@en ;
    IAO:0000115 "The minimum version of the Rust compiler required to build the crate (rust-version field)."@en ;
    rdfs:domain cargo:Crate ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range xsd:string .

cargo:targetKind a owl:DatatypeProperty ;
    rdfs:label "target kind"@en ;
    IAO:0000115 "The kind of build target: lib, bin, test, bench, example, or proc-macro."@en ;
    rdfs:domain cargo:Target ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range xsd:string .

cargo:targetName a owl:DatatypeProperty ;
    rdfs:label "target name"@en ;
    IAO:0000115 "The name of the build target, used as the binary name or library identifier."@en ;
    rdfs:domain cargo:Target ;
    rdfs:isDefinedBy cargo: ;
    rdfs:range xsd:string .

cargo:CrateCategory a owl:Class ;
    rdfs:label "Category"@en ;
    IAO:0000115 "A curated category on crates.io classifying crates by functionality (e.g., 'command-line-utilities', 'web-programming', 'cryptography')."@en ;
    rdfs:comment "A crates.io category"@en ;
    rdfs:isDefinedBy cargo: .

cargo:Target a owl:Class ;
    rdfs:label "Target"@en ;
    IAO:0000115 "A compilation target defined in the crate, such as a library, binary executable, test suite, benchmark, or example."@en ;
    rdfs:comment "A build target within a crate (lib, bin, test, bench, example)"@en ;
    rdfs:isDefinedBy cargo: .

cargo:Feature a owl:Class ;
    rdfs:label "Feature"@en ;
    IAO:0000115 "A named feature flag in Cargo.toml that enables optional dependencies or conditional compilation via cfg attributes."@en ;
    rdfs:comment "A conditional compilation feature flag"@en ;
    rdfs:isDefinedBy cargo: .

cargo:Crate a owl:Class ;
    rdfs:label "Crate"@en ;
    IAO:0000115 "A Rust library or application package published to the crates.io registry, described by a Cargo.toml manifest. Crates are distributed as source tarballs (.crate files containing Cargo.toml, Cargo.lock, and source code) that are compiled locally during installation."@en ;
    rdfs:comment "A Rust crate published to crates.io"@en ;
    rdfs:isDefinedBy cargo: ;
    rdfs:subClassOf pkg:SourcePackage .

cargo: a owl:Ontology ;
    rdfs:label "Cargo Package Ontology"@en ;
    dcterms:abstract "Models Rust crates including features, editions, targets (lib/bin/test/bench), build scripts, categories, and the Cargo.lock dependency resolution. Captures Rust-specific concepts like feature flags and conditional compilation." ;
    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 Rust crates from crates.io"@en ;
    rdfs:isDefinedBy cargo: ;
    rdfs:seeAlso <https://purl.org/packagegraph/ontology/cargo/shapes> ;
    owl:imports pkg: ;
    owl:priorVersion <https://purl.org/packagegraph/ontology/cargo/0.6.0> ;
    owl:versionIRI <https://purl.org/packagegraph/ontology/cargo/0.7.0> ;
    owl:versionInfo "0.7.0" .

