How to add statements through json_prolog?
I ran tutorial.launch in knowrob_tutorial to start services that accept knowrob queries
<launch>
<node name="json_prolog" pkg="rosprolog" type="run_with_prolog_env"
args="ias_semantic_map $(find json_prolog)/bin/json_prolog knowrob_tutorial" />
</launch>
And now I can query knowrob from my program like this:
#!/usr/bin/env python
import roslib
roslib.load_manifest('json_prolog')
import rospy
import json_prolog
rospy.init_node('query_json_prolog')
prolog = json_prolog.Prolog()
query = prolog.query("owl_has(knowrob:'Drawer1',P,O)")
for sol in query.solutions():
print sol
query.finish()
rospy.spin()
However, I want to make use of the power of knowrob, that is, I want to add statements to knowrob knowledge base and make use of the reasoning mechanisms in knowrob. But I found there's only query I can use in json_prolog client libraries.
If I want to use pizza.owl I generated somewhere:
#!/usr/bin/env python
import roslib
roslib.load_manifest('json_prolog')
import rospy
import json_prolog
rospy.init_node('test_json_prolog')
prolog = json_prolog.Prolog()
query = prolog.query("owl_parser:owl_parse('/rosfuerte/home/project/test/owl/pizza.owl', false, false, true)")
query2 = prolog.query("owl_subclass_of(A, knowrob:'PizzaTopping')")
for sol in query2.solutions():
print sol
query.finish()
The solution I got is {'A': 'http://ias.cs.tum.edu/kb/knowrob.owl#PizzaTopping'}
But I want to get
{'A': 'xxx#PizzaTopping'}
{'A': 'xxx#CheeseTopping'}
{'A': 'xxx#MeatTopping'}
{'A': 'xxx#SeafoodTopping'}
{'A': 'xxx#VegetableTopping'}
since the subclasses are defined in pizza.owl
How can I achieve that?
Thanks in advance.