forge.validate(resource, type_=type_ on a test resource behaves in unexpected ways (at least to me).
Let's start with:
forge = KnowledgeGraphForge('https://raw.githubusercontent.com/BlueBrain/nexus-forge/master/examples/notebooks/use-cases/prod-forge-nexus.yml',
token= staging_token, bucket='dke/kgforge_tests', endpoint='https://staging.nise.bbp.epfl.ch/nexus/v1')
res = forge.retrieve('https://bbp.epfl.ch/dke/kgforge_tests/66d53b15-3d20-4aa0-8e48-e43cf7a2520d')
It seems to ignore the type parameter if this is not the resource.type (or in the resource.type if this is a list). As such, it would succeed with any other type in forge as type.
res.type = 'Entity'
forge.validate(res, type_='Entity') # succeeds
forge.validate(res, type_= [any valid type on forge]) # succeeds
there seems to be some kind of caching returning values from previous (but different) calls . As such, the same call yields different results according to the previous calls.
res.type = ['Entity', 'VolumetricDataLayer']
forge.validate(res, type_='Entity') # succeeds
forge.validate(res, type_='VolumetricDataLayer') # fails
forge.validate(res, type_='Entity') # fails, but should succeed
forge.validate(resource, type_=type_
on a test resource behaves in unexpected ways (at least to me). Let's start with: