kbss-cvut / jb4jsonld

JSON-LD serialization and deserialization for Java REST services.
GNU Lesser General Public License v3.0
10 stars 3 forks source link

Relaxing check about single cardinality constraints in json deserialization DefaultInstanceBuilder) #24

Closed cristianolongo closed 4 years ago

cristianolongo commented 4 years ago

Le C be an OWL class which defines an single value cardinality constraint (cardinality==1) on some property p. Now let i be an individual of class C, which occurs two times in a json file so that in both the occurrences the property p is present, with values respectively o and o'. When the DefaultInstanceBuilder encounter the second occurrence of i during the parsing of the json file, it throws a JsonDeserializationException :-1:

Encountered multiple values of property

However, if o and o' are equals the single value constraint is not actually violated. In such a cases I think that avoiding to throw the exception would make the api more robust against strang but correct json files.

ledsoft commented 4 years ago

Makes sense, thanks for the PR!

ledsoft commented 4 years ago

In 0.6.0.