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.1.3.tar.gz (13.8 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.1.3-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jsonld_ex-0.1.3.tar.gz
  • Upload date:
  • Size: 13.8 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.1.3.tar.gz
Algorithm Hash digest
SHA256 409944ec5818f5a793b11438707a075665d0e6eb508cc8846c5a7f56862762ea
MD5 7541bd49467157f7261acea549212313
BLAKE2b-256 baedeb79f146349a880a30d7037f5c3ec2a0a77df66d41a8c46f8bf9997d27bc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: jsonld_ex-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.5 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.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1b8151168731729a2971789cac7ca756bbf4783daf51092a888696fe8fa82f56
MD5 14321a2d7d4e1f904e1daac6614f77c6
BLAKE2b-256 ae77adcf0167667ee8503911a22b32bfb409a9d5a9666f9f1cf35c6a157d6d7d

See more details on using hashes here.

Provenance

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