%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The RuleML-2007 Organizational Agent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Import external ContractLog libraries for % mathematical, lists and date / time computations % and access to external data sources, e.g. % Semantic Web ontologies, iCal Calendars etc. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% :-eval(consult('ContractLog/math.prova')). :-eval(consult('ContractLog/datetime.prova')). :-eval(consult('ContractLog/list.prova')). :-eval(consult('ContractLog/update.prova')). :-eval(consult('ContractLog/utils.prova')). :-eval(consult('ContractLog/calendar.prova')). % calendar API :-eval(consult('ContractLog/owl.prova')). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Performative vocabulary of organizational agent % More complex vocabularies might be defined as Semantic Web ontologies %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% performative(request):-performative(query). performative(query). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Interface definitions of the organizational agent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% interface(performative(Performative),performative("?"),"vocabulary of performatives of the agent"). interface(interface(Signature, ModeDeclaration, Description),interface("?","?","?"),"the public interfaces of the agent"). interface(submit(Requester, Type, Result),submit("+","+","-"),"submital rules"). interface(agent(Agent),agent("?"),"the agents of RuleML-2007 defined in an external ontology"). interface(topic(Topic),topic("?"),"the responsibility topics/domains of RuleML-2007"). interface(role(Role),role("?"),"the defined roles of the responsibility assignment matrix for RuleML-2007"). interface(assigned(Agent,Topic,Role),assigned("?","?","?"),"the defined responsibility assignment matrix for RuleML-2007"). interface(getContact(Topic,Request,Contact),getContact("+","+","-"),"request personal contact information for a certain Topic and Request regarding RuleML-2007"). interface(open(Phase),open("-"),"returns the currently active RuleML-2007 phases"). interface(dates(Phase,Start,End),dates("+","-","-"),"returns the start and end date of a phase"). interface(permit(ContactAuthor,submit(ContactAuthor,Submission)),permit("?",submit("?","?")), "permission to submit to RuleML-2007"). interface(submitted(Submission),submitted("?"),"request submitted submissions"). interface(obliged(Reviewer,submit(Reviewer,Review)),obliged("?",submit("?","?")), "review obligations for reviewer"). interface(forbid(Reviewer,review(submission(Authors,Abstract,Paper),Review)),forbid("?",review(submission("?","?","?"),"?")), "forbid reviewer to review his own submissions"). interface(accepted(Submission),accepted("?"),"accepted submissions"). interface(fee(Phase,Fee),fee("?","?"),"registration fee"). interface(computeFee(Participant,Fee),computeFee("?","?"),"compute registration fee for participant"). interface(oblige(Participant,pay(Fee)),oblige("?",pay("?")),"obligation for registered participants to pay fee"). interface(permit(Participant,attend),permit("?","-"),"permission to attend the conference"). interface(permit(Participant,register(Participant)),permit("?",register("?")), "permission to register to RuleML-2007"). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Import meta interpreter axioms for priority computation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% :-eval(add("use_caseRuleML-2007/RuleML-2007_Organization/meta_rules/priority_computation.prova")). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Main rule for this use case: % % Key word: "Single point of entry" % % An external person/agent requests information from the % RuleML-2007 organization. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% rcvMsg(XID,esb, From, Primitive, Payload) :- understandPerformative(XID, From, Primitive, Payload), processMessage(XID, From, Primitive, Payload). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % rules for processing the message %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % try to understand the performative of the message understandPerformative(XID, From, "answer", PayLoad) :- !, fail(). understandPerformative(XID, From, Performative, PayLoad) :- performative(Performative). understandPerformative(XID, From, Performative, PayLoad) :- not(performative(Performative)), sendMsg(XID,esb,From,"answer", notUnderstood("performative",Performative)), fail(). % process the message % request personal contact information from responsible personal agent processMessage(XID,From,Primitive,sponsor(contact(Name,Organization),Amount,results(Level,Benefits,DeadlineResults), performative(Action))):- !, % look-up responsible agent assigned(Agent,ruleml2007_Sponsoring,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", sponsor(contact(Name,Organization),Amount,results(Level,Benefits,DeadlineResults), performative(Action))), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", Payload), sendMsg(XID,esb,From, "answer", Payload). % look-up interface processMessage(XID,From,Primitive,PayLoad):- not(interface(PayLoad,Description)), sendMsg(XID,esb,From,"answer", notUnderstood(PayLoad)), fail(). processMessage(XID,From,Primitive,[Function|Arguments]):- interface([Function|Arguments],Description), derive([Function|Arguments]), sendMsg(XID,esb,From, "answer", [Function|Arguments]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Import Responsibility Assignment Matrix from ontology and define % the query functions of the organizational agent on top %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % import external ontology of responsibility assignment matrix import("http://ibis.in.tum.de/projects/paw/ruleml-2007/RuleML-2007.owl"). % use external OWL Lite reasoner for a list of available reasoners % see the OWL2PROVA API reasoner("owl"). % member of the organizing committee agent(Agent:ruleml2007_Organizing_Committee). % responsibility domain of RuleML 2007 responsibility(Domain:ruleml2007_Responsibility). % role such as "responsible", "informed", "accountable" etc. role(Role:owl_ObjectProperty). % responsibility assignment matrix % e.g. ruleml2007_GeneralChair ruleml2007_responsible ruleml2007_Symposium assigned(Agent,Responsibility,Role):- import(URL), reasoner(Reasoner), rdf(URL,Reasoner,Agent,Role,Responsibility). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Requests to personal agents % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % request personal contact information from responsible personal agent getContact(Topic,Request,Contact):- % look-up responsible agent assigned(Agent,Topic,ruleml2007_responsible), %TODO: Implement the escalation procedure here % query personal contact information from agent sendMsg(XID,esb,Agent, "query", person(Name,Role1, Title, EMail, Telephone)), % receive answers multiple times rcvMult(XID,esb,Agent, "answer", Contact). % request open phases open(Phase):- % look-up responsible agent for Submissions assigned(Agent,ruleml2007_Submission,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", open(Phase)), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", open(Phase)). % request open phases dates(Phase,Start,End):- % look-up responsible agent for Submissions assigned(Agent,ruleml2007_Submission,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", dates(Phase,Start,End)), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", dates(Phase,Start,End)). % permission to submit permit(ContactAuthor,submit(ContactAuthor,Submission)):- % look-up responsible agent assigned(Agent,ruleml2007_Submission,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", permit(ContactAuthor,submit(ContactAuthor,Submission))), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", permit(ContactAuthor,submit(ContactAuthor,Submission))). % request submission from the responsible personal agent for "Submissions" submitted(Submission):- % look-up responsible agent assigned(Agent,ruleml2007_Submission,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", submitted(Submission)), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", submitted(Submission)). obliged(Reviewer,submit(Reviewer,Review)):- % look-up responsible agent assigned(Agent,ruleml2007_Submission,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", obliged(Reviewer,submit(Reviewer,Review))), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", obliged(Reviewer,submit(Reviewer,Review))). forbid(Reviewer,review(submission(Authors,Abstract,Paper),Review)):- % look-up responsible agent assigned(Agent,ruleml2007_Submission,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", forbid(Reviewer,review(submission(Authors,Abstract,Paper),Review))), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", forbid(Reviewer,review(submission(Authors,Abstract,Paper),Review))). accepted(Submission):- % look-up responsible agent assigned(Agent,ruleml2007_Submission,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", accepted(Submission)), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", accepted(Submission)). fee(Phase,Fee):- % look-up responsible agent assigned(Agent,ruleml2007_Submission,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", fee(Phase,Fee)), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", fee(Phase,Fee)). computeFee(Participant,Fee):- % look-up responsible agent assigned(Agent,ruleml2007_Submission,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", computeFee(Participant,Fee)), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", computeFee(Participant,Fee)). oblige(Participant,pay(Fee)):- % look-up responsible agent assigned(Agent,ruleml2007_Submission,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", oblige(Participant,pay(Fee))), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", oblige(Participant,pay(Fee))). permit(Participant,attend):- % look-up responsible agent assigned(Agent,ruleml2007_Submission,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", permit(Participant,attend)), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", permit(Participant,attend)). permit(Participant,register(Participant)):- % look-up responsible agent assigned(Agent,ruleml2007_Submission,ruleml2007_responsible), % query permission from responsible agent sendMsg(XID,esb,Agent, "query", permit(Participant,register(Participant))), % receive answers multiple times rcvMult(XID,esb,Agent,"answer", permit(Participant,register(Participant))).