« Back to AAU Project

Getting Ids of a connected element with a specific relation

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
How can we know what are the Ids of the elements that are connected to a specific element with a specific relation, e.g.,  with a relation  „Is-A“?

RE: Getting Ids of a connected element with a specific relation
Answer
6/22/15 11:19 AM as a reply to Fadi Al Machot.
Hi, Fadi.

The operation can be done in two ways:

1. Through AdoScript Command Calls
 - use GET_CONNECTORS to identify all outgoing connectors
http://www.adoxx.org/AdoScriptDoc/files/Message_Ports/Manipulation_APIs/Core/GET_CONNECTORS-js.html#GET_CONNECTORS
 - use GET_CONNECTOR_ENDPOINTS to get the id of the "TO" object for each connector
http://www.adoxx.org/AdoScriptDoc/files/Message_Ports/Manipulation_APIs/Core/GET_CONNECTOR_ENDPOINTS-js.html#GET_CONNECTOR_ENDPOINTS

your code should look like:
 1CC "Core" GET_CONNECTORS objid: ( my_objid ) out
 2#-->RESULT ecode:intValue objids:strValue
 3SETL sListOfObjects: ""
 4FOR sObjID in: ( objids ) {
 5  SETL nConnectorID: ( VAL sObjID)
 6  CC "Core" GET_CLASS_ID objid: (nConnectorID)
 7   # RESULT ecode:intValue classid:intValue isrel:intValue
 8  CC "Core" GET_CLASS_NAME classid: ( classid )
 9   # RESULT ecode:intValue classname:strValue isrel:intValue
10  IF ( classname = "Is-A") {
11    CC "Core" GET_CONNECTOR_ENDPOINTS objid: (nConnectorID
12    #-->RESULT ecode:intValue fromobjid:id toobjid:id
13    SETL sListOfObject: ( tokunion ( sListOfObjects, STR toobjid, " "))
14  }
15}



2. Using AQL, with an AQL-Expression like:
(<"myClass">[?"Name" like "myObjectName"]->"Is-A")

http://www.adoxx.org/live/query-adoscript