You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by Kevin Ross <ke...@iverticalleap.com> on 2003/10/22 18:19:15 UTC

RE: Predicates are ignored in Xindice XPATH?

Good idea, this is one step closer to xquery.  I believe that the person
to implement this would be a good candidate for commit status, if they
were to be interested...

BTW- Has anyone from the xindice team ever contacted the saxon guys, to
check on how their xquery might be integrated?  I believe they may have
licensing conflicts, but maybe the saxon group would be interested in
adjusting the license for xindice use? (HINT: maybe this would solve the
whole issue)

-Kevin Ross

-----Original Message-----
From: Kurt Kavanaugh [mailto:kkavanaugh@teletrol.com] 
Sent: Wednesday, October 22, 2003 11:00 AM
To: xindice-users@xml.apache.org
Subject: RE: Predicates are ignored in Xindice XPATH?


And therin lies the XPATH/collection ambiguity. It seems that there
needs to be a layer above to provide the abstraction for correct
aggregate functionality.


-----Original Message-----
From: Terry Rosenbaum [mailto:Terry@amicas.com]
Sent: Wednesday, October 22, 2003 11:56 AM
To: xindice-users@xml.apache.org
Subject: Re: Predicates are ignored in Xindice XPATH?


Hi WH,

Xindice does not implement aggregate
expressions across multiple Resources
contained in a Collection. The XPath expression
is evaluated against each Resource in the
Collection and all resulting Resources are returned.

You can perform certain aggregations
yourself in your application. For positional
aggregation such as suggested by (//data)[position()=last()],
be aware that the order of returned Resources
is arbitrary (not guaranteed by contract
as e.g. order of insertion AFAIK).

Thus, you would probably need to
perform a sort of some kind before choosing
the "last" for a meaningful result.

-Terry




webhiker@tiscali.fr wrote:

> Hi Terry,
>
> No, even the testbed confirms my suspicions.
> The following expression on the testbed :
> (//data)[position()=last()]
>
> is what I want - only a single result. But running this through 
> Xindice it gives me a ResourceSet containing 3 resources.
>
> Seems the syntax is translated a bit ambiguously for some reason.
>
> I've not been able to solve the problem.
>
> WH
>
>
> Terry Rosenbaum wrote:
>
>> Hi WH,
>>
>> If, for example, you have 3 <Id> elements
>> in your collection, the correct result would
>> be 3 Resources each containing one of the 3 <Id>
>> elements.
>>
>> Your XPath syntax is not doing what you desire.
>>
>> Using an XPath testbed may help. One is available
>> on the web here: 
>> http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm
>>
>> -Terry
>>
>> webhiker@tiscali.fr wrote:
>>
>>> Hi all,
>>>
>>> Given the XPath :
>>> (//Id)[last()]
>>>
>>> Xindice always seems to ignore the predicate portion, and it returns

>>> the results as if I had written :
>>> //Id
>>>
>>> Is this a problem with Xindice, XPath or my syntax? I'm trying to 
>>> return the last Id element in my database.
>>>
>>> I'd appreciate any help.
>>>
>>> Thanks
>>> WH
>>>
>>
>>
>
>


Re: Other sticky issues

Posted by JC Tchitchiama <jc...@panonet.net>.
All,

1) Does Henrik finds the same memory consumption when the resource is 
returned as a String e.g.

...
XMLResource res = col.getResource ();
String document Contents = res.getContent().toString();
...

2) what are the JVM switch you have to help the garbage collection kick-in 
more aggressively

3) Has anyone run a profiling tool with xindice at all ?

On Sunday 02 Nov 2003 5:03 pm, Henrik Vendelbo wrote:
> I was referring to Xindice. I looked at XMLResourceImpl, and if it is
> anything to go by, then the memory consumption is understandable. There has
> also been some concern about collection.close() being a nil implemention (I
> asume it still is). The getContentAsSAX gets a new XMLReader for every call
> relying on the garbage collector and Xerxes for memory efficiency. That in
> itself might be quite a hit to my knowledge.
>
> ----- Original Message -----
> From: "Alain Javier Guarnieri del Gesu" <ja...@ajgdg.com>
> To: "Henrik Vendelbo" <hv...@bluprints.com>
> Cc: <xi...@xml.apache.org>
> Sent: Saturday, November 01, 2003 6:03 PM
> Subject: Re: Other sticky issues
>
> > * Henrik Vendelbo <hv...@bluprints.com> [2003-11-01 16:29]:
> > > ----- Original Message -----
> > > From: "Alain Javier Guarnieri del Gesu" <ja...@ajgdg.com>
> > > To: <xi...@xml.apache.org>; <xi...@xml.apache.org>
> > > Sent: Thursday, October 30, 2003 1:50 PM
> > > Subject: Re: Predicates are ignored in Xindice XPATH?
> > >
> > > > * Kevin Ross <ke...@iverticalleap.com> [2003-10-22 17:18]:
> > > > > From: Kurt Kavanaugh [mailto:kkavanaugh@teletrol.com]
> > > > > Sent: Wednesday, October 22, 2003 11:00 AM
> > > > > To: xindice-users@xml.apache.org
> > > > > Subject: RE: Predicates are ignored in Xindice XPATH?
> > > > >
> > > > > BTW- Has anyone from the xindice team ever contacted the saxon
> > > > > guys,
>
> to
>
> > > > > check on how their xquery might be integrated?  I believe they may
>
> have
>
> > > > > licensing conflicts, but maybe the saxon group would be interested
>
> in
>
> > > > > adjusting the license for xindice use? (HINT: maybe this would
> > > > > solve
>
> the
>
> > > > > whole issue)
> > > >
> > > > Is there a roadmap for XQuery support? Besides aggregation across
> > > > documents, are the any other major sticking points in Xindice?
> > > >
> > > > What needs tweaking in the Saxon license? (IANAL)
> > >
> > > Memory consumption is sticky in my book. It uses a huge amount of
> > > memory it seems from my tests. It could be the way I access, but
> > > it's fairly straightforward though.
> > >
> > > Create an object through JAXB once. Then persist it to a Xindice
> > > collection 1000 times via SAX. That appears to use beyond 1Gb RAM
> > > according to java.lang.Runtime. And takes 17 secs.
> > >
> > > Admitiably I do use a unit test that isn't very kind, since every
> > > time I run a test I create the collection, get the collection, do
> > > the test, and then remove all resources in the collection
> >
> > I've been reading the code for XQuery. They use WeakHashMaps to
> > cache the page hits. If the test runs fast enough, it doesn't seem
> > like there would be a need to collect that memory. Or perhaps, their
> > is a leak somewhere, meaning, that a pages are read over and over
> > again, and never dereferenced.
> >
> > --
> > Alain Javier Guarnieri del Gesu - javi@ajgdg.com

-- 

Best Regards.

JC.
           \\- - -//
          (  @ @  )
===oOOo-(_)-oOOo=================================================
      jct@panonet.net
=================================================================


Re: Other sticky issues

Posted by Alain Javier Guarnieri del Gesu <ja...@ajgdg.com>.
* Henrik Vendelbo <hv...@bluprints.com> [2003-11-02 13:05]:
> ----- Original Message ----- 
> From: "Alain Javier Guarnieri del Gesu" <ja...@ajgdg.com>
> To: "Henrik Vendelbo" <hv...@bluprints.com>
> Cc: <xi...@xml.apache.org>
> Sent: Saturday, November 01, 2003 6:03 PM
> Subject: Re: Other sticky issues
> 
> 
> > * Henrik Vendelbo <hv...@bluprints.com> [2003-11-01 16:29]:
> >
> > > Memory consumption is sticky in my book. It uses a huge amount of
> > > memory it seems from my tests. It could be the way I access, but
> > > it's fairly straightforward though.
> >
> > > Create an object through JAXB once. Then persist it to a Xindice
> > > collection 1000 times via SAX. That appears to use beyond 1Gb RAM
> > > according to java.lang.Runtime. And takes 17 secs.
> >
> > > Admitiably I do use a unit test that isn't very kind, since every
> > > time I run a test I create the collection, get the collection, do
> > > the test, and then remove all resources in the collection
> >
> > I've been reading the code for XQuery. They use WeakHashMaps to
> > cache the page hits. If the test runs fast enough, it doesn't seem
> > like there would be a need to collect that memory. Or perhaps, their
> > is a leak somewhere, meaning, that a pages are read over and over
> > again, and never dereferenced.

> I was referring to Xindice. I looked at XMLResourceImpl, and if it
> is anything to go by, then the memory consumption is
> understandable. There has also been some concern about
> collection.close() being a nil implemention (I asume it still is).
> The getContentAsSAX gets a new XMLReader for every call relying on
> the garbage collector and Xerxes for memory efficiency. That in
> itself might be quite a hit to my knowledge.

I was refering to Xindice too, typo, sorry.

-- 
Alain Javier Guarnieri del Gesu - javi@ajgdg.com

Re: Other sticky issues

Posted by Henrik Vendelbo <hv...@bluprints.com>.
I was referring to Xindice. I looked at XMLResourceImpl, and if it is
anything to go by, then the memory consumption is understandable. There has
also been some concern about collection.close() being a nil implemention (I
asume it still is). The getContentAsSAX gets a new XMLReader for every call
relying on the garbage collector and Xerxes for memory efficiency. That in
itself might be quite a hit to my knowledge.

----- Original Message ----- 
From: "Alain Javier Guarnieri del Gesu" <ja...@ajgdg.com>
To: "Henrik Vendelbo" <hv...@bluprints.com>
Cc: <xi...@xml.apache.org>
Sent: Saturday, November 01, 2003 6:03 PM
Subject: Re: Other sticky issues


> * Henrik Vendelbo <hv...@bluprints.com> [2003-11-01 16:29]:
> > ----- Original Message ----- 
> > From: "Alain Javier Guarnieri del Gesu" <ja...@ajgdg.com>
> > To: <xi...@xml.apache.org>; <xi...@xml.apache.org>
> > Sent: Thursday, October 30, 2003 1:50 PM
> > Subject: Re: Predicates are ignored in Xindice XPATH?
> >
> >
> > > * Kevin Ross <ke...@iverticalleap.com> [2003-10-22 17:18]:
> > >
> > > > From: Kurt Kavanaugh [mailto:kkavanaugh@teletrol.com]
> > > > Sent: Wednesday, October 22, 2003 11:00 AM
> > > > To: xindice-users@xml.apache.org
> > > > Subject: RE: Predicates are ignored in Xindice XPATH?
> > > >
> > > > BTW- Has anyone from the xindice team ever contacted the saxon guys,
to
> > > > check on how their xquery might be integrated?  I believe they may
have
> > > > licensing conflicts, but maybe the saxon group would be interested
in
> > > > adjusting the license for xindice use? (HINT: maybe this would solve
the
> > > > whole issue)
>
> > > Is there a roadmap for XQuery support? Besides aggregation across
> > > documents, are the any other major sticking points in Xindice?
>
> > > What needs tweaking in the Saxon license? (IANAL)
>
> > Memory consumption is sticky in my book. It uses a huge amount of
> > memory it seems from my tests. It could be the way I access, but
> > it's fairly straightforward though.
>
> > Create an object through JAXB once. Then persist it to a Xindice
> > collection 1000 times via SAX. That appears to use beyond 1Gb RAM
> > according to java.lang.Runtime. And takes 17 secs.
>
> > Admitiably I do use a unit test that isn't very kind, since every
> > time I run a test I create the collection, get the collection, do
> > the test, and then remove all resources in the collection
>
> I've been reading the code for XQuery. They use WeakHashMaps to
> cache the page hits. If the test runs fast enough, it doesn't seem
> like there would be a need to collect that memory. Or perhaps, their
> is a leak somewhere, meaning, that a pages are read over and over
> again, and never dereferenced.
>
> -- 
> Alain Javier Guarnieri del Gesu - javi@ajgdg.com
>
>



Re: Other sticky issues

Posted by Alain Javier Guarnieri del Gesu <ja...@ajgdg.com>.
* Henrik Vendelbo <hv...@bluprints.com> [2003-11-01 16:29]:
> ----- Original Message ----- 
> From: "Alain Javier Guarnieri del Gesu" <ja...@ajgdg.com>
> To: <xi...@xml.apache.org>; <xi...@xml.apache.org>
> Sent: Thursday, October 30, 2003 1:50 PM
> Subject: Re: Predicates are ignored in Xindice XPATH?
> 
> 
> > * Kevin Ross <ke...@iverticalleap.com> [2003-10-22 17:18]:
> >
> > > From: Kurt Kavanaugh [mailto:kkavanaugh@teletrol.com]
> > > Sent: Wednesday, October 22, 2003 11:00 AM
> > > To: xindice-users@xml.apache.org
> > > Subject: RE: Predicates are ignored in Xindice XPATH?
> > >
> > > BTW- Has anyone from the xindice team ever contacted the saxon guys, to
> > > check on how their xquery might be integrated?  I believe they may have
> > > licensing conflicts, but maybe the saxon group would be interested in
> > > adjusting the license for xindice use? (HINT: maybe this would solve the
> > > whole issue)

> > Is there a roadmap for XQuery support? Besides aggregation across
> > documents, are the any other major sticking points in Xindice?

> > What needs tweaking in the Saxon license? (IANAL)

> Memory consumption is sticky in my book. It uses a huge amount of
> memory it seems from my tests. It could be the way I access, but
> it's fairly straightforward though.

> Create an object through JAXB once. Then persist it to a Xindice
> collection 1000 times via SAX. That appears to use beyond 1Gb RAM
> according to java.lang.Runtime. And takes 17 secs.

> Admitiably I do use a unit test that isn't very kind, since every
> time I run a test I create the collection, get the collection, do
> the test, and then remove all resources in the collection

I've been reading the code for XQuery. They use WeakHashMaps to
cache the page hits. If the test runs fast enough, it doesn't seem
like there would be a need to collect that memory. Or perhaps, their
is a leak somewhere, meaning, that a pages are read over and over
again, and never dereferenced.

-- 
Alain Javier Guarnieri del Gesu - javi@ajgdg.com

Other sticky issues

Posted by Henrik Vendelbo <hv...@bluprints.com>.
Memory consumption is sticky in my book. It uses a huge amount of memory it
seems from my tests. It could be the way I access, but it's fairly
straightforward though.

Create an object through JAXB once. Then persist it to a Xindice collection
1000 times via SAX. That appears to use beyond 1Gb RAM according to
java.lang.Runtime. And takes 17 secs.

Admitiably I do use a unit test that isn't very kind, since every time I run
a test I create the collection, get the collection, do the test, and then
remove all resources in the collection

----- Original Message ----- 
From: "Alain Javier Guarnieri del Gesu" <ja...@ajgdg.com>
To: <xi...@xml.apache.org>; <xi...@xml.apache.org>
Sent: Thursday, October 30, 2003 1:50 PM
Subject: Re: Predicates are ignored in Xindice XPATH?


> * Kevin Ross <ke...@iverticalleap.com> [2003-10-22 17:18]:
>
> > -----Original Message-----
> > From: Kurt Kavanaugh [mailto:kkavanaugh@teletrol.com]
> > Sent: Wednesday, October 22, 2003 11:00 AM
> > To: xindice-users@xml.apache.org
> > Subject: RE: Predicates are ignored in Xindice XPATH?
> >
> >
> > And therin lies the XPATH/collection ambiguity. It seems that there
> > needs to be a layer above to provide the abstraction for correct
> > aggregate functionality.
> >
> >
> > Good idea, this is one step closer to xquery.  I believe that the person
> > to implement this would be a good candidate for commit status, if they
> > were to be interested...
> >
> > BTW- Has anyone from the xindice team ever contacted the saxon guys, to
> > check on how their xquery might be integrated?  I believe they may have
> > licensing conflicts, but maybe the saxon group would be interested in
> > adjusting the license for xindice use? (HINT: maybe this would solve the
> > whole issue)
>
> Is there a roadmap for XQuery support? Besides aggregation across
> documents, are the any other major sticking points in Xindice?
>
> What needs tweaking in the Saxon license? (IANAL)
>
> -- 
> Alain Javier Guarnieri del Gesu - javi@ajgdg.com
>
>



Re: Predicates are ignored in Xindice XPATH?

Posted by Vadim Gritsenko <va...@verizon.net>.
Alain Javier Guarnieri del Gesu wrote:

>What needs tweaking in the Saxon license? (IANAL)
>  
>

Nothing. It's Ok.

Vadim
\


Re: Predicates are ignored in Xindice XPATH?

Posted by Alain Javier Guarnieri del Gesu <ja...@ajgdg.com>.
* Kevin Ross <ke...@iverticalleap.com> [2003-10-22 17:18]:

> -----Original Message-----
> From: Kurt Kavanaugh [mailto:kkavanaugh@teletrol.com] 
> Sent: Wednesday, October 22, 2003 11:00 AM
> To: xindice-users@xml.apache.org
> Subject: RE: Predicates are ignored in Xindice XPATH?
> 
> 
> And therin lies the XPATH/collection ambiguity. It seems that there
> needs to be a layer above to provide the abstraction for correct
> aggregate functionality.
> 
> 
> Good idea, this is one step closer to xquery.  I believe that the person
> to implement this would be a good candidate for commit status, if they
> were to be interested...
> 
> BTW- Has anyone from the xindice team ever contacted the saxon guys, to
> check on how their xquery might be integrated?  I believe they may have
> licensing conflicts, but maybe the saxon group would be interested in
> adjusting the license for xindice use? (HINT: maybe this would solve the
> whole issue)

Is there a roadmap for XQuery support? Besides aggregation across
documents, are the any other major sticking points in Xindice?

What needs tweaking in the Saxon license? (IANAL)

-- 
Alain Javier Guarnieri del Gesu - javi@ajgdg.com