Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actual schemas for fragment types and data types in layers #73

Open
rom1504 opened this issue Oct 25, 2016 · 0 comments
Open

Actual schemas for fragment types and data types in layers #73

rom1504 opened this issue Oct 25, 2016 · 0 comments

Comments

@rom1504
Copy link
Member

rom1504 commented Oct 25, 2016

Discussed with @hbredin

There are fragment types and data types of annotations stored in layers (https://github.com/camomile-project/camomile-server/blob/master/models/Layer.js#L47).
But these types are currently purely informative and the format of the annotation is not validated against them.
It would be useful to store structured schema in these fields for several uses :

  • validating annotations
  • generating visual editors for annotations

There are several ways to represent json schemas in javascript:

  • mongoose schema : currently used in camomile server to represent the data stored in mongodb (layer, user, annotation,...). Defined in javascript, not easily serialize.
  • json schema : schema to describe json data, written in json. Easy to store in mongodb.

It makes more sense to use json schemas to represent the data type and fragment type of annotations.

open annotation defines annotations in a way similar to what camomile does : with a fragment (called target) and data (called body). Some schemas of openannotations might be used as default schemas in camomile. (related to #71)

So the plan is to represent these types using json schema, and taking into account what open annotation says about the kind of schemas that make sense for annotations.

It is possible to validate json schema efficiently using ajv and to generate editors using json-editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant