[ome-devel] Query semantically typed objects for has-many
relations?
Josiah Johnston
siah at nih.gov
Wed Dec 8 15:46:38 GMT 2004
So far, it hasn't been possible to specify has-many relationships among
STs. This was a limitation we intentionally imposed to avoid some
problems with ambiguous attribute equality. i.e. Are two experimenter
attributes equal when they only differ in the experiments they own?
Should the list returned by a has-many relationship be used in
determining equality between objects? Personally, I think it's
dependent on the semantics of the relationship in question.
Anyways, I recently finished some code that infers has-many
relationships on STs and generates accessor methods for them on demand.
It's on an experimental branch right now, but I'm planning on merging
it with HEAD on Friday unless anyone finds a bug in it. If you'd like
to check it out before then, from OME/,
cvs update -r inference_and_dynamical_generation_of_has_many_relations
src/perl2/OME/DBObject.pm src/perl2/OME/SemanticType.pm
src/perl2/OME/SemanticType/Superclass.pm src/perl2/OME/Remote/DTO.pm
will get you the relevant parts of the experimental branch.
So, using it...
call getAllHasMany() on a package or object to get all has-many
relations (ones that have been explicitly defined and ones that have
been inferred). Its calling conventions are the same as getHasMany().
The java code also works now, but the ST packages will need to be
regenerated. The has-many method naming conventions changed slightly.
Announcement and discussion of this has been floating on the internal
developer list. You may want to ask Chris to let you join.
-josiah
On Dec 6, 2004, at 4:33 AM, Zachary Pincus wrote:
> Hello folks,
>
> If I may ask a (possibly uninformed) question, I'd like to know
> whether it is possible to query semantically-typed objects to find out
> their has-many relations.
>
> I ask because calling $object->getHasMany() on any semantically-typed
> object never seems to return anything, whereas calling the same on a
> base data object works as advertised.
>
> The core types have their has-many fields clearly defined with
> __PACKAGE__->hasMany(...) style calls. Is there a similar "call" in
> the OME XML to alert OME to the fact that a semantically-typed object
> participates in a has-many relation? Or does/should OME automatically
> detect this on loading a new semantic type?
>
> This is all apropos of working with the remote framework. I can't get
> the remote framework to return the has-many fields for
> semantically-typed data objects, even though the java client and the
> omejava code creation tool implicitly presume this ability. (Leading
> to several bugs with the java remote framework which I have reported
> on the bugtracker.) That is (for example), it's easy to get the remote
> framework to package Image objects with a list of all associated
> Pixels objects -- Images are a base type, and support getting lists of
> has-many attributes. However, retrieving a Group object packaged with
> all the appropriate Experimenters doesn't appear to be possible (even
> though the Java client code claims to support this).
>
>
> (One last question: are the java client library and the OME::Remote
> framework still under active development?)
>
> Thanks,
>
> Zach Pincus
>
> Department of Biochemistry and Program in Biomedical Informatics
> Stanford University School of Medicine
>
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>
More information about the ome-devel
mailing list