ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Problems with namespaces in KnowRob

asked 2013-10-22 01:45:08 -0600

micpalmia gravatar image

I'm trying to follow the tutorial on reasoning about actions on the KnowRob website.

As suggested in the tutorial, I execute

$ roscd knowrob_basics_tutorial
$ rosrun rosprolog rosprolog knowrob_basics_tutorial
?- owl_parse('owl/pancake-making.owl', false, false, true).

and get a very hopeful


I then proceed with

?- class_properties(pancake:'MakingPancakes', knowrob:subAction, Sub).

that unfortunately answers with

ERROR: namespace `pancake' does not exist
^  Exception: (11) setup_call_catcher_cleanup('$expand':'$set_source_module'(user, user), '$expand':expand_goal(class_properties(pancake:'MakingPancakes', knowrob:subAction, _G239), _G303, user, [user, system]), _G373, '$expand':'$set_source_module'(_G328, user)) ?

The namespace is correctly included in the OWl file

    xmlns         ="&pancake;"
    xmlns:pancake ="&pancake;"
    xml:base      ="&pancake;"
    xmlns:knowrob ="&knowrob;"
    [...] >

so it's really hard for me to understand what's going on. How do I ensure the pancake namespace is correctly included? Is there a way for me to print out all the namespaces?

edit retag flag offensive close merge delete


Turns out that if I use the whole class name, without abbreviating with the shortened namespace, everything works. Not sure how I should specify the namespace in prolog anyway.

micpalmia gravatar image micpalmia  ( 2013-10-22 02:34:14 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-10-22 04:07:14 -0600

moritz gravatar image

Please update knowrob_tutorials or comment the include of 'tabletop_obj' in prolog/ (and rosmake the package again).

Namespaces that are used in Prolog queries need to be defined in Prolog in addition to the OWL namespace definition. This is correctly done in prolog/ using the following statement: :- rdf_db:rdf_register_ns(pancake, '', [keep(true)]).

If this does not work, I'd expect that you got error messages when loading Prolog saying that tabletop_obj could not be found, with the result that the is not loaded completely.

edit flag offensive delete link more


I guess the edit has to be made in the `` file, not the `` file. If I edit the latter (or clone the package from github as it is now) the problem is not solved.

micpalmia gravatar image micpalmia  ( 2013-10-22 04:56:48 -0600 )edit

The is generated from the file by rosmake, therefore you have to edit that file. Otherwise your changes would be overridden by the next rosmake. Are there any error messages or warnings during startup?

moritz gravatar image moritz  ( 2013-10-22 04:59:02 -0600 )edit

sry, didn't take the time to fully understand this. got it, works fine.

micpalmia gravatar image micpalmia  ( 2013-10-22 05:03:35 -0600 )edit

Question Tools

1 follower


Asked: 2013-10-22 01:45:08 -0600

Seen: 217 times

Last updated: Oct 22 '13