Static Public Member Functions
edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils Class Reference

List of all members.

Static Public Member Functions

static void assertActionEndTime (String actionInst)
static void assertDataPropertyForInst (String inst, String prop, String val, String type)
static void assertObjectPropertyForInst (String inst, String prop, String val)
static void assertPropertiesForInstance (String inst, HashMap< String, Vector< String >> propVal)
static void assertSubClassOf (String subClass, String superClass)
static void clearActionStateTransitions (String action)
static void clearActionVisHighlight ()
static String createActionInst (String currentActClass)
static String createObjInstWithPose (String objClass, String perceptionMethod, Vector< Float > pose)
static String createOWLInst (String owlClass)
static String createRestriction (String owlClass, String prop, String value, String restrType, String sourceRef)
static String createStateTransition (String fromState, String toState, String causedBy)
static void deleteObjectInstance (String iri)
static void deleteObjectInstanceWithChildren (String iri)
static boolean evaluateCondition (String condition, String objActOn)
static String getSemanticMapInstance (String roomNumber, String floorNumber, String streetNumber, String streetName)
static void linkActionInTaskContext (String actionInst, String recipeInst)
static void loadActionIntoVis (String recipe_class)
static boolean owlClassExists (String owlClass)
static void parseOwlFile (String filename)
static Vector< String > readAllInstancesOfClass (String owlClass)
static HashMap< String, Vector
< String > > 
readInformationForClass (String owlClass)
static HashMap< String, Vector
< String > > 
readInformationForInstance (String owlInst)
static String readLatestDetectionOfObjectClass (String objClass)
static String readLatestDetectionOfObjectInst (String objInst)
static int readNumObjectInstances (String objClass)
static Vector< Float > readObjectClassPose (String objClass)
static Vector< Float > readObjectPose (String objInst)
static String readOutputOfPrevAction (String currentActInst, String prevActionClass, String prop)
static Vector< Float > readPointXYAZPose (String pointInst)
static Vector< Float > readPointXYPose (String pointInst)
static Vector< String > readPrevActionInTask (String currentActInst)
static String readRecipeClass (String command)
static Vector< String > readTypesOfInstance (String owlInst)
static void setActionVisHighlight (String action_class)
static void setObjPose (String objInst, String perceptionMethod, Vector< Float > pose)
static void startActionVis (String recipe_class)
static void writeActionToOWLFile (String actionClass, String file)

Detailed Description

Prolog query wrapper classes for reading and writing information from/to the belief state in the UNR execution engine.

These classes are to serve as convenience methods to facilitate the access to information in the belief state without having to deal with Prolog statements.

Author:
Moritz Tenorth, tenorth@atr.jp
tenorth

Definition at line 27 of file PrologQueryUtils.java.


Member Function Documentation

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.assertActionEndTime ( String  actionInst) [inline, static]

Sets the endTime of an action to the current time point

Parameters:
actionInstAction instance whose end time is to be set

Definition at line 454 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.assertDataPropertyForInst ( String  inst,
String  prop,
String  val,
String  type 
) [inline, static]

Assert a single property for an instance

Parameters:
instOWL identifier of an instance such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup123'
propOWL identifier of a property such as 'http://ias.cs.tum.edu/kb/knowrob.owl#on-Physical'
valString value to be asserted
typeType of val (usually an XSD type such as 'http://www.w3.org/2001/XMLSchema#string'

Definition at line 538 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.assertObjectPropertyForInst ( String  inst,
String  prop,
String  val 
) [inline, static]

Assert a single property for an instance

Parameters:
instOWL identifier of an instance such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup123'
propOWL identifier of a property such as 'http://ias.cs.tum.edu/kb/knowrob.owl#on-Physical'
valOWL identifier of an instance such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup123'

Definition at line 519 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.assertPropertiesForInstance ( String  inst,
HashMap< String, Vector< String >>  propVal 
) [inline, static]

Assert a set of properties for an instance (given as HashMap propName--Vector<values>)

Parameters:
instOWLidentifier of an instance such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup123'
propValHashMap<String, Vector<String> of the form propName --> Vector(propValues)

Definition at line 498 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.assertSubClassOf ( String  subClass,
String  superClass 
) [inline, static]

Add a subClassOf axiom for a class

Parameters:
subClassOWL identifier of the subclass such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup'
superClassOWL identifier of the superclass such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Container'

Definition at line 584 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.clearActionStateTransitions ( String  action) [inline, static]

Clear state transitions asserted for an action (i.e. the transitions between sub-actions)

Parameters:
owlClassThe action whose sub-action transitions are to be cleared

Definition at line 654 of file PrologQueryUtils.java.

Definition at line 38 of file PrologQueryUtils.java.

static String edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.createActionInst ( String  currentActClass) [inline, static]

Create an instance of the current action, assert startTime

Parameters:
currentActClassOWL identifier of the current action class such as 'http://ias.cs.tum.edu/kb/knowrob.owl#PickingUpAnObject'

Definition at line 432 of file PrologQueryUtils.java.

static String edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.createObjInstWithPose ( String  objClass,
String  perceptionMethod,
Vector< Float >  pose 
) [inline, static]

Create an instance of an object/person incl. pose (and detection of the pose)

Parameters:
objClass
perceptionMethod
Returns:

Definition at line 684 of file PrologQueryUtils.java.

static String edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.createOWLInst ( String  owlClass) [inline, static]

Create an instance of an OWL Class

Parameters:
owlClassThe class to be instantiated
Returns:

Definition at line 599 of file PrologQueryUtils.java.

static String edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.createRestriction ( String  owlClass,
String  prop,
String  value,
String  restrType,
String  sourceRef 
) [inline, static]

Creates an OWL class restriction in Prolog

Parameters:
owlClassObject class to which the restriction is to be added
propProperty to be restricted
valueValue definition to be set
restrTypeType of restriction (owl:someValuesFrom, owl:allValuesFrom or owl:hasValue)
sourceRefString to identify the source module of the created triples
Returns:
Identifier of the generated restriction

Definition at line 560 of file PrologQueryUtils.java.

static String edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.createStateTransition ( String  fromState,
String  toState,
String  causedBy 
) [inline, static]

Create an instance of a state transition

Parameters:
owlClassThe class to be instantiated
Returns:

Definition at line 620 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.deleteObjectInstance ( String  iri) [inline, static]

Definition at line 829 of file PrologQueryUtils.java.

Definition at line 834 of file PrologQueryUtils.java.

static boolean edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.evaluateCondition ( String  condition,
String  objActOn 
) [inline, static]

Check if 'objActOn' fulfills the condition 'condition' (if objActOn is an individual) or if any of its individuals fulfills the condition (it objActOn is a class)

Parameters:
conditionOWL Class specification (usually based on restrictions)
objActOnOWL Class or individual
Returns:
true if objActOn is an individual of condition

Definition at line 757 of file PrologQueryUtils.java.

static String edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.getSemanticMapInstance ( String  roomNumber,
String  floorNumber,
String  streetNumber,
String  streetName 
) [inline, static]

Convenience method to read the (first) instance of a SemanticEnvironmentMap

Parameters:
streetName
streetNumber
floorNumber
roomNumber
Returns:
IRI of the first instance of a SemanticEnvironmentMap found in the knowledge base

Definition at line 787 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.linkActionInTaskContext ( String  actionInst,
String  recipeInst 
) [inline, static]

Links action to the higher-level task instance and to the previous action in the task

Parameters:
actionInstAction instance to be integrated
recipeinstHigher-level task that actionInst is part of

Definition at line 469 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.loadActionIntoVis ( String  recipe_class) [inline, static]

Definition at line 49 of file PrologQueryUtils.java.

static boolean edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.owlClassExists ( String  owlClass) [inline, static]

Checks if an OWL class exists in KnowRob (by checking if it is derived from another class using a subClassOf definition)

Parameters:
owlClassIdentifier of an OWL class such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup'
Returns:
true if class exists

Definition at line 411 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.parseOwlFile ( String  filename) [inline, static]

Definition at line 54 of file PrologQueryUtils.java.

static Vector<String> edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readAllInstancesOfClass ( String  owlClass) [inline, static]

Select all instances of a class

Parameters:
owlClassIdentifier of an OWL class such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup'
Returns:
Vector of OWL identifiers of all object instances

Definition at line 88 of file PrologQueryUtils.java.

static HashMap<String, Vector<String> > edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readInformationForClass ( String  owlClass) [inline, static]

Read all information for a class (class_properties)

Parameters:
owlClassIdentifier of an OWL class such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup'
Returns:
HashMap of the form <String, Vector<String>> containing the OWL properties (key "P") and their values (key "O")

Definition at line 166 of file PrologQueryUtils.java.

static HashMap<String, Vector<String> > edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readInformationForInstance ( String  owlInst) [inline, static]

Read all information for an instance (owl_has)

Parameters:
owlInstIdentifier of an OWL instance such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup123'
Returns:
HashMap of the form <String, Vector<String>> containing the OWL properties (key "P") and their values (key "O")

Definition at line 149 of file PrologQueryUtils.java.

static String edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readLatestDetectionOfObjectClass ( String  objClass) [inline, static]

Read the latest detection of an object/person/... class

Parameters:
objClassIdentifier of an OWL class such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup'
Returns:
OWL identifier of the latest detection of any instance of objClass

Definition at line 129 of file PrologQueryUtils.java.

static String edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readLatestDetectionOfObjectInst ( String  objInst) [inline, static]

Read the latest detection of an object/person/... instance

Parameters:
objInstOWL identifier of an object instance such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup123'
Returns:
OWL identifier of the latest detection of objInst

Definition at line 109 of file PrologQueryUtils.java.

static int edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readNumObjectInstances ( String  objClass) [inline, static]

Read the number of instances that exist for one class, e.g. to check if there are at least N instances

Parameters:
objClassIdentifier of an OWL class such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup'
Returns:
Number of instances of objClass that exist in the knowledge base

Definition at line 66 of file PrologQueryUtils.java.

static Vector<Float> edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readObjectClassPose ( String  objClass) [inline, static]

Read the 6D pose matrix of the first instance of the class objClass that can be found.

'Object' is thereby defined in a very wide sense (knowrob:'EnduringThing-Localized') and also includes people and robots.

TODO: switch from the hacky vector format to RLS or something cleaner and better-defined

Parameters:
objClassOWL identifier of an object class such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup'
Returns:
16-element vector with the row-based pose matrix [m00,m01,m02,m03,m10,...]

Definition at line 371 of file PrologQueryUtils.java.

static Vector<Float> edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readObjectPose ( String  objInst) [inline, static]

Read the 6D pose matrix of a given object instance

'Object' is thereby defined in a very wide sense (knowrob:'EnduringThing-Localized') and also includes people and robots.

TODO: switch from the hacky vector format to RLS or something cleaner and better-defined

Parameters:
objInstOWL identifier of an object instance such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Cup123'
Returns:
16-element vector with the row-based pose matrix [m00,m01,m02,m03,m10,...]

Definition at line 336 of file PrologQueryUtils.java.

static String edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readOutputOfPrevAction ( String  currentActInst,
String  prevActionClass,
String  prop 
) [inline, static]

Read output 'prop' of an earlier action 'actionClass' performed in the task

Parameters:
currentActInstOWL identifier of an action instance such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Pick123'
prevActionClassType of the previous action whose output is to be read
propProperty of that action whose value is to be read
Returns:
Value of prop for an instance of actionClass

Definition at line 238 of file PrologQueryUtils.java.

static Vector<Float> edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readPointXYAZPose ( String  pointInst) [inline, static]

Read the XY-position plus AZ-orientation of a given point instance

TODO: switch from the hacky vector format to RLS or something cleaner and better-defined

Parameters:
pointInstOWL identifier of a point such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Point123'
Returns:
three-element vector [x,y,az]

Definition at line 301 of file PrologQueryUtils.java.

static Vector<Float> edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readPointXYPose ( String  pointInst) [inline, static]

Read the XY-position of a given point instance

TODO: switch from the hacky vector format to RLS or something cleaner and better-defined

Parameters:
pointInstOWL identifier of a point such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Point123'
Returns:
two-element vector [x,y]

Definition at line 271 of file PrologQueryUtils.java.

static Vector<String> edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readPrevActionInTask ( String  currentActInst) [inline, static]

Read prior actions performed in the task

Parameters:
currentActInstOWL identifier of an action instance such as 'http://ias.cs.tum.edu/kb/knowrob.owl#Pick123'
Returns:
Vector of OWL identifiers of the previous actions in the current task

Definition at line 216 of file PrologQueryUtils.java.

static String edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readRecipeClass ( String  command) [inline, static]

Read the main action class for the command to be performed (using the forCommand specification)

Parameters:
commandThe command the recipe is to execute, e.g. 'serve a drink'
Returns:
The OWL class describing the recipe, e.g. roboearth:'ServeADrink'
Exceptions:
IOException

Definition at line 197 of file PrologQueryUtils.java.

static Vector<String> edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.readTypesOfInstance ( String  owlInst) [inline, static]

Definition at line 176 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.setActionVisHighlight ( String  action_class) [inline, static]

Definition at line 31 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.setObjPose ( String  objInst,
String  perceptionMethod,
Vector< Float >  pose 
) [inline, static]

Set the pose of an instance by adding a detection to it

Parameters:
objInst
perceptionMethod
pose

Definition at line 721 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.startActionVis ( String  recipe_class) [inline, static]

Definition at line 44 of file PrologQueryUtils.java.

static void edu.tum.cs.ias.knowrob.prolog.PrologQueryUtils.writeActionToOWLFile ( String  actionClass,
String  file 
) [inline, static]

Definition at line 824 of file PrologQueryUtils.java.


The documentation for this class was generated from the following file:


knowrob_common
Author(s): Moritz Tenorth
autogenerated on Sat Dec 28 2013 17:09:28