RDF Generator#

class besser.generators.rdf.rdf_generator.RDFGenerator(model: DomainModel, output_dir: str = None)[source]#

Bases: GeneratorInterface

RDFGenerator is a class that implements the GeneratorInterface and produces the vocabulary spec in RDF Turtle format for a structural model defined with B-UML.

Parameters:
  • model (DomainModel) – An instance of the DomainModel class representing the B-UML model.

  • output_dir (str, optional) – The output directory where the generated code will be saved. Defaults to None.

TYPES = {'bool': 'boolean', 'date': 'date', 'datetime': 'dateTime', 'float': 'float', 'int': 'integer', 'str': 'string', 'time': 'time', 'timedelta': 'duration'}#
_abc_impl = <_abc._abc_data object>#
generate()[source]#

Generates RDF vocabulary on the provided B-UML model and saves it to the specified output directory. If the output directory was not specified, the code generated will be stored in the <current directory>/output folder.

Returns:

None, but store the generated code as a file named vocabulary.ttl