ERDF Tutorial

From Wiki

(Redirected from ERDF)
Jump to: navigation, search

Contents

Introduction

Since RDF(S) does not support negation neither rules. Extended RDF (ERDF) comes with negation and rules over RDF(S). In ERDF two types of negation are supported:

  1. negation-as-failure - also called weak negation, it is intended to decide if is possible to prove a specific ground fact.
  2. strong negation - is used to explicitly provide negative information in the knowledges base. For example we can explicitly say: "John does not likes smoking" or "the content of the resource X is considered to not be correct".

Classes and Properties

Figure 1: ERDF Vocabulary

In RDF(S) we have the concept of class (expressed by rdfs:Class) and property (expressed by rdf:Property). In ERDF, new types of classes and properties are added:

  1. Partial Class and Partial Property - are properties which can be true, false, both true and false, or neither true nor false.
  2. Total Class and Total Property - are properties and classes which satisfy the totalness. In the case of properties, this means that it has to be true or false, but possible both. Those two classes are considered abstract, therefore we cannot instantiate them. In place, we can instantiate their sub-classes:
    • Open Class and Open Property - In order to infer negated statements, for instances of those classes, we can provide negative information along with ordinary (positive) information. This case is underlined as Open World Assumption (OWA).
    • Closed Class and Closed Property - in the case of those properties, the entailment of NAF(p(x,y)) allows to derive SNEG(p(x,y)). For classes, this is interpreted as: entailment of NAF(rdf:type(x,c)) allows derivation of SNEG(rdf:type(x,c)). This case is underlined as Closed World Assumption (CWA).

By default, all RDF predicates are considered to be open. The decision if a property (or class) is partial, open or closed depends of the knowledge base owner.

The ERDF namespace is xmlns:erdf="http://www.informatik.tu-cottbus.de/IT/erdf#".

ERDF vocabularies

Using the newly added classes and properties, we can describe the ERDF vocabulary of our facts base.

 <rdfs:Class rdf:about="http://example.com/Person" />
 
 <rdf:Property rdf:about="http://example.com/name">
   <rdfs:domain rdf:resource="http://example.com/Person" />
   <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string" />
 </rdf:Property>
 
 <erdf:PartialProperty rdf:about="http://example.com/interestedIn">
   <rdfs:domain rdf:resource="http://example.com/Person"/>
   <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource" />
 </erdf:PartialProperty>

 <erdf:OpenProperty rdf:about="http://example.com/likes">
   <rdfs:domain rdf:resource="http://example.com/Person" />
   <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource" />
 </erdf:OpenProperty>

 <erdf:ClosedProperty rdf:about="http://example.com/authorOf">
   <rdfs:domain rdf:resource="http://example.com/Person" />
   <rdfs:range rdf:resource="http://example.com/Book" />
 </erdf:ClosedProperty>

In order to express instances of this vocabulary, we use erdf:Description element for expressing instances where properties contains negation. In the rest of the cases, we can use RDF syntax. The negation is expressed by using erdf:negationMode attribute, which can have four possible values:

  1. None - express that no negation is used. It is the default value and can be omitted;
  2. Sneg - denotes strong negation (explicit negative triple);
  3. Naf - express negation-as-failure;
  4. NafSneg - denotes negation-as-failure over strong negation.

We have to notice that for ground facts, only None and Sneg values are allowed. A new attribute, erdf:about is added. It allows URI references, blank nodes identifiers. In addition to rdf:about property, using erdf:about we can allow also literals in the subject position. In this case, the literal is enclosed in the erdf:about sub-element. Examples of instances for the above defined schema are depicted below:

 <erdf:Description erdf:about="#John">
   <ex:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">John Smith</name>
   <ex:interestedIn rdf:resource="urn:topics:SemanticWeb" />
   <ex:interestedIn erdf:negationMode="Sneg" rdf:resource="urn:topics:DataBase" />
   <ex:authorOf rdf:resource="http://example.com/books/b1457" />
   <ex:likes rdf:resource="http://example.com/cars/BMW" />
 </erdf:Description>
 
 <rdf:Description erdf:about="#Tom">
   <ex:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Tom Muller</name>
   <ex:interestedIn rdf:resource="urn:topics:RDF" />
   <ex:authorOf rdf:resource="http://example.com/books/b1287" />
   <ex:likes rdf:resource="http://example.com/cars/Opel" />
 </rdf:Description>

 <erdf:Description>
   <erdf:about rdf:datatype="http://www.w3.org/2001/XMLSchema#string">John Smith</name>
   <ex:denotationOf rdf:resource="#John" />
 </rdf:Description>

ERDF Rules

For ERDF rules, two possible syntaxes are provided:

  1. an XML based syntax, expressed with the help of R2ML;
  2. a non-XML syntax, based on Jena Rules syntax, which is extended with support for express negation.

XML Syntax for ERDF Rules

ERDF Terms

ERDF terms are URI references, blank node identifiers, variables or data literals. They are expressed in two ways, depending on their occurrence as subject expressions or as value expressions:

  • Terms as subject expressions - are values of the erdf:about' attribute, which may be URI references, blank node identifiers or variables using the

SPARQL syntax for blank node identifiers and variables.

  • Terms as value expressions - are expressed either with the help of one of the attributes rdf:resource, rdf:nodeID' or erdf:variable, or as the text

content of the property-value slot element in the case of a data literal.

ERDF Atoms

ERDF atoms are represented by conjunctions and/or dijunctions of Descriptions or DatatypePredicateAtoms. For rules, the value of erdf:negationMode attribute can be any of the four available values: None, Sneg, Naf, NafSneg. Below, we exemplify some possible variants of atoms expressed by using erdf:Description.

 <!-- using variables as values of erdf:about and erdf:variables -->
 <erdf:Description erdf:about="?x">
   <ex:interestedIn rdf:resource="urn:topics:SemanticWeb" />
   <ex:authorOf rdf:resource="http://example.com/books/b1457" />
   <ex:likes erdf:variable="y" />
 </erdf:Description>
 
 <!-- using variables in combination with negation -->
 <erdf:Description erdf:about="?x">
   <ex:interestedIn rdf:resource="urn:topics:SemanticWeb" />
   <ex:interestedIn erdf:negationMode="Sneg" erdf:variable="v" />
   <ex:authorOf rdf:resource="http://example.com/books/b1457" />
   <ex:likes rdf:resource="http://example.com/cars/Opel" />
 </erdf:Description>
 
 <!-- using blank nodes (existentially quantified variables) -->
 <erdf:Description erdf:about="?x">
   <ex:interestedIn rdf:resource="urn:topics:SemanticWeb" />
   <ex:interestedIn erdf:negationMode="NafSneg" rdf:resource="urn:topics:DataBase" />
   <ex:authorOf rdf:resource="http://example.com/books/b1457" />
   <ex:likes rdf:nodeID="a" />
 </erdf:Description>

A DatatypePredicateAtom is used to express built-ins in rules. It uses erdf:predicate attribute to express the URI reference for the built-in. Predefined sets of built-ins, as SWRL built-ins for example, can be used. The following example express a call to a SWRL built-in expressing the addition math operation.

 <erdf:DatatypePredicateAtom erdf:predicate="swrlb:add">
   <erdf:arguments>
     <erdf:Variable>?sum</erdf:Variable>
     <rdfs:Literal rdf:datatype="xs:int">11</rdfs:Literal>
     <rdfs:Literal rdf:datatype="xs:int">74</rdfs:Literal>
   </erdf:arguments>
 </erdf:DatatypePredicateAtom>

ERDF Rule Example

The R2ML provides helpful XML markup needed to express ERDF rules using EDRF atoms.

 A person is eligible for attending to the IT working group if he has Semantic Web interests, and he is author in at least one book.
 
 <r2ml:DerivationRule r2ml:ruleID="IT_WorkingGroup">
   <r2ml:conditions>
     <erdf:Description erdf:about="?x">
       <rdf:type rdf:resource="http://example.com/Person"/>
       <ex:interestedIn rdf:resource="urn:topics:SemanticWeb" />
       <ex:authorOf rdf:nodeId="b" />
     </erdf:Description>
   </r2ml:conditions>
   <r2ml:conclusion>
     <erdf:Description erdf:about="?x">
       <ex:eligibleFor rdf:resource="http://example.com/groups/IT_WG"/>
     </erdf:Description>
  </r2ml:conclusion>
 </r2ml:DerivationRule>

Non-XML Syntax for ERDF Rules

The non-XML syntax for ERDF rules is an extension of JenaRules syntax, by adding support for expressing strong and weak negation. One of the limitation for this syntax is that it does not allows expressing disjunction. We can still express disjunction, if the respective formula is in disjunctive normal form, by splitting that rule in many rules with the same head. It the formula is not in the disjunctive normal form we have to normalize it before splitting it. The non-XML syntax for ERDF rules uses SPARQL triple patterns. Universal quantified variables are preceded by the '?' symbol in front of the variable name, literals, typed literals, URI's and QNames uses the SPARQL syntax. The types of triples are available:

  1. positive triples - expressed by three nodes, subject, predicate and object, e.g.(ex:John ex:likes ex:Opel);
  2. strong negated triples - expressed by using the '-' symbol in front of the predicate (?x -ex:likes ex:BMW);
  3. weak-negated triples - expressed under the form of a built-in, named naf. It's arguments, are the nodes of the triple, e.g. : naf(?x ex:likes ex:Fiat).

Weak negation over strong negation is expressed by adding the '-' symbol in front of the second argument from the call of naf, named predicate, e.g. naf(?x -ex:likes ?z).

We have to notice that all variables have to be bound before the naf call. The built-in fails if the triple expressed by its parameters is found in the working memory or it can be deduced by using other available rules.

 A person is eligible for attending to the IT working group if he has Semantic Web interests, and he is author in at least one book.

 [IT_WorkingGroup: (?x ex:eligibleFor ex:IT_WG)
                   <-
                   (?x rdf:type ex:Person)
                   (?x ex:interestedIn ex:SemanticWeb)
                   (?x ex:authorOf _:a)]

Bibliography

Personal tools