public class AlteriteModule extends java.lang.Object implements IModule, IServiceProvider, IEventConsumer
Constructor and Description |
---|
AlteriteModule(IOntologyBackend oro) |
AlteriteModule(IOntologyBackend oro,
java.util.Properties serverParameters) |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String id) |
void |
addForAgent(java.lang.String id,
java.util.Set<java.lang.String> rawStmts)
Add statements in a specific agent cognitive model.
|
void |
addForAgent(java.lang.String id,
java.util.Set<java.lang.String> rawStmts,
java.lang.String memProfile)
Add statements in a specific agent cognitive model with a specific
memory model.
|
boolean |
checkAlreadyPresent(java.lang.String id) |
boolean |
checkConsistencyForAgent(java.lang.String id) |
void |
clearEvent(java.lang.String agent,
java.lang.String eventId) |
void |
clearEventsForAgent(java.lang.String agent) |
void |
clearForAgent(java.lang.String id,
java.util.Set<java.lang.String> rawStmts) |
void |
close() |
void |
consumeEvent(java.util.UUID watcherId,
OroEvent e) |
java.util.List<java.util.Set<java.lang.String>> |
discriminateForAgent(java.lang.String id,
java.util.Set<java.lang.String> rawConcepts) |
protected void |
finalize() |
java.util.Set<java.lang.String> |
findForAgent(java.lang.String id,
java.lang.String varName,
java.util.Set<java.lang.String> statements) |
java.util.Set<java.lang.String> |
findForAgent(java.lang.String id,
java.lang.String varName,
java.util.Set<java.lang.String> statements,
java.util.Set<java.lang.String> filters) |
java.util.Map<java.lang.String,AgentModel> |
getAgents() |
java.util.Set<java.lang.String> |
getInfosForAgent(java.lang.String id,
java.lang.String lex_resource)
Returns the set of asserted and inferred statements whose the given node
is part of, in the specifi agent model.
|
IServiceProvider |
getServiceProvider()
A null return is expected if the module doesn't provide any RPC service
to register.
|
java.util.Set<java.lang.String> |
listAgents() |
java.util.Set<java.util.List<java.lang.String>> |
lookupForAgent(java.lang.String agent_id,
java.lang.String id) |
java.util.UUID |
registerEventForAgent(java.lang.String agent,
java.lang.String type,
java.lang.String triggeringType,
java.util.List<java.lang.String> pattern,
IEventConsumer consumer)
Events
|
java.util.UUID |
registerEventForAgent(java.lang.String agent,
java.lang.String type,
java.lang.String triggeringType,
java.lang.String variable,
java.util.List<java.lang.String> pattern,
IEventConsumer consumer) |
void |
removeForAgent(java.lang.String id,
java.util.Set<java.lang.String> rawStmts)
Deprecated.
|
void |
revise(java.util.Set<java.lang.String> statements,
java.lang.String json_policy)
Generic knowledge revision request
|
boolean |
safeAddForAgent(java.lang.String id,
java.util.Set<java.lang.String> rawStmts) |
boolean |
safeAddForAgent(java.lang.String id,
java.util.Set<java.lang.String> rawStmts,
java.lang.String memProfile)
Adds statements in a specific agent cognitive model with a specific
memory model, but only if the statement doesn't cause any inconsistency.
|
void |
save(java.lang.String id,
java.lang.String path) |
void |
step()
'Step' the module.
|
void |
updateForAgent(java.lang.String id,
java.util.Set<java.lang.String> rawStmts) |
public AlteriteModule(IOntologyBackend oro) throws EventRegistrationException, InvalidModelException
public AlteriteModule(IOntologyBackend oro, java.util.Properties serverParameters) throws InvalidModelException
InvalidModelException
public IServiceProvider getServiceProvider()
IModule
getServiceProvider
in interface IModule
public void add(java.lang.String id) throws InvalidModelException
InvalidModelException
public boolean checkAlreadyPresent(java.lang.String id)
public java.util.Map<java.lang.String,AgentModel> getAgents()
@RPCMethod(category="agents", desc="Returns the set of agents I\'m aware of (ie, for whom I have a cognitive model).") public java.util.Set<java.lang.String> listAgents()
public void consumeEvent(java.util.UUID watcherId, OroEvent e)
consumeEvent
in interface IEventConsumer
@RPCMethod(category="agents", desc="Check the consistency of a specific agent model.") public boolean checkConsistencyForAgent(java.lang.String id) throws AgentNotFoundException
AgentNotFoundException
@RPCMethod public void revise(java.util.Set<java.lang.String> statements, java.lang.String json_policy) throws IllegalStatementException, InvalidPolicyException, OntologyServerException, InconsistentOntologyException
@RPCMethod(category="agents", desc="adds one or several statements (triplets S-P-O) to a specific agent model, in long term memory.") public void addForAgent(java.lang.String id, java.util.Set<java.lang.String> rawStmts) throws IllegalStatementException, AgentNotFoundException
id
- The id of the agentrawStmts
- a set of statementsIllegalStatementException
AgentNotFoundException
BaseModule.add(Set)
@RPCMethod(category="agents", desc="try to add news statements to a specific agent model in long term memory, if they don\'t lead to inconsistencies (return false if at least one stmt wasn\'t added).") public boolean safeAddForAgent(java.lang.String id, java.util.Set<java.lang.String> rawStmts) throws IllegalStatementException, AgentNotFoundException
@RPCMethod(category="agents", desc="adds one or several statements (triplets S-P-O) to a specific agent model associated with a memory profile.") public void addForAgent(java.lang.String id, java.util.Set<java.lang.String> rawStmts, java.lang.String memProfile) throws IllegalStatementException, AgentNotFoundException
id
- The id of the agentrawStmts
- a set of statementsmemProfile
- the memory profileIllegalStatementException
AgentNotFoundException
BaseModule.add(Set, String)
,
Available memory profile
@RPCMethod(category="agents", desc="try to add news statements to a specific agent model with a specific memory profile, if they don\'t lead to inconsistencies (return false if at least one stmt wasn\'t added).") public boolean safeAddForAgent(java.lang.String id, java.util.Set<java.lang.String> rawStmts, java.lang.String memProfile) throws IllegalStatementException, AgentNotFoundException
id
- The id of the agentrawStmts
- a set of statementsmemProfile
- the memory profileIllegalStatementException
AgentNotFoundException
@RPCMethod(category="agents", desc="removes one or several statements. Deprecated. Use clearForAgent instead.") @Deprecated public void removeForAgent(java.lang.String id, java.util.Set<java.lang.String> rawStmts) throws IllegalStatementException, OntologyServerException
@RPCMethod(category="agents", desc="removes statements from a specific agent model.") public void clearForAgent(java.lang.String id, java.util.Set<java.lang.String> rawStmts) throws IllegalStatementException, OntologyServerException
@RPCMethod(category="agents", desc="updates one or several statements (triplets S-P-O) in a specific agent model, in long term memory.") public void updateForAgent(java.lang.String id, java.util.Set<java.lang.String> rawStmts) throws IllegalStatementException, InconsistentOntologyException, OntologyServerException
@RPCMethod(category="agent", desc="returns the set of asserted and inferred statements whose the given node is part of. It represents the usages of a resource.") public java.util.Set<java.lang.String> getInfosForAgent(java.lang.String id, java.lang.String lex_resource) throws com.hp.hpl.jena.shared.NotFoundException, AgentNotFoundException
IOntologyServer myOntology = new OpenRobotsOntology(); Model results = myOntology.getInfos("ns:individual1"); NodeIterator types = results.listObjectsOfProperty(myOntology.createProperty("rdf:type")); for ( ; types.hasNext() ; ) { System.out.println(types.nextNode().toString()); }This example would print all the types (classes) of the instance
ns:individual1
.id
- the agent model to query.lex_resource
- the lexical form of an existing resource.com.hp.hpl.jena.shared.NotFoundException
- thrown if the lex_resource doesn't exist in the ontology.AgentNotFoundException
General syntax of RPCs for the oro-server socket connector.
@RPCMethod(category="agents", desc="tries to identify a resource given a set of partially defined statements and restrictions in an specific agent model.") public java.util.Set<java.lang.String> findForAgent(java.lang.String id, java.lang.String varName, java.util.Set<java.lang.String> statements, java.util.Set<java.lang.String> filters) throws IllegalStatementException, OntologyServerException
@RPCMethod(category="agents", desc="tries to identify a resource given a set of partially defined statements in an specific agent model.") public java.util.Set<java.lang.String> findForAgent(java.lang.String id, java.lang.String varName, java.util.Set<java.lang.String> statements) throws IllegalStatementException, OntologyServerException
@RPCMethod(category="agents", desc="lookup a concept in a specific agent model.") public java.util.Set<java.util.List<java.lang.String>> lookupForAgent(java.lang.String agent_id, java.lang.String id) throws IllegalStatementException, AgentNotFoundException
@RPCMethod(category="agents", desc="exports the cognitive model of a given agent to an OWL file. The provided path must be writable by the server.") public void save(java.lang.String id, java.lang.String path) throws AgentNotFoundException, OntologyServerException
@RPCMethod(category="agents", desc="returns a list of properties that helps to differentiate individuals for a specific agent.") public java.util.List<java.util.Set<java.lang.String>> discriminateForAgent(java.lang.String id, java.util.Set<java.lang.String> rawConcepts) throws AgentNotFoundException, OntologyServerException, com.hp.hpl.jena.shared.NotFoundException, NotComparableException
AgentNotFoundException
OntologyServerException
com.hp.hpl.jena.shared.NotFoundException
NotComparableException
@RPCMethod(category="events", desc="registers an event on a specific agent model. Expected parameters are: agent, type, triggering type, event pattern.") public java.util.UUID registerEventForAgent(java.lang.String agent, java.lang.String type, java.lang.String triggeringType, java.util.List<java.lang.String> pattern, IEventConsumer consumer) throws AgentNotFoundException, InvalidEventDescriptorException, EventRegistrationException
@RPCMethod(category="events", desc="registers an event on a specific agent model. Expected parameters are: agent, type, triggering type, variable, event pattern.") public java.util.UUID registerEventForAgent(java.lang.String agent, java.lang.String type, java.lang.String triggeringType, java.lang.String variable, java.util.List<java.lang.String> pattern, IEventConsumer consumer) throws AgentNotFoundException, InvalidEventDescriptorException, EventRegistrationException
@RPCMethod(category="events", desc="Remove all events associated to a specific model.") public void clearEventsForAgent(java.lang.String agent) throws AgentNotFoundException
AgentNotFoundException
@RPCMethod(category="events", desc="Remove one specific event from a specific model.") public void clearEvent(java.lang.String agent, java.lang.String eventId) throws OntologyServerException
OntologyServerException
public void close()
protected void finalize()
finalize
in class java.lang.Object
ORO is a part of the OpenRobots framework.
openrobots@laas.fr
LAAS-CNRS 2009-2011