Hi,
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):
final
NodeManager typeDefManager = cloud.getNodeManager("typedef");
final NodeList typeDefList = typeDefManager.getList("name='A'", null, null);
// Type definition number for node type 'A'
final NodeList typeDefList = typeDefManager.getList("name='A'", null, null);
// Type definition number for node type 'A'
final int
aDefNumber =
typeDefList.getNode(0).getNumber();
out.println(aDefNumber);
out.println(aDefNumber);
final
NodeManager typeRelManager = cloud.getNodeManager("typerel");
final NodeList typeRelList =
final NodeList typeRelList =
typeRelManager.getList("snumber=" + aDefNumber + " and dnumber=" + aDefNumber,
null, null);
// Type relation number of the A-related-A relation
// Type relation number of the A-related-A relation
final int
typeRelNumber =
typeRelList.getNode(0).getNumber();
out.println(typeRelNumber);
out.println(typeRelNumber);
final
RelationManager relationManager =
cloud.getRelationManager(typeRelNumber);
final NodeList relationList = relationManager.getList(null, null, null);
out.println(relationList.size());
final NodeList relationList = relationManager.getList(null, null, null);
out.println(relationList.size());
The final statement
prints exactly the number of A-related-A and A-related-B relations, not just the
number of A-related-A relations as I would have expected.
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.
Regards,
Ronald
Wildenberg.
-----------------------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.
----------------------------------------------------------
