%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The personal agent "Agent 1.1" receives abitrary requests, % tries to derive answers from its internal knowledge base % using the request as query and sends back the derived % answers to the requesting agent (here the Organization Agent) % % Inbound and outbound request and answer messages are % serialized in RuleML and interchanged using the Enterprise % Service Bus % % Note the pragmatic directives are limited in this use case % Others could be e.g. FIPA ACL primitives %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % communication rule rcvMsg(XID,esb ,From, Performative, [X|Args]) :- understandPerformative(XID, From, Performative, [X|Args]), answerQuery(XID, From, Performative, [X|Args]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % rules for processing the query %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % taxonomy of performatives - could be also defined e.g. in external RDF data source performative(request):-performative(query). performative(query). understandPerformative(XID, From, Performative, PayLoad) :- performative(Performative). understandPerformative(XID, From, Performative, PayLoad) :- not(performative(Performative)), sendMsg(XID,esb,From,answer, notUnderstood(Performative)). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % rules for answering the query %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% answerQuery(XID, From, Performative, [X|Args]):- derive([X|Args]), sendMsg(XID,esb,From, answer, [X|Args]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % personal rule base %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bibTexURL("http://ibis.in.tum.de/projects/paw/use_case1/bibtex.rdf"). vCardURL("http://ibis.in.tum.de/projects/paw/use_case1/vCard_Adrian.rdf"). % create person information from RDF vCard person(Name,Role, Title, EMail, Telephone):- vCardURL(URL), rdf(URL,"",_,"vCard_FN", Name), rdf(URL,"",_,"vCard_ROLE", Role), rdf(URL,"",_,"vCard_TITLE", Title), rdf(URL,"",_,"vCard_TEL", TelNode), rdf(URL,"",TelNode,"rdf_value",Telephone), rdf(URL,"",_,"vCard_EMAIL",EMailNode), rdf(URL,"",EMailNode,"rdf_value",EMail). % create reference information from RDF bibtex file reference(Title,FirstAuthor):- bibTexURL(URL), rdf(URL,"",_,dc_title, Title), rdf(URL,"",AuthorList, rdf_type, rdf_Seq), rdf(URL,"",AuthorList, rdf__1 , FirstAuthor).