Skip to main content

JSON-LD 1.2 extensions for AI/ML data exchange, security hardening, and validation

Project description

jsonld-ex

JSON-LD 1.2 Extensions for AI/ML Data Exchange, Security, and Validation

Reference implementation of proposed JSON-LD 1.2 extensions. Wraps PyLD for core processing and adds extension layers.

Install

pip install jsonld-ex

Quick Start

from jsonld_ex import JsonLdEx, annotate

# Annotate a value with AI/ML provenance
name = annotate(
    "John Smith",
    confidence=0.95,
    source="https://ml-model.example.org/ner-v2",
    method="NER",
)
# {'@value': 'John Smith', '@confidence': 0.95, '@source': '...', '@method': 'NER'}

# Validate against a shape
from jsonld_ex import validate_node

shape = {
    "@type": "Person",
    "name": {"@required": True, "@type": "xsd:string"},
    "age": {"@type": "xsd:integer", "@minimum": 0, "@maximum": 150},
}

result = validate_node({"@type": "Person", "name": "John", "age": 30}, shape)
assert result.valid

Features

  • AI/ML Extensions: @confidence, @source, @extractedAt, @method, @humanVerified
  • Vector Embeddings: @vector container type with dimension validation
  • Security: @integrity context verification, allowlists, resource limits
  • Validation: @shape native validation framework

Documentation

Full documentation and specifications: github.com/jemsbhai/jsonld-ex

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonld_ex-0.3.0.tar.gz (106.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsonld_ex-0.3.0-py3-none-any.whl (59.2 kB view details)

Uploaded Python 3

File details

Details for the file jsonld_ex-0.3.0.tar.gz.

File metadata

  • Download URL: jsonld_ex-0.3.0.tar.gz
  • Upload date:
  • Size: 106.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jsonld_ex-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fcc100952c88fc27abf858c3d866ed38b5510929f5c3d95b6f67880df74b9244
MD5 53526e5f83a8eaf5c79726c6bae22c0c
BLAKE2b-256 3fd2ae1af38bfe711e86928383ab8ae9e2ba615f9452e3da79a90828e89d373e

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonld_ex-0.3.0.tar.gz:

Publisher: publish-pypi.yml on jemsbhai/jsonld-ex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jsonld_ex-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: jsonld_ex-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 59.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jsonld_ex-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2345c6227097c6a0de737a4647b9cf0d8fd9af21b44388dbd3c18a248f90938
MD5 d74926ef94a093c70877b24fdad8d992
BLAKE2b-256 10e77a335a8cac4fc7c3b5094132d8d3a2b83ed01a11fbd103719f75181718e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonld_ex-0.3.0-py3-none-any.whl:

Publisher: publish-pypi.yml on jemsbhai/jsonld-ex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page