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.2.tar.gz (10.3 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.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jsonld_ex-0.1.2.tar.gz
  • Upload date:
  • Size: 10.3 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.2.tar.gz
Algorithm Hash digest
SHA256 b6d7b532853972c14ecb50ca73a5f32ff9db43c5afd8a20e26df5c84cd578e7b
MD5 81ca0d2d6dd0e400faa1ea60d2917c89
BLAKE2b-256 3dc276030c5412548e1db8289affb898862ce4da244fa34de9ffd9e475d28cdd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: jsonld_ex-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 38531caa1a4b15fae0687125e120b6180dcea628381d26882764140431edec90
MD5 69176aaca237805935f67f703ed6a5f1
BLAKE2b-256 ede421013124b7a6a7874b70aabd271ef40bb27f2b70de1f6043a1d853359797

See more details on using hashes here.

Provenance

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