Go to the documentation of this file.00001
00002
00003
00004 import roslib; roslib.load_manifest('json_prolog')
00005
00006 import rospy
00007 import json_prolog
00008
00009 if __name__ == '__main__':
00010 rospy.init_node('test_re_ontology')
00011 prolog = json_prolog.Prolog()
00012
00013
00014 query = prolog.query("plan_subevents('http://www.roboearth.org/kb/set_a_table.owl#SetATable', Actions)")
00015 for solution in query.solutions():
00016 print 'Found actions for plan SetATable: Actions = %s' % (solution['Actions'])
00017 query.finish()
00018
00019
00020 query = prolog.query("plan_subevents('http://www.roboearth.org/kb/set_a_table.owl#SetATable', Actions)")
00021 for solution in query.solutions():
00022 print 'Found actions for plan SetATable: Actions = %s' % (solution['Actions'])
00023 query.finish()
00024
00025
00026
00027 query = prolog.query("plan_subevents('http://www.roboearth.org/kb/set_a_table.owl#SetATable', Actions), member(Act, Actions), comp_ehow:action_objectActedOn(Act, Obj)")
00028 for solution in query.solutions():
00029 print 'Found objects: Act = %s, Obj = %s' % (solution['Act'], solution['Obj'])
00030 query.finish()
00031
00032
00033
00034 query = prolog.query("plan_subevents('http://www.roboearth.org/kb/set_a_table.owl#SetATable', Actions), member(Act, Actions), comp_ehow:action_toLocation(Act, Loc)")
00035 for solution in query.solutions():
00036 print 'Found locations: Act = %s, Loc = %s' % (solution['Act'], solution['Loc'])
00037 query.finish()
00038
00039
00040
00041
00042
00043