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

Unable to serialize individuals in unmapped properties #30

Closed cristianolongo closed 3 years ago

cristianolongo commented 3 years ago

I created a Class annotated with the OWLClass annotation. This class has a field properties annotated with the @Properties JOPA annotation. Following javadoc, my properties field has tipe Map<String, Set<Object>>. Infact, I need to specify an object unmapped property here. Thus, for analogy with @OWLObjectProperty, I put in this map a singleton with an object of type URI. I would expect that, when serializing, this URI is used to construct the property target as an individual with this URI as @Id. However, instead the property is interpreted as a datatype property and the URI as a string literal.

I tried also with using an object of another class annotated as @OWLClass instead of a URI. In this case the string literal produced in serialization is the class name. I suppose that in both cases just the toString method of the object is used to generate the literal.

With debugging, I saw that fields annotated with @Property annotation are processed by the cmethod cz.cvut.kbss.jsonld.serialization.PropertyFieldSerializer.serializePropertyValues which I assume works only for literals.

ledsoft commented 3 years ago

Should be fixed in 0.8.3.