generating a library of ruleml 1.0 schemas

33
Generating a Library of RuleML 1.0 Schemas CS 6795 SEMANTIC WEB TECHNIQUES TEAM6: HAWRA BADER ALSEEF JEEVAN REDDY KODUR 19 NOV, 2012

Upload: gallia

Post on 22-Feb-2016

32 views

Category:

Documents


0 download

DESCRIPTION

Generating a Library of RuleML 1.0 Schemas. CS 6795 Semantic Web Techniques Team6: Hawra Bader Alseef Jeevan Reddy Kodur 19 Nov, 2012. Outline. Brief definition of: RuleML Derivation RuleML (sublanguages) Relax NG Compact schema Project Description . Use cases of the project . - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Generating a Library of  RuleML  1.0 Schemas

Generating a Library of RuleML 1.0 Schemas

CS 6795 SEMANTIC WEB TECHNIQUES

TEAM6:HAWRA BADER ALSEEFJEEVAN REDDY KODUR

19 NOV, 2012

Page 2: Generating a Library of  RuleML  1.0 Schemas

OUTLINE Brief definition of: RuleML

Derivation RuleML (sublanguages)

Relax NG Compact schema

Project Description. Use cases of the project. Explanation of project implementation:Phase 1

Phase 2

Phase 3

Phase 4

Project results.

Page 3: Generating a Library of  RuleML  1.0 Schemas

RULEML :RuleML is a family of sublanguages whose root allows access to the language as a whole and whose members allow to identify customized subsets of the language. Therefore, RuleML's specification employs modular XML Schemas.

This was originally specified in Document Type Definitions (DTDs) [W3C98], then switched to XML Schema Definition Language (XSD) schemas.

Also this is developed to express both forward (bottom-up) and backward (top-down) rules in XML for deduction, rewriting, and further inferential-transformational tasks.

It is also defined by the Rule Markup Initiative, as an open network of individuals and groups from both industry and academia that was formed to develop a canonical Web language for rules using XML markup and transformations from and to other rule standards/systems. RuleML builds a hierarchy of rule sublanguages upon XML, RDF, XSLT, and OWL.

Page 4: Generating a Library of  RuleML  1.0 Schemas

The official model of the Derivation RuleML family of sublanguages.

The model shows the sublanguages in top-down order where the most expressive sublanguage is shown at the top and generality decreases as we go down.

A diamond-headed arrow indicates an aggregation association.

datalog is part of hornlog Regular-headed arrows indicate generalization as used

for inheritance.bindatalog is a datalog

The composition may happen directly (datalog) , or indirectly through subsequent associations.

(bindatalog is not directly associated with any modules, but with some modification it inherits them )

A solid line indicates distinct from the standard aggregation relationship.

DERIVATION RULEML:

Page 5: Generating a Library of  RuleML  1.0 Schemas

THE RULEML 1.0 SCHEMAS IN RELAX NG COMPACT :

The benefits of a re-engineering and re-conceptualization of the non-SWSL portion of the Derivation Rules subfamily of RuleML in Relax NG Compact schemas are: decreased positional sensitivity. greater flexibility in modularization.unification of human-readable and machine-readable versions.

Page 6: Generating a Library of  RuleML  1.0 Schemas

PROJECT DESCRIPTION:

The project is about generating a library of RuleML 1.0 schemas where the desired schema should be in the Relax NG Compact (RNC) form.

The RuleML 1.0 schemas in Relax NG consist of a ‘backbone’ of named schemas enriched by a large number of parameter-defined schemas customizable via a schema generator, MYNG.

By using the MYNG tool, the Library of relevant RuleML 1.0 sublanguages in RNC will be built which then shall be tested and illustrated with some sample instances.

The library should be available online.

Page 7: Generating a Library of  RuleML  1.0 Schemas

THE USE CASES OF THE PROJECT: We mainly have accomplished the project by employing 3

use cases of different sublanguages.1. Horn Logic

2. Ground Logic

3. Ground Fact Horn Logic:According to IgorMozetic on W3C RIF-WG Wiki:Horn Logic is a formal language, which has a corresponding inference procedure, thus forming a formal system together. The formal language allows to express rules (and facts), and queries. The inference procedure computes answers to queries from rules (and facts).

Ground Logic and Ground Fact:In mathematical logic, a ground term of a formal system is a term that does not contain any free variables.

Page 8: Generating a Library of  RuleML  1.0 Schemas

PROJECT IMPLEMENTATION

Page 9: Generating a Library of  RuleML  1.0 Schemas

PHASE 1: CREATING RNC SCHEMAS BY USING MYNG TOOL.

To do this phase, we open the page MYNG that was built in PHP and select the checkboxes for Hornlog and binary and we refresh the schema. Then, there will be a link of a new URL generated that is the RNC schema for the checkboxes we selected. When we click on that link, we can see custom_driver.rnc file generated related to our binaryhornlogic. This way we generate different Relax NG Compact for different sublanguages such as polyadic ground fact and polyadic ground logic sublanguage.

MYNG generating rnc schema screen shot:

Page 10: Generating a Library of  RuleML  1.0 Schemas

PHASE 2: CREATING EXAMPLS FOR BINARY HORN LOGIC SCHEMA.

Example[1] :Sample RuleML to show Horn Logic Binary relation.

if "a number of customer uses parking lot has vehicle of car type", then "parking fee for the customer per hours parked would be in increments of 1 Dollar"

Page 11: Generating a Library of  RuleML  1.0 Schemas

<Atom> <Rel>parking fee</Rel> <Ind>Chown and Hanson</Ind> <Ind>time</Ind> <slot> <Expr> <Fun>duration</Fun> </Expr> <Data>vehicle class</Data> </slot> </Atom> </Assert> <Query node="#query1"> <And> <Atom> <Rel>relation</Rel> <Ind>customer_1</Ind> <Var>customer_1 name</Var> </Atom> <Atom> <op> <Rel>another relation</Rel> </op> <Ind>car list</Ind> <Ind>rates</Ind> </Atom> </And> </Query></RuleML>

XML EXAMPLE FOR BINARY HORN LOGIC SCHEMA.

<Assert> <Implies> <then> <Atom> <Rel>parking fee</Rel> <Var>customer</Var> <Var>hours parked</Var> <slot> <Expr type="incremental"> <Fun>Dollar</Fun> </Expr> <Data>1</Data> </slot> </Atom> </then> <if> <And> <Atom> <Rel>paid parking lot</Rel> <Var>customer</Var> <Ind>number</Ind> </Atom> <Atom> <Rel>vehicle</Rel> <Var>car</Var> <Ind>type</Ind> </Atom> </And> </if> </Implies>

<?xml-modelhref="http://ruleml.org/1.0/relaxng/schema_rnc.php?backbone=xf&amp;default=x7&amp;termseq=x2&amp;lng=x1&amp;propo=x3ff&amp;implies=x7&amp;terms=xf3f&amp;quant=x3&amp;expr=xf&amp;serial=xf" type="application/relax-ng-compact-syntax" charset="UTF-8" ?><RuleML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ruleml.org/spec" xmlns:xs="http://www.w3.org/2001/XMLSchema">

Page 12: Generating a Library of  RuleML  1.0 Schemas

XML EXAMPLE FOR BINARY HORN LOGIC SCHEMA ON OXYGEN.

Page 13: Generating a Library of  RuleML  1.0 Schemas

PHASE 3: Creating sample instances for Relax NG

Compact Schemas.1. Polyadic Ground Logic Schema.

2. Polyadic Ground Fact Schema.

Page 14: Generating a Library of  RuleML  1.0 Schemas

EXAMPLES OF POLYADIC GROUND LOGIC SCHEMA.

Example 1:Sample RuleML to show Ground Logic Polyadic relation.

if "books can be hardbound or softbound, and books can be informative or fun" then"an encyclopedia, a dictionary, and a novel are books"

Page 15: Generating a Library of  RuleML  1.0 Schemas

<?xml-modelhref="http://ruleml.org/1.0/relaxng/schema_rnc.php?backbone=x3&amp;default=x7&amp;termseq=x7&amp;lng=x1&amp;propo=x3ff&amp;implies=x7&amp;terms=xf3f&amp;quant=x1&amp;expr=x0&amp;serial=xf" type="application/relax-ng-compact-syntax" charset="UTF-8” ?>

<RuleML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ruleml.org/spec" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <Assert mapDirection="forward" mapClosure="universal"> <Implies> <then> <Atom> <op> <Rel>book</Rel> </op> <Ind>encyclopedia</Ind> <Ind>dictionary</Ind> <Ind>novel</Ind> </Atom> </then> <if> <And> <Atom> <op> <Rel>book</Rel> </op> <Ind>informative</Ind> <Ind>relaxing</Ind> </Atom> <Atom> <op> <Rel>book</Rel> </op> <Ind>hardbound</Ind> <Ind>softbound</Ind> </Atom> </And> </if> </Implies> </Assert></RuleML>

XML EXAMPLE FOR POLYADIC GROUND LOGIC SCHEMA.

Page 16: Generating a Library of  RuleML  1.0 Schemas

XML EXAMPLE FOR POLYADIC GROUND LOGIC SCHEMA ON OXYGEN.

Page 17: Generating a Library of  RuleML  1.0 Schemas

EXAMPLES OF POLYADIC GROUND FACT SCHEMA.

Example 1:Sample RuleML to show Ground Fact Polyadic relation.

sample web browser type include webkits (ex. Google Chrome) and mobile (ex. Opera);

social networking sites include Facebook, Twitter, and Google Plus;

sample instant messengers include Skype and Yahoo! Messenger

Page 18: Generating a Library of  RuleML  1.0 Schemas

XML EXAMPLE FOR POLYADIC GROUND FACT SCHEMA.<?xml-model href="RuleML%20files/Ground%20Fact%20Polyadic.rnc" type="application/relax-ng-compact-syntax"?>

<RuleML xmlns="http://ruleml.org/spec" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Query> <Atom> <op> <Rel>web browsers</Rel> </op> <slot> <Ind>webkit</Ind> <Ind>Google Chrome</Ind> </slot> <slot> <Ind>mobile</Ind> <Ind>Opera</Ind> </slot> </Atom> <Atom> <op> <Rel>social networking sites</Rel> </op> <Ind>Facebook</Ind> <Ind>Twitter</Ind> <Ind>Google Plus</Ind> </Atom> </Query> <Assert node="#assert1"> <Atom> <op> <Rel>instant messengers</Rel> </op> <slot> <Ind>Skype</Ind> <Ind>Yahoo! Messenger</Ind> </slot> </Atom> </Assert></RuleML>

Page 19: Generating a Library of  RuleML  1.0 Schemas

XML EXAMPLE FOR POLYADIC GROUND FACT SCHEMA.

Page 20: Generating a Library of  RuleML  1.0 Schemas

PHASE 4: DOCUMENTING IN AN ONLINE DIRECTORY ALL THE FILES IN A DIRECTORY AND SUBDIRECTORIES.We answered three different type of questions in each sublanguage by creating some examples to each of them in binary hornlogic, polyadic ground fact, polyadic groundlogic. The focus of this phase is the documentation of all results in an online directory. Here we try to make all the files available in an online directory. But first we try to create a new webpage which is needed to keep all the files in the form of directory so we have created a webpage with the url as http://generateruleml-1-library.xp3.biz/.

Page 21: Generating a Library of  RuleML  1.0 Schemas

We can see in this webpage there is a directory of folders in the starting where we have two main directories as RuleML Files and other one as Relax NG Compact Schemas.

When we click on the RuleML Files it shows a new page where it has information about the different types of sublanguages we have included.

THIS BELOW DIAGRAM SHOWS THE ACTUAL HOME WEBPAGE.

Page 22: Generating a Library of  RuleML  1.0 Schemas

Further we can see that the different sublanguages over here behave as a different subdirectories which have few ruleml example files under them. All these example files can be seen when once we click on a particular sublanguage and below we can see the binaryhornlog example files opened.

THE BELOW PAGE SHOWS THE DIFFERENT SUBLANGUAGES IN AN ORDER.

Page 23: Generating a Library of  RuleML  1.0 Schemas

So in the next level when we click on a particular ruleml example file we can see that the particular ruleml file gets opened where we can see the code written over there.

THE WEBPAGE SHOWN BELOW IS FOR BINARY HORN LOGIC SUBDIRECTORY, SIMILARLY WE CAN SEE FOR ALL OTHER

SUBDIRECTORIES.

Page 24: Generating a Library of  RuleML  1.0 Schemas

THE WEBPAGE SHOWN BELOW IS ONE EXAMPLE OF BINARY HORN LOGIC

Page 25: Generating a Library of  RuleML  1.0 Schemas

When we move back again to the actual home page we see that we have one more directory as Relax NG Compact Schemas here when we click on this we see that the next page opens which has the different RNC files for our particular sublanguages and one more subdirectory named as modules. When you click on modules we can see further another file system which has different files used in our validation of our sublanguages. Below we can see these two webpages in a screenshot.

Page 26: Generating a Library of  RuleML  1.0 Schemas

INDEX OF/RELAXNG/MODULES

Page 27: Generating a Library of  RuleML  1.0 Schemas

We finally run these sublanguage examples in oxygen or validator.nu accordingly and test whether the documents are valid or not accordingly. Below we show the screenshot of validator.nu.

Page 28: Generating a Library of  RuleML  1.0 Schemas

PROJECT RESULTS. In particular, the library of RuleML 1.0 schemas has

built with specific sublanguages, which are Horn Log, Ground Logic and Ground Fact.

We can compare these three sublanguages in terms of expressiveness.

Page 29: Generating a Library of  RuleML  1.0 Schemas

Based on what we have implemented, we can illustrate the level of expressiveness of three sublanguages by the figure below.

Page 30: Generating a Library of  RuleML  1.0 Schemas

The figure shows the sublanguages in bottom-up order where the most expressive sublanguage is shown at the bottom. It shows that Datalog sublanguage is at the bottom and as we mentioned earlier that Datalog is a part of Horn Log, we can infer that:Horn Log is the most expressive sublanguage among them where It includes implications (rules), relations, quantifications (Forall, Exists) and functions <Expr> as well.

Page 31: Generating a Library of  RuleML  1.0 Schemas

The second sublanguage is Ground Logic where it is more expressive than Ground Fact because implications (rules) are allowed as well as relations. It contains more possibilities such as ( Ind, Skolem, Data, Reify, Arg, Slot, etc ) but does not contain Var.

The third sublanguage is Ground Fact where it just contains relations and constants, (no implications or quantifiers).

Page 32: Generating a Library of  RuleML  1.0 Schemas

REFERENCES: http://ruleml.org/modularization/#pr http://www.w3.org/2005/rules/wg/wiki/Horn_Logic http://en.wikipedia.org/wiki/Ground_expression http://ruleml.org/0.85/ooruleml-

remodularized_schematized.pdf http://www.cs.unb.ca/~boley/papers/RuleMLinRelaxNG.pdf http://ruleml.org/1.0/relaxng/

Page 33: Generating a Library of  RuleML  1.0 Schemas

DONE !!