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.2.0.tar.gz (49.0 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.2.0-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jsonld_ex-0.2.0.tar.gz
  • Upload date:
  • Size: 49.0 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.2.0.tar.gz
Algorithm Hash digest
SHA256 9a7a24c442a7debbab73ee27b24e5c6324d8e0e013c111a0c2d7d388e07cc45a
MD5 d3660cdf4fae3761e66f09fbf34d042e
BLAKE2b-256 31cd2e5ab4ef8d1eba3a00e080cedfbb929f8f09b1388c109d5223816492b21b

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonld_ex-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: jsonld_ex-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 36.8 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aeace46e31e0c18eb660bf41076c14f10f1efe24676a56dec40f73a06592f0a9
MD5 9d01586afbd8cdb8a87c98ed0a468a71
BLAKE2b-256 a39a0212681864b0dc89a734efdda7e7bb5ca2c9783964a0f7b9f3b10e3ed55d

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonld_ex-0.2.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