<strong>SIS</strong>- <strong>Application</strong> <strong>Programmatic</strong> <strong>Interface</strong>, <strong>Reference</strong> <strong>Manual</strong> } System.out.println(label); if ((ret_set2 = Q.get_instances(sis_session.getValue(),ret_set1)) != Q.APIFail) { Q.set_union(sis_session.getValue(), ret_set1, ret_set2); Q.reset_set(sis_session.getValue(), ret_set1); System.out.println("\nALL INSTANCES OF 'PhysicalObj' : \n"); while (Q.return_nodes(sis_session.getValue(), ret_set1, label) != Q.APIFail) System.out.println(" " +label); } Q.free_all_sets(sis_session.getValue()); Q.reset_name_scope(sis_session.getValue()); strobject.setValue("CAR"); if (Q.set_current_node(sis_session.getValue(), strobject) != Q.APIFail) if ((ret_set1 = Q.get_link_from(sis_session.getValue(), 0)) != Q.APIFail) { Q.reset_set(sis_session.getValue(), ret_set1); System.out.println("\nLINKS FROM 'CAR' : \n"); while (Q.return_nodes(sis_session.getValue(), ret_set1, label) != Q.APIFail) System.out.println(" " + label); Q.APIFail){ } Q.reset_set(sis_session.getValue(), ret_set1); System.out.println("\nINFO ABOUT LINKS FROM 'CAR' : \n"); while (Q.return_link(sis_session.getValue(), ret_set1, cls, label, cmv) != } System.out.print(" " + cls + " --- " + label + " ---> "); print_value(cmv); Q.free_all_sets(sis_session.getValue()); Q.reset_name_scope(sis_session.getValue()); StringObject strfclA = new StringObject("PhysicalObj"); StringObject strcatA = new StringObject("Parts"); StringObject strfclB = new StringObject("end"); StringObject strcatB = new StringObject("end"); CategorySet[] categs= new CategorySet[2]; CategorySet csobj1 = new CategorySet(strfclA.toString(), strcatA.toString(), QClass.FORWARD); CategorySet csobj2 = new CategorySet(strfclB.toString(), strcatB.toString(), 0); categs[0] = csobj1; categs[1] = csobj2; Q.set_categories(sis_session.getValue(), categs); strobject.setValue("AMT-9655"); if (Q.set_current_node(sis_session.getValue(), strobject) != Q.APIFail) if ((ret_set1 = Q.get_traverse_by_meta_category(sis_session.getValue(), 0, QClass.NOISA)) != Q.APIFail) { Q.reset_set(sis_session.getValue(), ret_set1); System.out.println("\nTRANSITIVE QUERY FROM 'AMT-9655' (meta-category : Parts) : \n"); while ((Q.return_link(sis_session.getValue(), ret_set1, cls, label, cmv)) != Q.APIFail) { System.out.print(" " + cls + " --- " + label + " ---> "); print_value(cmv); } } } Q.end_query(sis_session.getValue()); Q.close_connection(sis_session.getValue()); Q.release_<strong>SIS</strong>_Session(sis_session.getValue()); static public void print_value(CMValue cmv) { int type; type =cmv.getType(); switch (type) { case CMValue.TYPE_INT :System.out.println(cmv.getInt()); break; case CMValue.TYPE_STRING :System.out.println(cmv.getString()); break; case CMValue.TYPE_FLOAT:System.out.println(cmv.getFloat()); break; case CMValue.TYPE_NODE :System.out.println(cmv.getString()); break; case CMValue.TYPE_TIME :System.out.println(cmv.getTime()); break; case CMValue.TYPE_SYSID:System.out.println(cmv.getSysid()); break; } August 2002/v2.2.2 -62- <strong>ICS</strong>-FORTH
<strong>SIS</strong>-<strong>Application</strong> <strong>Programmatic</strong> <strong>Interface</strong>, <strong>Reference</strong> <strong>Manual</strong> } public static void main(String[] args) { new Car(); System.out.println("press any key to exit...."); try{ System.in.read(); }catch(IOException e){ System.out.println("Cannot Read!!!"); } } } August 2002/v2.2.2 -63- <strong>ICS</strong>-FORTH