wotpy.wot.validation

Schema following the JSON Schema specification used to validate the shape of Thing Description documents.

Module Attributes

REGEX_ANY_URI

Modifications have been made to the schema declared in the $id field to make forms optional by removing the relevant required and minItems fields for the forms keyword.

Functions

is_valid_safe_name(val)

Returns True if the given value is a safe machine-readable name.

is_valid_uri(val)

Returns True if the given value is a valid URI.

Exceptions

InvalidDescription

Exception raised when a document for an object in the TD hierarchy has an invalid format.

exception wotpy.wot.validation.InvalidDescription

Bases: Exception

Exception raised when a document for an object in the TD hierarchy has an invalid format.

wotpy.wot.validation.REGEX_ANY_URI = '^((\\w+:(\\/?\\/?)[^\\s]+)|((..\\/)+)[^\\s]*)$'

Modifications have been made to the schema declared in the $id field to make forms optional by removing the relevant required and minItems fields for the forms keyword.

wotpy.wot.validation.is_valid_safe_name(val)

Returns True if the given value is a safe machine-readable name.

wotpy.wot.validation.is_valid_uri(val)

Returns True if the given value is a valid URI.