openschemas / schemaorg

python functions for applied use of schema.org
https://openschemas.github.io/schemaorg/
Mozilla Public License 2.0
34 stars 3 forks source link

recommended and/or required shouldn't be *required* in a recipe #6

Closed vsoch closed 5 years ago

vsoch commented 5 years ago

So meta.

vsoch commented 5 years ago
Looking for primary schema DataCatalog definition
Looking for required relations for DataCatalog
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-10-eb96582eec6f> in <module>()
      5 
      6 # Step 4: Validate Data Structure
----> 7 recipe.validate(catalog)

~/anaconda3/lib/python3.6/site-packages/schemaorg-0.0.12-py3.6.egg/schemaorg/main/parse/recipe.py in validate(self, schema)
    209         '''
    210         if self.loaded:
--> 211             return validate(schema, self)
    212         bot.error('Recipe has not been loaded. Try recipe.load().')
    213         return False

~/anaconda3/lib/python3.6/site-packages/schemaorg-0.0.12-py3.6.egg/schemaorg/main/parse/validate.py in validate(schema, recipe)
     37     # Required properties for main schema
     38     bot.info('Looking for required relations for %s' % schema.type)
---> 39     for prop in recipe.loaded['schemas'][schema.type]['required']:
     40 
     41         # If it's not a property, it might be a subclass

KeyError: 'required'