Ask Your Question
0

Problems with namespaces in KnowRob

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

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

true.

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

<rdf:RDF
    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

Comments

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 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

moritz gravatar image

Please update knowrob_tutorials or comment the include of 'tabletop_obj' in prolog/init.pl.in (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/init.pl using the following statement: :- rdf_db:rdf_register_ns(pancake, 'http://ias.cs.tum.edu/kb/pancake-making.owl#', [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 init.pl is not loaded completely.

edit flag offensive delete link more

Comments

I guess the edit has to be made in the `init.pl` file, not the `init.pl.in` 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 -0500 )edit

The init.pl is generated from the init.pl.in 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 -0500 )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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 157 times

Last updated: Oct 22 '13