Conversion class for YAML to the various syntaxes. The constructor of the class does the real work: converting the yaml file into an internal representation of the vocabulary (see Vocab). The class methods are the interfaces to the different representations of the vocabulary (done through separate modules).

Constructors

  • Conversion class for YAML to the various syntaxes. The real action is in the getData method.

    Parameters

    • yml_content: string

      the YAML content in string (before parsing)

    Returns VocabGeneration

    Error raised by either the YAML parser or the Schema Validator

Methods

  • Get the minimal JSON-LD Context file for the vocabulary.

    Returns string

    The JSON-LD content

  • Get the HTML representation of the vocabulary based on an HTML template

    Parameters

    • template: string

      Textual version of the vocabulary template

    • basename: string

      Common basename for the generation of the output files

    • context: boolean

      Whether a JSON-LD context file is also generated

    Returns string

  • Get the JSON-LD representation of the vocabulary.

    Returns string

    The JSON-LD content

  • Get the Turtle representation of the vocabulary.

    Returns string

    The Turtle content