The bean session manages the RDF types, which are multi-valued.
If a user specifies a mapping and a single-valued property with predicate RDF.TYPE, then
- saving the bean works, since ThingSession preserves multiple values.
- fetching the bean after a save, however, will invoke Thing.getValue() which is single-valued. One of the RDF types will be selected at random (as per contract)
- saving the bean replaces all the RDF types with the single value.
(Thanks to Shawn, who discovered this.)
At issue is the fact that RDF type is managed especially as a multi-valued type. The implementation, however, does no checking for setValue(Rdf.TYPE, xxx).
Solution:
- make the appropriate note in the documentation for Thing.setValue, Thing.addValue that there are specific calls for managing the type and to use those.
- have BeanMappings refuse to accept property with predicate of Rdf.TYPE.