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
Last revisionBoth sides next revision
doc:knowrob_basics [2021/02/18 09:22] – [Loading and querying environment information] daniel86doc:knowrob_basics [2021/02/18 09:25] – [Loading and querying environment information] daniel86
Line 36: Line 36:
 </code> </code>
  
-You can query for properties of instances using the holds(S,P,O) predicates, which retrieve all triples with matching Subject, Predicate, or Object from the knowledge base. The following query, for example, asks for all objects of type knowrob:'IAIDrawer'.+You can query for properties of instances using the holds(S,P,O) predicate, which retrieve all triples with matching Subject, Predicate, or Object from the knowledge base. The following query, for example, asks for all objects of type knowrob:'IAIDrawer'.
 <code prolog> <code prolog>
  ?- holds(A, rdf:type, knowrob:'IAIDrawer').  ?- holds(A, rdf:type, knowrob:'IAIDrawer').
- A = 'http://knowrob.org/kb/IAI-kitchen.owl#iai_kitchen_fridge_area_lower_drawer_main'+ A = iai_kitchen:'iai_kitchen_fridge_area_lower_drawer_main'
- A = 'http://knowrob.org/kb/IAI-kitchen.owl#iai_kitchen_kitchen_island_left_lower_drawer_main'+ A = iai_kitchen:'iai_kitchen_kitchen_island_left_lower_drawer_main'
- A = 'http://knowrob.org/kb/IAI-kitchen.owl#iai_kitchen_kitchen_island_left_upper_drawer_main' ;+ A = iai_kitchen:'iai_kitchen_kitchen_island_left_upper_drawer_main' ;
  [...]  [...]
 </code> </code>
Line 47: Line 47:
 For getting an overview of the information that is available about one object instance, we can query for all triples where the respective instance fills the Subject slot. In this example we pass two unbound variables //P// and //O// as arguments and receive all possible combinations of values as result. For getting an overview of the information that is available about one object instance, we can query for all triples where the respective instance fills the Subject slot. In this example we pass two unbound variables //P// and //O// as arguments and receive all possible combinations of values as result.
 <code prolog> <code prolog>
- ?- owl_has(knowrob:'Drawer1', P, O). + ?- owl_has(iai_kitchen:'iai_kitchen_kitchen_island_left_lower_drawer_main', P, O). 
- P = knowrob:prismaticallyConnectedTo+ P = urdf:hasBaseLinkName
- O = knowrob:'Door4' + O = kitchen_island_left_lower_drawer_main 
- P = knowrob:depthOfObject+ P = urdf:hasEndLinkName
- O = literal(type(xsd:double,'0.574538')) + O = kitchen_island_left_lower_drawer_handle 
- P = knowrob:heightOfObject, + [...]
- O = literal(type(xsd:double,'0.338121')) ; +
- P = knowrob:widthOfObject, +
- O = literal(type(xsd:double,'0.58045006')) ; +
- P = knowrob:properPhysicalParts, +
- O = knowrob:'Door4'+
- P = knowrob:properPhysicalParts, +
- O = knowrob:'Handle127'+
- P = knowrob:properPhysicalParts, +
- O = knowrob:'Slider4'+
- P = knowrob:describedInMap, +
- O = 'http://ias.cs.tum.edu/kb/ias_semantic_map.owl#SemanticEnvironmentMap0'+
- P = 'http://ias.cs.tum.edu/kb/srdl2-comp.owl#urdfName', +
- O = literal(drawer_fridge_bottom_fixed_link) ; +
- P = rdf:type, +
- O = owl:'NamedIndividual'+
- P = rdf:type, +
- O = knowrob:'Drawer'+
 </code> </code>
- 
  
 ===== Visualizing objects ===== ===== Visualizing objects =====