Skip to main content

sstim

Validate sensory-stimulation descriptions against a published SSTIM profile.

SSTIM is an open standard for describing what a stimulus actually is: signals, channels, renderings, techniques, protocols, sessions, exposure and evidence. This package is a client for it. The ontology, its SHACL shapes and its profiles are published independently, and this code only reads them.

pip install sstim
sstim validate my-stimulus.ttl --profile core
my-stimulus.ttl
  profile core at https://w3id.org/sstim/0.17.0
  ok     SHACL conformance
  ok     every SSTIM term is defined in the core closure
  ok     nothing minted under https://w3id.org/sstim

Three checks, not one

SHACL conformance on its own does not tell you your file is right, for a reason that catches everyone once: SHACL is silent about a term it has never heard of. Misspell a property, or reach for one from a module your profile does not contain, and the shapes have nothing to say. Your file validates. A consumer loading that profile then meets a predicate it cannot interpret, and your mistake surfaces in their pipeline instead of yours.

So this runs three checks:

  1. Conformance against the shapes of the profile you named, not against the largest one available.
  2. Containment: every SSTIM term you used is defined inside that profile's closure.
  3. Namespace discipline: you have not minted anything under https://w3id.org/sstim. Reuse their terms; mint your records in your own namespace. It is the first rule an adopter can break and the most expensive to undo.

Profiles

Take the smallest one that carries what you actually assert. Moving up later is additive, so starting small costs nothing.

Profile What it adds
kernel Two process anchors. A discovery entry point, with no shapes
core Engine-independent stimulus description: signals, channels, renderings
core-plus Reusable descriptors and calibrated quantities, including frequency extents
full Techniques, protocols, configurations, sessions, evidence, exposure, vocabulary
sstim profiles                      # what a release offers
sstim modules --profile full        # what that profile pulls in, and from where

Versions are resolved, not guessed

With no --version, the newest frozen release is resolved by reading owl:versionIRI from the stable IRI. This matters more than it looks: the manifest served at https://w3id.org/sstim/manifest is the development line, so code that fetches it and believes it pinned something has pinned nothing.

sstim validate my.ttl --profile core --version 0.17.0   # pin explicitly

Every module listed in a manifest carries a sha256, and the bytes served are checked against it before anything is parsed. A truncated download or a substituted file stops the run rather than quietly validating your data against a graph that is not SSTIM. Verified modules are cached by checksum, so repeated runs are offline and a cache entry can never be stale.

sstim validate my.ttl --offline     # fail rather than fetch
sstim cache                         # where the cache lives

As a library

import sstim

report = sstim.validate("my-stimulus.ttl", profile="core")
if not report:
    print(report)

# Resolve once, validate many
closure = sstim.resolve_profile("full", version="0.17.0")
closure.version_iri          # 'https://w3id.org/sstim/0.17.0'
[m.id for m in closure.semantic_modules]
reports = [sstim.validate(p, closure=closure) for p in paths]

manifest= resolves from a local checkout or a frozen release directory instead, which needs no network at all.

What this does not do

It does not tell you a stimulation is safe, effective, or ethically approved. Conformance means a file is well formed against the model. Those are different reviews, and SSTIM does not perform them.

More

Apache-2.0. SSTIM itself is CC BY 4.0.

Metadata

Release files for sstim 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sstim 0.1.0
File Size Uploaded
sstim-0.1.0.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sstim 0.1.0
File Interpreter ABI Platform
sstim-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.3 kB

Release files / sstim-0.1.0.tar.gz

Download URL sstim-0.1.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
17e2104c3c1f5f9294568ee02857b97752ee6a492c2fdfbc479c0a64ac2ddfd7
BLAKE2b-256 checksum
How to use checksums
9305004b254b098209e11c2b4c1085f450bb7f15d2e7b2697547295ab34b1e5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / sstim-0.1.0-py3-none-any.whl

Download URL sstim-0.1.0-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f53bbc5dacebe5d8828d6c20ebb83b8e01897284256fa3f20d50928a00207196
BLAKE2b-256 checksum
How to use checksums
7548052292b0130e3f074c96be296af713ba9827b25b78c9b587377d7a06a807
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page