dkpro / dkpro-cassis

UIMA CAS processing library written in Python
https://pypi.org/project/dkpro-cassis/
Apache License 2.0
85 stars 22 forks source link

Take type system into account when adding annotations to CAS #25

Closed jcklie closed 3 years ago

jcklie commented 5 years ago

Right now, the CAS is not aware of the type system. That means, it is possible to add types to a CAS that are not in the type system. It should be the default to validate types to allow only adding types that are in the type system.

triclops200 commented 4 years ago

This is biting me right now, as well. Is there any progress towards this?

jcklie commented 4 years ago

I can add it soonish, I hope this weekend.

triclops200 commented 4 years ago

Holy smokes, that's soon. Really appreciate it.

On May 1, 2020 12:24:13 PM EDT, Jan-Christoph Klie notifications@github.com wrote:

I can add it soonish, I hope this weekend.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/dkpro/dkpro-cassis/issues/25#issuecomment-622456811

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

jcklie commented 4 years ago

@triclops200 Can you elaborate a bit what problem was caused by missing this feature?

triclops200 commented 4 years ago

Trying to enforce that users of a library I'm writing that interfaces with another system don't add items that aren't the correct subtype to a fslist

On May 2, 2020 1:45:21 PM EDT, Jan-Christoph Klie notifications@github.com wrote:

@triclops200 Can you elaborate a bit what problem was caused by missing this feature?

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/dkpro/dkpro-cassis/issues/25#issuecomment-622989728

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

jcklie commented 4 years ago

Is it enough for you now to check for type safety only when the user adds the the fs with contains a fslist to the CAS? Or is it enough for you to check when serializing? Checking whenever the user mutates the list is a bit more complicated.

triclops200 commented 4 years ago

Checking on those points would be fine. If it becomes a problem I'll make a pull request myself in the future.

On May 2, 2020 5:33:15 PM EDT, Jan-Christoph Klie notifications@github.com wrote:

Is it enough for you now to check for type safety only when the user adds the the fs with contains a fslist to the CAS? Or is it enough for you to check when serializing? Checking whenever the user mutates the list is a bit more complicated.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/dkpro/dkpro-cassis/issues/25#issuecomment-623016124

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

jcklie commented 4 years ago

In a feature branch, I added a function cas.typecheck() that returns a list of type checking errors. You can call the function whenever you want. Right now, I only check whether fs list members are type sound. Is that enough for you?

triclops200 commented 4 years ago

More than enough! Thanks!

On May 3, 2020 8:57:07 AM EDT, Jan-Christoph Klie notifications@github.com wrote:

In a feature branch, I added a function cas.typecheck() that returns a list of type checking errors. You can call the function whenever you want. Right now, I only check whether fs list members are type sound. Is that enough for you?

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/dkpro/dkpro-cassis/issues/25#issuecomment-623106171

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

jcklie commented 4 years ago

I added the typ check method to master, you may want to try it out. You can just use the master via pip using python -m pip install git+https://github.com/dkpro/dkpro-cassis. I will make a release soonish. Will you library be open soure or is it something internal?

triclops200 commented 4 years ago

Internal, unfortunately. Thanks for the quick response.

On May 3, 2020 11:25:52 AM EDT, Jan-Christoph Klie notifications@github.com wrote:

I added the typ check method to master, you may want to try it out. You can just use the master via pip using python -m pip install git+https://github.com/dkpro/dkpro-cassis. I will make a release soonish. Will you library be open soure or is it something internal?

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/dkpro/dkpro-cassis/issues/25#issuecomment-623126912

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

jcklie commented 3 years ago

Should be working now