RuleML FOAF: Web Rules for Social Networking Jie Li 1,2 , Harold Boley 1,2 , Virendrakumar C. Bhavsar 1 1 Faculty of Computer Science, University of New Brunswick Fredericton, NB, E3B 5A3, Canada {Jie.Li, bhavsar} AT unb.ca 2 Institute for Information Technology - e-Business National Research Council of Canada {Jie.Li, Harold.Boley} AT nrc.gc.ca I. OVERVIEW Web-based Social Networking is emerging as a major application area for the Semantic Web. Recently, a number of portals have become popular to support Web-based collabora- tion. In particular, the RDF-based Friend-Of-A-Friend (FOAF) project has gained momentum in the last few years and is attracting increasing attention of researchers as well as practi- tioners. However, FOAF only provides (person-centric) facts. Therefore, we propose RuleML FOAF, a combination of the RDF-based FOAF and the Rule Markup Language (RuleML) extending the factual FOAF vocabulary by RuleML rules. FOAF facts are complemented by rules that can derive further FOAF facts, before (RDF) FOAF publication and, on demand, from published (RuleML) FOAF pages. Correspondingly, we have implemented a Fact-oriented Normal Form (FNF) and a Rule-oriented Normal Form (RNF), in the Objected Oriented java Deductive Reasoning Engine for the Web (OO jDREW). While the RNF strives for compactness, the FNF directly corresponds to RDF FOAF facts. The RNF includes rules as well as the (elementary) facts that are needed by the premises of rules. All facts derivable from rules with OO jDREW BU (Bottom Up) are removed from the knowledge base. Corresponding queries will be proved by OO jDREW TD (Top Down). The FNF includes elementary facts and derived facts. Rules are removed from the published knowledge base after all possible facts are derived by running OO jDREW BU. Whenever there are new elementary facts asserted, the (unpublished) rules will be triggered to derive (and publish) further facts. Our running example is a music scenario. We consider the following rules and facts as the original knowledge base: (rule-1) fanOf(?Person,?Band) :- hasCD(?Person,?Band,?amount), greaterThan(?amount,3), watchTVLive(?Person,?Band). (rule-2) fanOf(?Person,?Band) :- go2Concert(?Person,?Band,?frequency), greaterThan(?frequency,2), naf(talkedIn(?Person,?OtherPerson,?Band)). (fact-0) fanOf(Bill,U2). (fact-1) fanOf(Peter,U2). (fact-2) hasCD(Peter,U2,4). (fact-3) watchTVLive(Peter,U2). (fact-4) go2Concert(Peter,U2,3). (fact-5) go2Concert(Lucy,U2,5). II. TWO NORMAL FORMS Since RuleML FOAF is an extension to the current RDF- based FOAF, we provide different normal forms to RuleML FOAF users with different interests: people from the RDF community may only be interested in publishing given and newly derived facts; people from the rule community, on the other hand, may find it acceptable to keep a rule engine at runtime. OO jDREW (http://www.jdrew.org/oojdrew) is employed as a rule engine to run RuleML FOAF knowledge bases: The RNF generation is supported by OO jDREW TD, while the FNF is generated by OO jDREW BU. A. Rule-Oriented Normal Form (RNF) The RNF corresponding to the original knowledge base of our music scenario is shown below (cf. Fig. 1): (rule-1) fanOf(?Person,?Band) :- hasCD(?Person,?Band,?amount), greaterThan(?amount,3), watchTVLive(?Person,?Band). (rule-2) fanOf(?Person,?Band) :- go2Concert(?Person,?Band,?frequency), greaterThan(?frequency,2). (fact-0) fanOf(Bill,U2). * Only stored * (fact-2) hasCD(Peter,U2,4). (fact-3) watchTVLive(Peter,U2). (fact-4) go2Concert(Peter,U2,3). (fact-5) go2Concert(Lucy,U2,5).