Schema: robos:KubernetesDeployment

Formal W3C SHACL constraint shape and OSLC JSON-LD specification for robos:KubernetesDeployment in the devops package store.

Table of contents

  1. Specification Metadata
  2. Upstream Schema Basis (Refers From) & Global Standards Provenance
  3. Entity Relationship & Schema Context
  4. Property Constraints & SHACL Rules
  5. Canonical OSLC JSON-LD Example
  6. Programmatic SHACL Validation

Specification Metadata


Upstream Schema Basis (Refers From) & Global Standards Provenance

This RobOS schema is modeled after and directly aligns with two levels of global standards:


Entity Relationship & Schema Context

Kubernetes Deployment robos:KubernetesDeployment

Governed by W3C SHACL shape urn:robos:shape:KubernetesDeploymentShape within the DevOps & Cloud (robos.devops) (robos.devops) package store.

dcterms:title robos:namespace robos:image

Property Constraints & SHACL Rules

Property Path Name Multiplicity Data Type Constraint Rule / Validation Message
dcterms:title Title / Display Name 1..* xsd:string Kubernetes Deployment must have a title.
robos:namespace Namespace Reference 1..* URI (robos:KubernetesNamespace) Kubernetes Deployment must link to target namespace.
robos:image Container Image 1..* xsd:string Kubernetes Deployment must specify container image.

Canonical OSLC JSON-LD Example

{
  "@id": "urn:robos:devops:kubernetes-deployment-sample",
  "@type": [
    "robos:KubernetesDeployment",
    "schema:SoftwareApplication",
    "oslc:Resource"
  ],
  "dcterms:title": "Sample Kubernetes Deployment",
  "dcterms:description": "Canonical reference instance for robos:KubernetesDeployment.",
  "robos:package": "devops",
  "robos:namespace": "robos.devops",
  "robos:image": "registry.acme.com/apps/sample:v1.0.0",
  "robos:schemaOrgType": "https://schema.org/SoftwareApplication",
  "robos:domainStandard": "https://kubernetes.io/docs/concepts/workloads/controllers/deployment/",
  "robos:refersFrom": "https://schema.org/SoftwareApplication"
}

Programmatic SHACL Validation

const { SHACLValidator } = require('/usr/local/share/robos/robos-graph/lib/shacl-validator');
const { OSLCGraphParser, OSLC_CONTEXT } = require('/usr/local/share/robos/robos-graph/lib/oslc-parser');

const validator = new SHACLValidator();
const result = validator.validateGraph(new OSLCGraphParser({
  "@context": OSLC_CONTEXT,
  "robos:nodes": [
    {
        "@id": "urn:robos:devops:kubernetes-deployment-sample",
        "@type": [
            "robos:KubernetesDeployment",
            "schema:SoftwareApplication",
            "oslc:Resource"
        ],
        "dcterms:title": "Sample Kubernetes Deployment",
        "dcterms:description": "Canonical reference instance for robos:KubernetesDeployment.",
        "robos:package": "devops",
        "robos:namespace": "robos.devops",
        "robos:image": "registry.acme.com/apps/sample:v1.0.0",
        "robos:schemaOrgType": "https://schema.org/SoftwareApplication",
        "robos:domainStandard": "https://kubernetes.io/docs/concepts/workloads/controllers/deployment/",
        "robos:refersFrom": "https://schema.org/SoftwareApplication"
    }
  ],
}));

console.log("Conforms:", result.conforms); // Expected: true