[MOBY-l] Re: [MOBY] cgi client
Mark Wilkinson
markw at illuminae.com
Fri Jun 27 14:01:32 UTC 2003
Hi all,
I'm flipping this off-list conversation back onto the list, since it is
useful for everyone.
<background>Rebecca's service returns base Object type objects, but she
used copy and paste on my example code without modifying the object
structure, so she is outputting Object type objects with the structure
of GO_Term objects.</background>
Duncan - read this, as it answers part of your question...
On Fri, 2003-06-27 at 01:13, Rebecca Ernst wrote:
> so what's the matter with them? Comparing it to your output objects I
> can't find big differences.
Hi Rebecca!
The problem is that you are outputting "Object" type objects, but you
have Term and Description fields... which don't appear in an "Object"
object. They only appear in "GO_Term" Objects.
I'm still hoping that we find someone in the project who is skilled at
XML Schema so that we can generate schema for every object class, but at
the moment the way to go about it is to use the
MOBY::Client::Central->Relationships(objectType => "X") call to
determine what the structure of your object should be (i.e. what fields
you need to include/expect when you send/receive objects of type X
(please check the documentation, as I am not sure that I have given you
the correct method signature there...). So, in your case, you would
call something like:
MOBY::Client::Central->Relationships(objectType => "Object")
and it would tell you that there are *no* relationships at all... which
makes sense since Object is the root of all objects, inherits from
nothing, and contains nothing.
The object type that I am returning from my service is GO_Term. If you
call:
MOBY::Client::Central->Relationships(objectType => "GO_Term")
You will get back XML saying that:
GO_TERM ISA Object
GO_TERM HASA String (Description)
GO_TERM HASA String (Term)
NOTE TO DUNCAN:
The call to ->Relationships traverses only one relationship type at a
time. i.e. it will follow the ISA relationships as far back as possible
- invariably back to Object - and will follow the HASA relationships as
far back as possible, but it will NOT follow the ISA's of subcomponents
in a HASA relationship with the query object.
So what we have in our hand from the call above is an "Object" type
object, for which we know the structure as it is the primitive, and we
have two "String" type objects, for which we do not (necessarily) know
the structure. (of course, we *do* know the structure, since we define
these as primitives in the API also, but just humour me...).
So, we would now take "String" and perform the same query on that
object:
MOBY::Client::Central->Relationships(objectType => "GO_Term")
it would return to us the XML indicating that
String ISA Object
And since Object is a primitive we have now fully decomposed this object
and we know its full structure.
...tedious, yes!
As soon as we can generate XML schema from RDF we will be laughing!
Cheers all,
Mark
--
Mark Wilkinson <markw at illuminae.com>
Illuminae
More information about the moby-l
mailing list