clamsproject / clams-python

CLAMS SDK for python
http://sdk.clams.ai/
Apache License 2.0
4 stars 1 forks source link

`input` types in the app metadata should support "one-of" specification in type-specific properties #189

Closed keighrim closed 4 months ago

keighrim commented 5 months ago

New Feature Summary

For example, an OCR app can process TimeFrame annotations in frameType=slate or frameType=chyron or frameType=credit. At the moment, the json scheme for the app metadata does not allow adding non-string values (e.g., list of strings for in this case) for setting Input or Output section of the app metadata, and developers cannot specify an input spec for the TimeFrame example.

https://github.com/clamsproject/clams-python/blob/2e0c2a4c3501ee2ef0c1674f2d335876be8cae6c/clams/appmetadata/__init__.py#L72 https://github.com/clamsproject/clams-python/blob/2e0c2a4c3501ee2ef0c1674f2d335876be8cae6c/docs/appmetadata.jsonschema#L138-L140

Related

No response

Alternatives

No response

Additional context

Note that I/O spec in the app metadata, at the moment, is NOT used in any way to enforce type coercion in app.py where the actual processing is happening.

clams-bot commented 4 months ago

duplicate of #77. In the example case of the OCR app, the input specification should be

"input": [
  [  # note this "embedded" list of types
    {
      "@type": "http://mmif.clams.ai/vocabulary/TimeFrame/v1",
      "properties": {
        "frameType": "slate"
      },
      "required": true 
    }, 
    {
      "@type": "http://mmif.clams.ai/vocabulary/TimeFrame/v1",
      "properties": {
        "frameType": "chyron"
      },
      "required": true 
    }, 
    {
      "@type": "http://mmif.clams.ai/vocabulary/TimeFrame/v1",
      "properties": {
        "frameType": "credit"
      },
      "required": true 
    }
  ]
  # ... and more types
]