You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Amita Vadhavkar <am...@gmail.com> on 2007/02/27 11:22:41 UTC

[SDO] Question:Support for xpath expression to get batch of DOs

Hi All,

In the current SDO, the support is provided for
do.getDataObject(xpath)
and
rootDo.getList(property)

But there is no way to get multiple DOs from evaluating xpath.
i.e. expression like rootDo.getDataObject("customer[name='patrick']")
returns the first
matching row and not all matching rows.
And expression like rootDo.getList("customer") gets all customers, but does
not support
xpath syntax to tailor the list for a selective (name='patrick') condition.
If the user wants a convenient way to get all customers with name='patrick',
he needs to get this with recursion over root DO and using detach()
method. Is there any helper method available in Tuscany-SDO for this kind
of operation as it will be a basic requirement for any batch select/update
etc.
operations on a data source?

Regards,
Amita

Re: [SDO] Question:Support for xpath expression to get batch of DOs

Posted by kelvin goodson <ke...@thegoodsons.org.uk>.
Hi Amita,
  the scheme is just a prefixing device defined by the SDO spec that allows
implementations to provide for alternative path syntaxes.  It's just
academic at the moment,  since we use the default scheme and don't have any
alternatives. So it permits things like dataObject.get("myScheme:<path
syntax expressions>);

Best Regards, Kelvin.

On 01/03/07, Amita Vadhavkar <am...@gmail.com> wrote:
>
> Hi Kevin, Frank,
>
> Yes, Frank, thanks a lot. This is what exactly I was looking for.
> When this gets added to the SDO spec, I would surely like to work
> on the Tuscany-SDO implementation part of it.
>
> Also, Kevin, will you please provide me some pointers on the scheme
> front. I have so far worked on DAS and will need to know more
> of SDO to get a better understanding.
>
> Regards,
> Amita
>
> On 2/27/07, kelvin goodson <ke...@gmail.com> wrote:
> > Hi Amita,
> >
> >   I'm pretty sure when you say "the current SDO" you are meaning the
> Tuscany
> > implementation.  The SDO spec allows for extensibility here in that it
> > includes a "scheme" prefix to the path syntax, which if  left out is
> > implicitly "sdo:".  Tuscany only has the default scheme implemented.  So
> one
> > way forward might be to  implement an alternative scheme.  However,  I'm
> not
> > sure that would work,  since the interfaces which would permit the
> return of
> > a collection (get(),getList()) have javadoc documentation which
> constrain
> > them to return the "value of a Property".   A long while back I heard
> talk
> > of an XPathHelper I think,  but I don't have a notion of any current
> > activity in that direction at the spec or implementation level.  Is this
> > something you feel you'd like to get involved with?
> >
> > Best Regards, Kelvin.
> >
> >
> > On 27/02/07, Amita Vadhavkar <am...@gmail.com> wrote:
> > >
> > > Hi All,
> > >
> > > In the current SDO, the support is provided for
> > > do.getDataObject(xpath)
> > > and
> > > rootDo.getList(property)
> > >
> > > But there is no way to get multiple DOs from evaluating xpath.
> > > i.e. expression like rootDo.getDataObject("customer[name='patrick']")
> > > returns the first
> > > matching row and not all matching rows.
> > > And expression like rootDo.getList("customer") gets all customers, but
> > > does
> > > not support
> > > xpath syntax to tailor the list for a selective (name='patrick')
> > > condition.
> > > If the user wants a convenient way to get all customers with
> > > name='patrick',
> > > he needs to get this with recursion over root DO and using detach()
> > > method. Is there any helper method available in Tuscany-SDO for this
> kind
> > > of operation as it will be a basic requirement for any batch
> select/update
> > > etc.
> > > operations on a data source?
> > >
> > > Regards,
> > > Amita
> > >
> >
>

Re: [SDO] Question:Support for xpath expression to get batch of DOs

Posted by Amita Vadhavkar <am...@gmail.com>.
Hi Kevin, Frank,

Yes, Frank, thanks a lot. This is what exactly I was looking for.
When this gets added to the SDO spec, I would surely like to work
on the Tuscany-SDO implementation part of it.

Also, Kevin, will you please provide me some pointers on the scheme
front. I have so far worked on DAS and will need to know more
of SDO to get a better understanding.

Regards,
Amita

On 2/27/07, kelvin goodson <ke...@gmail.com> wrote:
> Hi Amita,
>
>   I'm pretty sure when you say "the current SDO" you are meaning the Tuscany
> implementation.  The SDO spec allows for extensibility here in that it
> includes a "scheme" prefix to the path syntax, which if  left out is
> implicitly "sdo:".  Tuscany only has the default scheme implemented.  So one
> way forward might be to  implement an alternative scheme.  However,  I'm not
> sure that would work,  since the interfaces which would permit the return of
> a collection (get(),getList()) have javadoc documentation which constrain
> them to return the "value of a Property".   A long while back I heard talk
> of an XPathHelper I think,  but I don't have a notion of any current
> activity in that direction at the spec or implementation level.  Is this
> something you feel you'd like to get involved with?
>
> Best Regards, Kelvin.
>
>
> On 27/02/07, Amita Vadhavkar <am...@gmail.com> wrote:
> >
> > Hi All,
> >
> > In the current SDO, the support is provided for
> > do.getDataObject(xpath)
> > and
> > rootDo.getList(property)
> >
> > But there is no way to get multiple DOs from evaluating xpath.
> > i.e. expression like rootDo.getDataObject("customer[name='patrick']")
> > returns the first
> > matching row and not all matching rows.
> > And expression like rootDo.getList("customer") gets all customers, but
> > does
> > not support
> > xpath syntax to tailor the list for a selective (name='patrick')
> > condition.
> > If the user wants a convenient way to get all customers with
> > name='patrick',
> > he needs to get this with recursion over root DO and using detach()
> > method. Is there any helper method available in Tuscany-SDO for this kind
> > of operation as it will be a basic requirement for any batch select/update
> > etc.
> > operations on a data source?
> >
> > Regards,
> > Amita
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [SDO] Question:Support for xpath expression to get batch of DOs

Posted by Frank Budinsky <fr...@ca.ibm.com>.
Amita,

I guess what you're asking for is support for something like this:

  List customers = rootDo.getList("customer[name='patrick']");

which would return a list containing the 0 or more matching customers. 
There is currently discussion underway within the SDO specification 
working group to better align SDO's XPath (SDOPath) with real XML XPath. 
Ideally SDOPath will be a compatible subset of full XPath having the same 
core behavior. I'll add this to the list of issues.

Thanks,
Frank

"kelvin goodson" <ke...@gmail.com> wrote on 02/27/2007 08:00:28 
AM:

> Hi Amita,
> 
>   I'm pretty sure when you say "the current SDO" you are meaning the 
Tuscany
> implementation.  The SDO spec allows for extensibility here in that it
> includes a "scheme" prefix to the path syntax, which if  left out is
> implicitly "sdo:".  Tuscany only has the default scheme implemented.  So 
one
> way forward might be to  implement an alternative scheme.  However,  I'm 
not
> sure that would work,  since the interfaces which would permit the 
return of
> a collection (get(),getList()) have javadoc documentation which 
constrain
> them to return the "value of a Property".   A long while back I heard 
talk
> of an XPathHelper I think,  but I don't have a notion of any current
> activity in that direction at the spec or implementation level.  Is this
> something you feel you'd like to get involved with?
> 
> Best Regards, Kelvin.
> 
> 
> On 27/02/07, Amita Vadhavkar <am...@gmail.com> wrote:
> >
> > Hi All,
> >
> > In the current SDO, the support is provided for
> > do.getDataObject(xpath)
> > and
> > rootDo.getList(property)
> >
> > But there is no way to get multiple DOs from evaluating xpath.
> > i.e. expression like rootDo.getDataObject("customer[name='patrick']")
> > returns the first
> > matching row and not all matching rows.
> > And expression like rootDo.getList("customer") gets all customers, but
> > does
> > not support
> > xpath syntax to tailor the list for a selective (name='patrick')
> > condition.
> > If the user wants a convenient way to get all customers with
> > name='patrick',
> > he needs to get this with recursion over root DO and using detach()
> > method. Is there any helper method available in Tuscany-SDO for this 
kind
> > of operation as it will be a basic requirement for any batch 
select/update
> > etc.
> > operations on a data source?
> >
> > Regards,
> > Amita
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [SDO] Question:Support for xpath expression to get batch of DOs

Posted by kelvin goodson <ke...@gmail.com>.
Hi Amita,

  I'm pretty sure when you say "the current SDO" you are meaning the Tuscany
implementation.  The SDO spec allows for extensibility here in that it
includes a "scheme" prefix to the path syntax, which if  left out is
implicitly "sdo:".  Tuscany only has the default scheme implemented.  So one
way forward might be to  implement an alternative scheme.  However,  I'm not
sure that would work,  since the interfaces which would permit the return of
a collection (get(),getList()) have javadoc documentation which constrain
them to return the "value of a Property".   A long while back I heard talk
of an XPathHelper I think,  but I don't have a notion of any current
activity in that direction at the spec or implementation level.  Is this
something you feel you'd like to get involved with?

Best Regards, Kelvin.


On 27/02/07, Amita Vadhavkar <am...@gmail.com> wrote:
>
> Hi All,
>
> In the current SDO, the support is provided for
> do.getDataObject(xpath)
> and
> rootDo.getList(property)
>
> But there is no way to get multiple DOs from evaluating xpath.
> i.e. expression like rootDo.getDataObject("customer[name='patrick']")
> returns the first
> matching row and not all matching rows.
> And expression like rootDo.getList("customer") gets all customers, but
> does
> not support
> xpath syntax to tailor the list for a selective (name='patrick')
> condition.
> If the user wants a convenient way to get all customers with
> name='patrick',
> he needs to get this with recursion over root DO and using detach()
> method. Is there any helper method available in Tuscany-SDO for this kind
> of operation as it will be a basic requirement for any batch select/update
> etc.
> operations on a data source?
>
> Regards,
> Amita
>