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

npm:bundledDependency a owl:ObjectProperty ;
    rdfs:label "bundled dependency"@en ;
    IAO:0000115 "A dependency that is bundled inside the package tarball rather than installed separately."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range npm:NpmPackage .

npm:deprecated a owl:DatatypeProperty ;
    rdfs:label "deprecated"@en ;
    IAO:0000115 "Deprecation message displayed when users install this package version."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:string .

npm:engines a owl:DatatypeProperty ;
    rdfs:label "engines"@en ;
    IAO:0000115 "Node.js and npm version constraints required to run the package, e.g., '>=18.0.0'."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:string .

npm:fileCount a owl:DatatypeProperty ;
    rdfs:label "file count"@en ;
    IAO:0000115 "The number of files in the published package tarball."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:integer .

npm:funding a owl:DatatypeProperty ;
    rdfs:label "funding"@en ;
    IAO:0000115 "URL or object describing how the package maintainer accepts funding."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:string .

npm:hasScript a owl:ObjectProperty ;
    rdfs:label "has script"@en ;
    IAO:0000115 "Associates a package with a lifecycle script defined in its package.json."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range npm:Script .

npm:inScope a owl:ObjectProperty ;
    rdfs:label "in scope"@en ;
    IAO:0000115 "Associates a scoped package with its NPM scope/organization."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range npm:Scope .

npm:inWorkspace a owl:ObjectProperty ;
    rdfs:label "in workspace"@en ;
    IAO:0000115 "Associates a package with the monorepo workspace it belongs to."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range npm:Workspace .

npm:integrity a owl:DatatypeProperty ;
    rdfs:label "integrity"@en ;
    IAO:0000115 "Subresource Integrity hash (typically sha512) of the package tarball, used by npm ci."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:string .

npm:main a owl:DatatypeProperty ;
    rdfs:label "main"@en ;
    IAO:0000115 "The main entry point module when the package is required via require() in CommonJS."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:string .

npm:module a owl:DatatypeProperty ;
    rdfs:label "module"@en ;
    IAO:0000115 "The ESM entry point module for bundlers that support the 'module' field."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:string .

npm:optionalDependsOn a owl:ObjectProperty ;
    rdfs:label "optional depends on"@en ;
    IAO:0000115 "An optional dependency that is installed if available but does not cause failure if missing. These are weak dependencies that enhance functionality but are not required."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range npm:NpmPackage ;
    rdfs:subPropertyOf pkg:suggests .

npm:peerDependsOn a owl:ObjectProperty ;
    rdfs:label "peer depends on"@en ;
    IAO:0000115 "A peer dependency — the host package must provide this dependency rather than installing it. The peer is expected to be present in the environment, similar to provided dependencies in other ecosystems."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range npm:NpmPackage ;
    rdfs:subPropertyOf pkg:recommends .

npm:publishedTo a owl:ObjectProperty ;
    rdfs:label "published to"@en ;
    IAO:0000115 "Associates a package with the NPM registry it was published to."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range npm:NpmRegistry .

npm:scope a owl:DatatypeProperty ;
    rdfs:label "scope"@en ;
    IAO:0000115 "DEPRECATED: The NPM scope (organization prefix) of the package, e.g., '@babel' for @babel/core. Use npm:inScope (ObjectProperty → npm:Scope entity) instead for graph traversal."@en ;
    rdfs:comment "DEPRECATED: String-based scope property. Use npm:inScope for structured scope entities."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:string ;
    owl:deprecated true .

npm:scriptCommand a owl:DatatypeProperty ;
    rdfs:label "script command"@en ;
    IAO:0000115 "The shell command executed when the script is invoked."@en ;
    rdfs:domain npm:Script ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:string .

npm:scriptName a owl:DatatypeProperty ;
    rdfs:label "script name"@en ;
    IAO:0000115 "The name of the lifecycle script (e.g., test, build, preinstall, postinstall)."@en ;
    rdfs:domain npm:Script ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:string .

npm:shasum a owl:DatatypeProperty ;
    rdfs:label "shasum"@en ;
    IAO:0000115 "SHA-1 hash of the published package tarball, used for integrity verification."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:string .

npm:types a owl:DatatypeProperty ;
    rdfs:label "types"@en ;
    IAO:0000115 "Path to the TypeScript type declaration file (.d.ts) bundled with the package."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:string .

npm:unpacked a owl:DatatypeProperty ;
    rdfs:label "unpacked size"@en ;
    IAO:0000115 "The unpacked size of the package tarball in bytes."@en ;
    rdfs:domain npm:NpmPackage ;
    rdfs:isDefinedBy npm: ;
    rdfs:range xsd:integer .

npm:NpmRegistry a owl:Class ;
    rdfs:label "NPM Registry"@en ;
    IAO:0000115 "A package registry serving NPM packages, such as the public npmjs.com registry or a private Verdaccio/Artifactory instance."@en ;
    rdfs:comment "An NPM package registry (npmjs.com or private)"@en ;
    rdfs:isDefinedBy npm: ;
    rdfs:subClassOf pkg:Repository .

npm:Scope a owl:Class ;
    rdfs:label "Scope"@en ;
    IAO:0000115 "A namespace prefix for NPM packages (e.g., @babel, @types) that groups related packages under an organization or project."@en ;
    rdfs:comment "An NPM scope (@org/package)"@en ;
    rdfs:isDefinedBy npm: .

npm:Workspace a owl:Class ;
    rdfs:label "Workspace"@en ;
    IAO:0000115 "A sub-package within an NPM monorepo workspace, sharing a single root node_modules and lockfile."@en ;
    rdfs:comment "A workspace within an NPM monorepo"@en ;
    rdfs:isDefinedBy npm: .

npm:Script a owl:Class ;
    rdfs:label "Script"@en ;
    IAO:0000115 "A named shell command defined in the scripts field of package.json, executed during lifecycle events (install, test, build) or via npm run."@en ;
    rdfs:comment "A lifecycle script defined in package.json"@en ;
    rdfs:isDefinedBy npm: .

npm:NpmPackage a owl:Class ;
    rdfs:label "NPM Package"@en ;
    IAO:0000115 "A JavaScript/TypeScript package distributed through the NPM registry, described by a package.json manifest. NPM packages are distributed as source tarballs (.tgz) containing package.json, source code, and assets."@en ;
    rdfs:comment "A package published to an NPM registry"@en ;
    rdfs:isDefinedBy npm: ;
    rdfs:subClassOf pkg:SourcePackage .

npm: a owl:Ontology ;
    rdfs:label "NPM Package Ontology"@en ;
    dcterms:abstract "Models NPM registry packages including scoped packages, semantic version ranges, scripts, peer dependencies, workspaces, and the package-lock.json dependency tree. Instances are dual-typed as both pkg:Package and npm:NpmPackage." ;
    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 NPM packages and the Node.js ecosystem"@en ;
    rdfs:isDefinedBy npm: ;
    rdfs:seeAlso <https://purl.org/packagegraph/ontology/npm/shapes> ;
    owl:imports pkg: ;
    owl:priorVersion <https://purl.org/packagegraph/ontology/npm/0.6.0> ;
    owl:versionIRI <https://purl.org/packagegraph/ontology/npm/0.7.0> ;
    owl:versionInfo "0.7.0" .

