> -----Oorspronkelijk bericht-----
> Van: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] Namens Michiel Meeuwissen
> Verzonden: donderdag 21 oktober 2004 10:30
> Aan: [EMAIL PROTECTED]
> Onderwerp: Re: Fetching relations from the MMBase cloud
> 
> Ronald Wildenberg wrote:
> >    I have a problem retrieving relations from an MMBase cloud. I
have the
> >    following (simplified) cloud model:
> >     
> >    A - related - A
> >    A - related - B
> >     
> >    I wish to retrieve all 'related' relations between A and A. This
seems to
> >    be impossible, since I always retrieve the relations between both
A and A
> >    and A and B. My final attempt was the following (which also does
not
> >    succeed):
> 
> Do you want to list all relation nodes between any objects of 
> type A? I assume that B does not extend A?


That's correct. I could just as well have said B-related-C, this does
not change anything.


> 
> I suppose you have to list all object of type A and then 
> count all related A nodes iteratively. 
> 
> 
> >    final NodeManager typeDefManager =
cloud.getNodeManager("typedef");
> >    final NodeList typeDefList = typeDefManager.getList("name='A'",
null, null);
> 
> ??!!?? Why would this be any different then cloud.getNodeManager("A")?
> 
 

That's also possible. I didn't know that
cloud.getNodeManager("A").getNumber() returned the same number.


> 
> >     
> >    So the question is: how do I retrieve all relations between 2
node types
> >    without retrieving all relations that are defined by the same
builder.
> 
> Perhaps something like <mm:relatednodes path="A,related,A" 
> element="related">, or the Bridge equivalent of that.
> 


The problem is that in the following statement I expect to retrieve a
relation manager specific to the A-related-A relation (typeRelNumber is
the number of the A-related-A definition in the typerel table):

RelationManager relationManager =
cloud.getRelationManager(typeRelNumber);

However, if I list nodes using this relation manager, I get _all_
relations from the insrel table, not only the A-related-A relations.

Maybe your solution is the only one possible, but it's a pity that it's
impossible to list relations between two node types directly.

A related question is: What is the typerel table exactly used for? It
contains all possible relations between node types, but these are not
used in e.g. the insrel table. There only reldef numbers are used, which
results in the described behavior.

Suppose for instance the insrel table contains the following:
(snumber=Anode1, dnumber=Anode2, rnumber=reldefNr)
(snumber=Anode1, dnumber=Bnode1, rnumber=reldefNr)

This can never be used to retrieve relations between just A-type nodes,
since rnumber is a number from reldef and both A-related-A and
A-related-B are defined by the same builder (insrel).


> Michiel
> 
> 

Ronald.


-----------------------Disclaimer-------------------------
Dit bericht (met bijlagen) is met grote zorgvuldigheid samengesteld. Voor mogelijke 
onjuistheid en/of onvolledigheid van de hierin verstrekte informatie kan Kennisnet 
geen aansprakelijkheid aanvaarden, evenmin kunnen aan de inhoud van dit bericht (met 
bijlagen) rechten worden ontleend. De inhoud van dit bericht (met bijlagen) kan 
vertrouwelijke informatie bevatten en is uitsluitend bestemd voor de geadresseerde van 
dit bericht. Indien u niet de beoogde ontvanger van dit bericht bent, verzoekt 
Kennisnet u dit bericht te verwijderen, eventuele bijlagen niet te openen en wijst 
Kennisnet u op de onrechtmatigheid van het gebruiken, kopi�ren of verspreiden van de 
inhoud van dit bericht (met bijlagen).

This message (with attachments) is given in good faith. Kennisnet cannot assume any 
responsibility for the accuracy or reliability of the information contained in this 
message (with attachments), nor shall the information be construed as constituting any 
obligation on the part of Kennisnet. The information contained in this message (with 
attachments) may be confidential or privileged and is only intended for the use of the 
named addressee. If you are not the intended recipient, you are requested by Kennisnet 
to delete this message (with attachments) without opening it and you are notified by 
Kennisnet that any disclosure, copying or distribution of the information contained in 
this message (with attachments) is strictly prohibited and unlawful.
----------------------------------------------------------


Reply via email to