Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
doc:knowrob_basics [2021/02/18 08:49] – [Querying the KnowRob ontology] daniel86 | doc:knowrob_basics [2021/02/18 09:25] – [Loading and querying environment information] daniel86 | ||
---|---|---|---|
Line 18: | Line 18: | ||
<code prolog> | <code prolog> | ||
?- subclass_of(A, | ?- subclass_of(A, | ||
- | A = dul:' | + | A = dul:' |
- | A = dul:' | + | A = dul:' |
- | A = dul:' | + | A = dul:' |
- | A = dul:' | + | A = dul:' |
</ | </ | ||
- | Some notes on the query syntax: Predicates in a query can be linked with a comma, denoting the logical AND, or a semicolon for the logical OR. Each query is finished with a dot (full stop). You can step through the results with the semicolon, or just hit < | + | Some notes on the query syntax: Predicates in a query can be linked with a comma, denoting the logical AND, or a semicolon for the logical OR. Each query is finished with a dot (full stop). You can step through the results with the semicolon |
- | Before continuing with the tutorial, try to get familiar with the taxonomy and its main [[KnowRob_Taxonomy|classes]] and properties, either by exploring | + | Before continuing with the tutorial, try to get familiar with the [[http:// |
+ | The best way to explore | ||
===== Loading and querying environment information ===== | ===== Loading and querying environment information ===== | ||
Line 32: | Line 33: | ||
So far, we only performed reasoning on the class level. For robotic applications, | So far, we only performed reasoning on the class level. For robotic applications, | ||
<code prolog> | <code prolog> | ||
- | ? | + | ? |
</ | </ | ||
- | You can query for properties of instances using the rdf_has(S, | + | You can query for properties of instances using the holds(S, |
<code prolog> | <code prolog> | ||
- | ? | + | ? |
- | A = knowrob:'Drawer1' ; | + | A = iai_kitchen:'iai_kitchen_fridge_area_lower_drawer_main' ; |
- | A = knowrob:'Drawer103' ; | + | A = iai_kitchen:'iai_kitchen_kitchen_island_left_lower_drawer_main' ; |
- | A = knowrob:'Drawer109' ; | + | A = iai_kitchen:'iai_kitchen_kitchen_island_left_upper_drawer_main' ; |
[...] | [...] | ||
</ | </ | ||
Line 46: | 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:' | + | O = kitchen_island_left_lower_drawer_main |
- | P = knowrob:depthOfObject, | + | P = urdf:hasEndLinkName, |
- | O = literal(type(xsd: | + | O = kitchen_island_left_lower_drawer_handle |
- | P = knowrob: | + | [...] |
- | O = literal(type(xsd: | + | |
- | P = knowrob: | + | |
- | O = literal(type(xsd: | + | |
- | P = knowrob: | + | |
- | O = knowrob:' | + | |
- | P = knowrob: | + | |
- | O = knowrob:' | + | |
- | P = knowrob: | + | |
- | O = knowrob:' | + | |
- | P = knowrob: | + | |
- | O = ' | + | |
- | P = ' | + | |
- | O = literal(drawer_fridge_bottom_fixed_link) ; | + | |
- | P = rdf:type, | + | |
- | O = owl:' | + | |
- | P = rdf:type, | + | |
- | O = knowrob:' | + | |
</ | </ | ||
- | |||
===== Visualizing objects ===== | ===== Visualizing objects ===== |