You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Michael Wechner <mi...@wyona.com> on 2004/07/05 17:59:01 UTC
"joins"
Is it possible to do something like a "join"
select * from a, b where a.A=A and b.B=B and a.id=b.id
meaning I have two different doctypes within the same collection,
e.g. metadata and content, but which correspond to the same id ...?
Or do I need to aggregate these two XMLs as one document type?
But then what would the XPath expression look like?
Please apologize if this might be just a common XPath expression
question ...
Thanks
Michi
--
Michael Wechner
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://cocoon.apache.org/lenya/
michael.wechner@wyona.com michi@apache.org
Re: "joins"
Posted by Vadim Gritsenko <va...@reverycodes.com>.
Michael Wechner wrote:
> Vadim Gritsenko wrote:
>
>> Michael Wechner wrote:
>>
>>> Is it possible to do something like a "join"
>>>
>>> select * from a, b where a.A=A and b.B=B and a.id=b.id
>>>
>>> meaning I have two different doctypes within the same collection,
>>> e.g. metadata and content, but which correspond to the same id ...?
>>>
>>> Or do I need to aggregate these two XMLs as one document type?
>>> But then what would the XPath expression look like?
>>
>>
>> If you can come up with an example I might be able to suggest
>> appropriate xpath for you
>
>
> well, if I merge/aggregate the two XML files and save them as one
> document within Xindice, then I can do the following
>
> "/article/lenya:meta[not(wf:state='live') and dc:contributor='michi']"
Hmm I think what you really need is to query a collection for articles
with some conditions on articles' meta data. Currently xindice can not
do this, the only way to perform two queries: one against metadata, and
retrieve list of article IDs, and another query against collection, to
retrieve needed articles.
If you have time adding feature of quering collection by its metadata,
patch will be appreciated :-)
PS Another guy recenly asked for this feature:
http://marc.theaimsgroup.com/?l=xindice-users&m=108858673023527
Thanks,
Vadim
> whereas the two documents are
>
> <?xml version="1.0"?>
> <wf:history>
> <wf:state>review</wf:state>
> </wf:history>
>
>
> <?xml version="1.0"?>
> <article>
> <lenya:meta
> <dc:contributor>michi</dc:contributor>
> </lenya:meta>
> </article>
>
> and merged resp. aggregated
>
> <?xml version="1.0"?>
> <article>
> <lenya:meta>
> <wf:state>review</wf:state>
> <dc:contributor>michi</dc:contributor>
> </lenya:meta>
> </article>
>
>
> Thanks for your help
>
> Michi
Re: "joins"
Posted by Michael Wechner <mi...@wyona.com>.
Vadim Gritsenko wrote:
> Michael Wechner wrote:
>
>> Is it possible to do something like a "join"
>>
>> select * from a, b where a.A=A and b.B=B and a.id=b.id
>>
>> meaning I have two different doctypes within the same collection,
>> e.g. metadata and content, but which correspond to the same id ...?
>>
>> Or do I need to aggregate these two XMLs as one document type?
>> But then what would the XPath expression look like?
>
>
>
> If you can come up with an example I might be able to suggest
> appropriate xpath for you
well, if I merge/aggregate the two XML files and save them as one
document within Xindice, then I can do the following
"/article/lenya:meta[not(wf:state='live') and dc:contributor='michi']"
whereas the two documents are
<?xml version="1.0"?>
<wf:history>
<wf:state>review</wf:state>
</wf:history>
<?xml version="1.0"?>
<article>
<lenya:meta
<dc:contributor>michi</dc:contributor>
</lenya:meta>
</article>
and merged resp. aggregated
<?xml version="1.0"?>
<article>
<lenya:meta>
<wf:state>review</wf:state>
<dc:contributor>michi</dc:contributor>
</lenya:meta>
</article>
Thanks for your help
Michi
>
> Vadim
>
>
--
Michael Wechner
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://cocoon.apache.org/lenya/
michael.wechner@wyona.com michi@apache.org
Re: "joins"
Posted by Vadim Gritsenko <va...@reverycodes.com>.
Michael Wechner wrote:
> Is it possible to do something like a "join"
>
> select * from a, b where a.A=A and b.B=B and a.id=b.id
>
> meaning I have two different doctypes within the same collection,
> e.g. metadata and content, but which correspond to the same id ...?
>
> Or do I need to aggregate these two XMLs as one document type?
> But then what would the XPath expression look like?
If you can come up with an example I might be able to suggest
appropriate xpath for you
Vadim