Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:knowrob2_migration [2020/07/22 10:44] – [Migration of commonly used queries] sasjongedoc:knowrob2_migration [2020/07/22 13:32] (current) – [Migration of commonly used queries] sasjonge
Line 1: Line 1:
 ====== Migrating to KnowRob 2.0 ====== ====== Migrating to KnowRob 2.0 ======
 +
 +**This page is a work in progress**
  
 The current master branch contains a redesign of KnowRob. The redesign changes the way how Knowrob has to be included into your project. Additionally some queries were replaced. The current master branch contains a redesign of KnowRob. The redesign changes the way how Knowrob has to be included into your project. Additionally some queries were replaced.
Line 7: Line 9:
 ===== Migration of commonly used queries ===== ===== Migration of commonly used queries =====
  
-^ Old query(s)      ^ New Query       ^ Comment          ^ +==== Registering of old KnowRob packages ===== 
-<code prolog>?- register_ros_package(knowrob_common). + 
-?- register_ros_package(knowrob_vis). +Many of the packages of the old knowrob/knowrob repository, e.g. knowrob_common or knowrob_vis have been merged into one knowrob package. Therefore calls of the form  
-</code>    <code prolog>+ 
 +<code prolog>?- register_ros_package(knowrob_common). 
 +?- register_ros_package(knowrob_vis).</code> 
 + 
 +can be replaced by 
 + 
 +<code prolog>
 ?- register_ros_package(knowrob). ?- register_ros_package(knowrob).
-</code>    | Many of the sub packages of the knowrob/knowrob repository have been merged into the knowrob package |+</code>    
 + 
 +==== Loading .owl files ===== 
 + 
 +OWL files where loadid 
 | <code prolog>?- owl_parser:owl_parse('package://knowrob_yourpackage/owl/yourontology.owl'). | <code prolog>?- owl_parser:owl_parse('package://knowrob_yourpackage/owl/yourontology.owl').
-?- rdf_db:rdf_register_prefix(yourontology, 'http://knowrob_yourpackage/owl/yourontology.owl#', [keep(true)]).+?- rdf_db:rdf_register_prefix( 
 +yourontology, 'http://knowrob_yourpackage/owl/yourontology.owl#', [keep(true)]).
 </code>    | <code prolog> </code>    | <code prolog>
-?- tripledb_load('package://knowrob_yourpackage/owl/yourontology.owl',+?- tripledb_load( 
 +    'package://knowrob_yourpackage/owl/yourontology.owl',
     [      [ 
-       namespace(yourontology,'http://knowrob_yourpackage/owl/yourontology.owl#')+       namespace( 
 +           yourontology, 
 +           'http://knowrob_yourpackage/owl/yourontology.owl#' 
 +       )
     ]).     ]).
 </code>    | If you want to load the owl file and set a namespace | </code>    | If you want to load the owl file and set a namespace |