You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated schema should allow one to use a SpecificResouce with source and selector properties defined as in the example recipes without throwing an error (schema currently doesn't allow for the type to be namespaced as it is) and without dropping both properties.
Observed behaviour:
For source, if you try to use ResourceItem or just pass the info from the recipe as a dict, and then print SpecificResource, only id and type are kept:
For selector, you MUST drop the namespace from iiif:ImageApiSelector to even get things to pass. That's quite clearly a result of:
class SelectorItem3(Base):
type: constr(regex=r'^ImageApiSelector$') = 'ImageApiSelector'
Even after changing the type to not use the namespace, the @context property is dropped. According to 0040, "you must use a @context field in order to point to the ImageApiSelector definition for canonical rotation options".
Once SpecificResource is added as the value of the body property on the painting annotation, source and selector are both dropped:
Let's start with selector. Looking at the validator json, it seems to me that maybe the regex pattern is too strict and doesn't allow for the namespace to be present (even though both recipes currently pass with validation). Perhaps this be addressed first. Also, maybe the following should be added to the SelectorItem3 class:
class Config:
extra = Extra.allow
As for source, I'm not sure where to begin or the ramifications of how to address this in the validator json.
There are definitely other things that need investigation and discussion beyond these two areas, but I'm getting a little out of my depths without talking about this more.
Any other comments:
In case it's useful, here is a bunch of sample code based on Recipe 0299 that can help illustrate the problems here:
This isn't described above, but I also noticed that Recipe 0258: Tagging with an External Resource isn't solvable because the JSON schema in the presentaion-validator says that selector is a required property on SpecificResource and thus the schema here is wrong as well. This issue has been brought up here and here. I also took a stab at a pr that would hopefully resolve this.
Recipes 0299-region and 0040-image-region-service use the
SpecificResource
class from IIIF Open/Web Annotation Extensions. The current generated schema doesn't allow for someone to implement either recipe.The
SpecificResource
class is currently defined as:Expected behaviour:
The generated schema should allow one to use a
SpecificResouce
withsource
andselector
properties defined as in the example recipes without throwing an error (schema currently doesn't allow for the type to be namespaced as it is) and without dropping both properties.Observed behaviour:
For
source
, if you try to useResourceItem
or just pass the info from the recipe as a dict, and then printSpecificResource
, onlyid
andtype
are kept:For
selector
, you MUST drop the namespace fromiiif:ImageApiSelector
to even get things to pass. That's quite clearly a result of:Even after changing the
type
to not use the namespace, the@context
property is dropped. According to 0040, "you must use a @context field in order to point to the ImageApiSelector definition for canonical rotation options".Once
SpecificResource
is added as the value of the body property on the painting annotation,source
andselector
are both dropped:Potential bug location(s):
This one is complex.
Let's start with
selector
. Looking at the validator json, it seems to me that maybe the regex pattern is too strict and doesn't allow for the namespace to be present (even though both recipes currently pass with validation). Perhaps this be addressed first. Also, maybe the following should be added to theSelectorItem3
class:As for
source
, I'm not sure where to begin or the ramifications of how to address this in the validator json.There are definitely other things that need investigation and discussion beyond these two areas, but I'm getting a little out of my depths without talking about this more.
Any other comments:
In case it's useful, here is a bunch of sample code based on Recipe 0299 that can help illustrate the problems here:
The text was updated successfully, but these errors were encountered: