""" :Author: Daniel Mohr :Email: daniel.mohr@dlr.de :Date: 2021-03-19 (last change). :License: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007. """
""" :Author: Daniel Mohr :Date: 2021-03-19
This function generates a json schema from https://schema.org , which desribes the vocabulary.
:param schemaorg_data: json-ld data from https://schema.org as returned from :func:`get_schema_org_data`. :param vocabulary: list of words, which are a Schema.org Type (Schema.org vocabulary) :param draft: the used json schema, could be:
* 'draft-04' * 'draft-06' * 'draft-07' * '2019-09' :return: json schema describing a json-ld for the given vocabulary """ 'draft-04': "http://json-schema.org/draft-04/schema#", 'draft-06': "http://json-schema.org/draft-06/schema#", 'draft-07': "http://json-schema.org/draft-07/schema#", '2019-09': "http://json-schema.org/draft/2019-09/schema#"} else: raise NotImplementedError('do not understand json draft version') "title", "json schema to define json-ld based on schema.org") "description", "The vocabulary %s " % ', '.join(vocabulary) + "from schema.org is defined as a json schema. " "It should be a valid json-ld file. " "All necessary words should be defined.") schemaorg_data, word) else: # return schema # workaround for debugging "description", "The vocabulary %s " % ', '.join(vocabulary) + "from schema.org is defined as a json schema. " "It should be a valid json-ld file. " "All necessary words should be defined.") |