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

Failed to parse owl-file with migrated Knowrob package

asked 2015-03-24 10:19:01 -0500

nadia gravatar image

updated 2015-03-24 10:29:16 -0500

Hello KnowRob Developers,

I'm trying to migrate a knowrob/rosbuild package to the catkinized/rosjava version following the very useful instructions here, everything seems to compile correctly, I am able to run a java exectuable which converts yaml files into owl files. The package can be found here. The package basically consists of starting the knowledge base with two owl files knowrob-seds.owl and dummy-task.owl. This used to work perfectly in the rosbuild version of the package, but now that I have migrated I get the following warnings, when starting the knowledge base and loaded the owl files:

$ roslaunch rosjava_knowrob_seds knowrob_seds.launch
% Parsed "knowrob-seds.owl" in 0.00 sec; 64 triples
Warning: /home/nadiafigueroa/catkin_ws_knowrob/src/stacks/rosjava_knowrob_seds/prolog/init.pl:33:
    Goal (directive) failed: user:owl_parser:owl_parse(package://rosjava_knowrob_seds/owl/knowrob-seds.owl)
% Parsed "dummy-task.owl" in 0.02 sec; 1,736 triples
Warning: /home/nadiafigueroa/catkin_ws_knowrob/src/stacks/rosjava_knowrob_seds/prolog/init.pl:37:
    Goal (directive) failed: user:owl_parser:owl_parse(package://rosjava_knowrob_seds/owl/dummy-task.owl)
%  /home/nadiafigueroa/catkin_ws_knowrob/src/stacks/rosjava_knowrob_seds/prolog/init.pl compiled 0.03 sec, 4 clauses
Warning: /home/nadiafigueroa/catkin_ws_knowrob/src/stacks/rosjava_knowrob_seds/prolog/init.pl:33:
    Goal (directive) failed: user:owl_parser:owl_parse(package://rosjava_knowrob_seds/owl/knowrob-seds.owl)
Warning: /home/nadiafigueroa/catkin_ws_knowrob/src/stacks/rosjava_knowrob_seds/prolog/init.pl:37:
    Goal (directive) failed: user:owl_parser:owl_parse(package://rosjava_knowrob_seds/owl/dummy-task.owl)

Which is curious to me, as to why it shows only as a warning, because when I try to query it from a python interface I get the following errors:

$ rosrun rosjava_knowrob_seds test_seds_model.py
Traceback (most recent call last):
  File "/home/nadiafigueroa/catkin_ws_knowrob/src/stacks/rosjava_knowrob_seds/rosjava_knowrob_seds/src/test_seds_model.py", line 23, in <module>
    query = prolog.query("""rdfs_subclass_of(Phase, seds:'SEDSMotion'), phase_properties(Phase, ID, Object, Threshold, Atractor, Models), member(Model, Models), motion_properties(Model, Type, GMMs), member(GMM, GMMs), gmm_properties(GMM, GMMType, InputType, InputDim, OutputType, OutputDim, Gaussians), member(Gaussian, Gaussians), gaussian_components(Gaussian, Mean, Cov, Prior), vector_elements(Mean, MeanVec),matrix_elements(Cov, CovMat)""")
  File "/home/nadiafigueroa/catkin_ws_knowrob/src/stacks/knowrob/json_prolog/src/json_prolog/json_prolog.py", line 69, in query
    return PrologQuery(query_str)
  File "/home/nadiafigueroa/catkin_ws_knowrob/src/stacks/knowrob/json_prolog/src/json_prolog/json_prolog.py", line 22, in __init__
    raise PrologException('Prolog query failed: %s' % result.message)
json_prolog.json_prolog.PrologException: "Prolog query failed: PrologException: error(existence_error(procedure, /(phase_properties, 6)), context(:(system, /('<meta-call>', 1)), _23))"

and these on the knowledgebase side:

jpl.PrologException: PrologException: error(existence_error(procedure, /(phase_properties, 6)), context(:(system, /('<meta-call>', 1)), _23))
    at jpl.Query.get1(Query.java:336)
    at jpl.Query.hasMoreSolutions(Query.java:258)
    at jpl.Query.allSolutions(Query.java:556)
    at org.knowrob.json_prolog.query.AllSolutionsCommand.execute(AllSolutionsCommand.java:6)
    at org.knowrob.json_prolog.query.ThreadedQuery.run(ThreadedQuery.java:104)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
java.lang.Exception: jpl.PrologException: PrologException: error(existence_error ...
(more)
edit retag flag offensive close merge delete

Comments

@nadia: use the preformatted text button (the one with the binary 101010) to format stack traces, code and console output.

gvdhoorn gravatar image gvdhoorn  ( 2015-03-24 10:23:08 -0500 )edit

Thanks! @gvdhoorn

nadia gravatar image nadia  ( 2015-03-24 10:27:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-03-25 09:46:31 -0500

moritz gravatar image

In general, if Prolog complains about broken OWL files, I'd double-check their syntax by opening them using the Protege editor that often gives more helpful error messages (including the lines where syntax errors have been detected).

However, here the problem seems to be the namespace of the owl_parse predicate that has been moved out of the owl_parser package. Please try to replace 'owl_parser:owl_parse' with just 'owl_parse'.

edit flag offensive delete link more

Comments

Is it possible to load multiple files from launch file?

nadia gravatar image nadia  ( 2015-03-25 11:26:10 -0500 )edit

In the launch file, you can set the initial_goal parameter, e.g. here. This can be any Prolog goal, i.e. also compound goals such as "owl_parse(a), owl_parse(b)".

moritz gravatar image moritz  ( 2015-03-25 11:47:12 -0500 )edit

I tried this <param name="initial_goal" type="string" value="owl_parse(a),owl_parse(b)" /> and only the first owl file is parsed.

nadia gravatar image nadia  ( 2015-03-25 12:07:34 -0500 )edit

I'm not sure whether owl_parse returns true or false (which, in Prolog, does not indicate success, only if additional solutions may exist). If it returns 'false', try linking the predicates with a semicolon (OR) instead of the comma (AND).

moritz gravatar image moritz  ( 2015-03-25 12:27:29 -0500 )edit

With (OR) it works! And I had some missing dependencies, so now the query works too! Thanks so much!

nadia gravatar image nadia  ( 2015-03-25 13:31:28 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-03-24 10:19:01 -0500

Seen: 229 times

Last updated: Mar 25 '15