1.2.2 Predicates
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog JSON library
        • Supporting JSON
          • library(json_schema): JSON Schema reader and validator
            • Predicates
              • json_validate/3
              • json_compile_schema/3
              • json_check/3
Availability::- use_module(library(json_schema)).(can be autoloaded)
Source[det]json_validate(+SchemaFile, +DataDict, +Options)
Given a file holding a JSON Schema and a Prolog dict holding JSON data, validate the data against the schema. Options are passed to json_compile_schema/3 and json_check/3.
throws
error(Formal, json_path(Path)), where Path is a list of properties from the root element to the culprit element. Formal is typically a type, domain or existence error. This file contains the message hooks to generate a human readable error from these exceptions using print_message/2.