agent.core.communication
Class Message

java.lang.Object
  extended by agent.core.communication.Message

public class Message
extends java.lang.Object

Contain of relevant methods for communication using OWL or RDF models

Version:
1.2
Author:
Michal Laclavik

Field Summary
private static Logger log
           
 
Constructor Summary
Message()
           
 
Method Summary
static void addProperties(Model m, Resource r)
          Recursive method which move resource with all properties recursively into new model
static ACLMessage createInformMessage(Agent sender, java.lang.String recieverName, Resource r)
          This method creates ACL Inform message containing of RDF of some Jena RDF Resource
static ACLMessage createQueryMessage(Agent sender, java.lang.String recieverName, java.lang.String query)
          This method creates ACL Query message
static java.lang.String getXML(Resource r, java.lang.String space, java.lang.String strRes)
          Recursive method which writes resource with all properties recursively into string and returns it
static java.lang.String model2RDF(Model model)
          This method returns XML/RDF text representation of RDF Model
static void register(Agent a, java.lang.String agentType)
          This method register agent with directory facilitator
static Model resource2Model(Resource r, Model model)
           
static java.lang.String resource2RDF(Resource resource)
          This method returns XML/RDF text representation of RDF Resource
static java.lang.String resource2RDF(Resource r, Model model)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static Logger log
Constructor Detail

Message

public Message()
Method Detail

resource2RDF

public static java.lang.String resource2RDF(Resource resource)
This method returns XML/RDF text representation of RDF Resource

Parameters:
resource - Jena Resource

model2RDF

public static java.lang.String model2RDF(Model model)
This method returns XML/RDF text representation of RDF Model

Parameters:
model - Jena Model

resource2RDF

public static java.lang.String resource2RDF(Resource r,
                                            Model model)

resource2Model

public static Model resource2Model(Resource r,
                                   Model model)

getXML

public static java.lang.String getXML(Resource r,
                                      java.lang.String space,
                                      java.lang.String strRes)
Recursive method which writes resource with all properties recursively into string and returns it

Parameters:
space - is just to track levels of XML
r - resource which should be converted to XML text

addProperties

public static void addProperties(Model m,
                                 Resource r)
Recursive method which move resource with all properties recursively into new model

Parameters:
m - represents model where properties should be put in
r - resource which properties shouldbe added

createQueryMessage

public static ACLMessage createQueryMessage(Agent sender,
                                            java.lang.String recieverName,
                                            java.lang.String query)
This method creates ACL Query message

Parameters:
sender - Agent which sends message
recieverName - string name of Agent which recieve the message
query - SPARQL query

createInformMessage

public static ACLMessage createInformMessage(Agent sender,
                                             java.lang.String recieverName,
                                             Resource r)
This method creates ACL Inform message containing of RDF of some Jena RDF Resource

Parameters:
sender - Agent which sends message
recieverName - string name of Agent which recieve the message
r - RDF Jena Resouce

register

public static void register(Agent a,
                            java.lang.String agentType)
This method register agent with directory facilitator

Parameters:
a - Agent which registers
agentType - string description of agent type