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

Expressing equivalency classes for annotations #260

Open
bachbui opened this issue Oct 22, 2019 · 1 comment
Open

Expressing equivalency classes for annotations #260

bachbui opened this issue Oct 22, 2019 · 1 comment
Labels
🎉 Feature A new feature or request

Comments

@bachbui
Copy link
Contributor

bachbui commented Oct 22, 2019

We often have to determine whether two documents are equivalent, which is exposed as document.equals(). This is implemented by comparing the canonical versions of the documents and checking that their content and annotations are equal. For annotations, this equivalency is implemented by checking their start and end positions match, and then doing a deep comparison of their attributes properties.

However, an annotation might have some properties, particularly in their attributes, which might not represent a meaningful difference. For example, if an annotation was created during a conversion, it is sometimes useful to include some properties from the original annotation in the converted version as signposts for verification. These properties should be ignored when determining if two annotations are equivalent.

It's currently possible to override equals on the annotation but we could provide nicer hooks. One possibility is to add a declarative API to annotations where one could list these 'non-data' attributes.

What are the results of this discussion?

@tim-evans tim-evans added the 🎉 Feature A new feature or request label Oct 22, 2019
@tim-evans
Copy link
Collaborator

tim-evans commented Oct 28, 2019

I think this conversation dovetails quite nicely to the conversation we're having around inheritance / reuse. For example, do we have partial equivalence?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 Feature A new feature or request
Projects
None yet
Development

No branches or pull requests

2 participants