I need to look into it in more detail, again, after a rubbish week
working on something else. But perhaps you can say off the top of your
head :
The scenario is that I have reference objects that may get surfaced on
a webpage. Things happen on the page that mean a user can save an
object that needs a reference to one of those reference data. Eg
"DogOwner" may need a reference to "Labrador" via a Dog property.. The
form on the page submits the info - I get a param that tells me the id
for the previously read "Labrador",
I create an object of type Dog and set the id to Labrador. I dont set
the other properties that might be needed - I don't want to spend the
time/network/resources/cycles to retrieve the Labrador instance from
the rdf database again.
The DogOwner class still needs a populated Dog property - but in the
RDF, this will materialize as a triple something like
http://myDogApp/DogOwner http://dogs/hasDog
http://dogs/id/labrador.
So -
http://dogs/id/labrador is all thats needed in DogOwner;
the individual that represents the labrador and all its properties
exists in rdf already, in my ontology vocabulary, and I dont want to
change it.
- Does saveDeep(), with this temporary Labrador instance I have,
overwrite the fully populated ontology individual ?
- Does save not do this ?
In looking at the code I see the forceDeep and shallow flags, and a
call to saveOrUpdate. What happens here currently, and what do I need
to do - do I need to retrieve my reference data before setting it as
property on an object that uses it in composition, or will the
saveOrUpdate just update the fully populated pre-existing individual ?
If a flag or "saveShallow" method is needed I can live with that and
I'll still need a deepSave() from time to time. And in looking at
Empire I might expect the same issue to crop up.