broken relations through update, get INCLUDE * (ALL)

10 views
Skip to first unread message

c.felder.m.sc

unread,
Jul 24, 2012, 3:13:15 AM7/24/12
to icatproje...@googlegroups.com
Hi,

is there a possibility to get an object with all its relations in one call without explicitly specifying this relations?
I need this for example to update an Dataset Status (complete flag).

example (python):

        dset = self._c.service.get(self._sessionId, ICatType.DATASET + 

                                   " INCLUDE " + ICatType.DATASET_TYPE +

                                   ',' + ICatType.SAMPLE,

                                   datasetId)

        dset.complete = complete

        

        self._c.service.update(self._sessionId, dset)


Problem:

If you have to specify all entities explicitly you often generate loops in the graph.

I could not find a combination of INCLUDEs where are all related objects are included.

In this example you can just include SAMPLE or INVESTIGATION. If you include both

you generate a loop. If you update without including both a relation is broken.


a) INCLUDE Sample => loosing relation to INVESTIGATION

b) INCLUDE Investigation => loosing relation to SAMPLE


Furthermore it would be nice if the update method just touches relations which are specified.

Then it would be possible to just fetch a Dataset without INCLUDEs.


Best

Christian

Steve Fisher

unread,
Jul 24, 2012, 6:59:01 AM7/24/12
to icatproje...@googlegroups.com
For doing updates you should say INCLUDE 1 as described in the section
"Updating an Object" in
http://www.icatproject.org/mvn/site/icat/4.1.1/icat.client/manual.html.
This ensures that you don't forget anything. You don't need the "to
many" relationships as these are ignored on an update.

Steve
> --
> You received this message because you are subscribed to the Google Groups
> "icatproject-support" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/icatproject-support/-/ScUyep3UKjEJ.
> To post to this group, send email to icatproje...@googlegroups.com.
> To unsubscribe from this group, send email to
> icatproject-sup...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/icatproject-support?hl=en.

c.felder.m.sc

unread,
Jul 25, 2012, 4:51:00 AM7/25/12
to icatproje...@googlegroups.com
Thanks a lot Steve. I should accustom myself to look in the generated manual.
I often take a look into the old pdf version from svn which was released with the first ICAT 4 (4.0.0) version.

Christian

Steve Fisher

unread,
Jul 25, 2012, 6:35:54 PM7/25/12
to icatproje...@googlegroups.com
Many things have changed since 4.0 - I suggest you get rid of the pdf ...

Steve
> --
> You received this message because you are subscribed to the Google Groups
> "icatproject-support" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/icatproject-support/-/WW_IdTgHhqgJ.
Reply all
Reply to author
Forward
0 new messages