<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Towards a Mapping from ERDF(S) to Take Vocabulary</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ion-Mircea Diaconescu</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Adrian Giurca</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gerd Wagner</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jens Dietrich</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>E-Mail:</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>M.Diaconescu</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giurca</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>G.Wagner}@tu-cottbus.de</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>J.B.Dietrich@massey.ac.nz</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Brandenburg University of Technology</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Massey University</institution>
          ,
          <country country="NZ">New Zealand</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper presents a mapping solution from ERDF(S) to Take vocabulary. The work is related to an investigation of integrating ERDF Derivation Rules into Take inference engine. Some steps are required to finalize this task: a mapping between ERDF(S) and Take vocabulary, integration of ERDF knowledge base in Take, and empowering Take inference engine to deal with both Closed World Assumption and Open World Assumption, specifically with Open and Closed predicates and two types of negation: strong negation and weak negation.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        The paper presents an approach of a mapping from ERDF(S)[
        <xref ref-type="bibr" rid="ref2 ref3 ref4">3, 4, 2</xref>
        ] to Take [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]
vocabulary. This mapping is part of our project to extend Take with support for
ERDF Derivation Rules.
      </p>
      <p>
        Influenced by Mandarax [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], Take is a backward inference engine, designed to
deal with objects as facts. In the actual implementation, Java objects are used.
The engine use a polymorphic negation: (1) strong negation for JPredicate and
PropertyPredicates - predicates generated for boolean methods respectively
boolean properties from Java Beans. Those are computed without using rules.
(2) negation as failure for SimplePredicate - predicates defined by rules and
used in rules, facts, queries or external fact stores. Take compiles rules to an
optimized Java code before the inference process is started, this having as primary
advantage a better scalability.
      </p>
      <p>Since explicit negative information is not provided (with exception of Boolean
properties), and the inference is under CWA hypothesis, false information can
be inferred in some cases. For instance, reasoning on top of a FOAF3 facts base,
a rule set can conclude that two persons does not foaf:knows one each other
since no occurrence of a foaf:knows property is found in at least one FOAF file
of the two persons refereing the other person (CWA). Since it is not mandatory
to refer all known persons in your FOAF file (not relating a known person in
your FOAF file does not means that you don’t know him), the derived conclusion
3 FOAF Specification - http://xmlns.com/foaf/spec/
might be not appropriate. In this example, it is obvious that foaf:knows can
be represented as an Open Property.</p>
      <p>
        Based on Partial Logic [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], ERDF comes to solve this problem by providing
the possibility of expressing negated facts, and two types of negation in rules:
strong negation and weak negation. Also it defines new types of classes and
properties. In [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] detailed information and use cases are provided about those
extensions and the rule language.
      </p>
      <p>
        We are not aware of any substantial work regarding the mapping from ERDF
(and implicitly RDF(S)[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]) vocabularies to Java classes. Such a mapping is a key
point towards mapping RDF/ERDF descriptions to Java objects. The next paper
section deals with this issue tailored to the Take inference engine mechanism.
2
2.1
      </p>
      <p>Mapping ERDF Schemas to Take Vocabulary</p>
    </sec>
    <sec id="sec-2">
      <title>Resolving URI’s to Java Identifiers</title>
      <p>Since in ERDF Schemas classes and properties are defined by URI’s, first step
is to define a mapping from URI’s to Java identifiers. The following rules define
this mapping:
1. Using MD54 hashes, each URI is mapped to an unique ID. It will be prefixed
with an ’ ’ (underscore), since Java identifiers cannot start with digits.
2. Optional, at the end of the identifier the local name (where is possible) is
added. Additional, comments may be generated to improve readability.
3. The reversibility is obtained by storing each URI expressing a class or a
property and its generated Java identifier.</p>
      <sec id="sec-2-1">
        <title>Example 1. Mapping URI’s to Java identifiers</title>
        <p>http://example.org/voc/Person ⇒ _35EDA2C34D57C09DCDB4D1544C674779_Person
http://example.org/v/Person ⇒ _DD3A8FFF3850417783DC9651D86B0395_Person
Using MD5 hashes, for each different URI a different signature is obtained.
Two or many URI’s may express the same concept (such as Person from the
above example), but since different URI’s are used, a distinct class or property
is generated for each of them. The mapping from Java identifiers to ERDF
classes/properties is implemented by using a Java Map.
2.2</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Mapping Classes and Properties</title>
      <p>This section describes the mapping from ERDF classes and properties to Take
vocabulary. The following rule expresses the general mapping from ERDF
vocabulary to Java vocabulary:
4 The MD5 Message-Digest Algorithm - http://www.ietf.org/rfc/rfc1321.txt
Rule 1 (a) For each ERDF class a Java class is generated; (b) Each ERDF
property maps to a Java property.</p>
      <p>Example 2. Mapping classes and properties from ERDF(S) to Java Vocabulary
&lt;erdf:Class erdf:about="http://example.org/v/Person"/&gt;
&lt;rdf:Property rdf:about="http://example.org/v/name"&gt;
&lt;rdfs:domain rdf:resource="http://example.org/v/Person" /&gt;
&lt;rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string" /&gt;
&lt;/rdf:Property&gt;
// Class related URI: http://example.org/v/Person
public class _DD3A8FFF3850417783DC9651D86B0395_Person {
// Property related URI: http://example.org/voc/name
private Collection&lt;String&gt; _4D9F16067649DF5A90773F7D832D9122_name;
public Collection&lt;String&gt; get_4D9F16067649DF5A90773F7D832D9122_name() {
return this._4D9F16067649DF5A90773F7D832D9122_name;
}
}</p>
      <p>Each ERDF property maps in Java as a collection containing all values of
that property. This allows to express multi-valued ERDF properties. Accessors
are generated for each property. Adding an element to collection must be done by
checking some constraints depending by the type of the added value (datatype
or object type).
2.3</p>
      <p>
        Solving rdfs:range, rdfs:domain and rdfs:subClassOf relations
In ERDF multiple ranges are allowed for a property. Types are mapped according
with their nature: (1) datatype mappings and (2) object type mappings.
Datatypes If all property ranges are datatypes then, according with RDF
Semantics [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], the property type is the intersection of all those types. For
compatible datatypes this intersection is defined, for all the rest the intersection will be
an empty set and therefore the property will not be generated and an exception
is thrown. Only datatypes defined by XML Schema datatypes 5 are allowed. A
mapping from XML datatypes to Java types is defined 6. All datatypes in Java
will be expressed by using corresponding wrapper classes (e.g.Integer for int)
and collections representing properties are parameterized with the
corresponding wrapper class. The RDF datatype, rdf:XMLLiteral, maps to String type
in Java.
      </p>
      <p>Example 3. Mapping ranges for datatypes
&lt;rdf:Property rdf:about="http://example.org/v/salary"&gt;
&lt;rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#int" /&gt;
&lt;rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#float" /&gt;
&lt;rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#double" /&gt;
5 XML Schema Datatypes - http://www.w3.org/TR/xmlschema-2/
6 XML datatypes mapping - http://java.sun.com/javaee/5/docs/tutorial/doc/bnazq.html
&lt;rdfs:domain rdf:resource="http://example.org/v/Employee" /&gt;
&lt;/rdf:Property&gt;
public class _f2989a52fddb17fa72653625cd9c0374_Employee {
private Collection&lt;Integer&gt; _93ad619912a976c6c56623d3c6b73491_salary;
public Collection&lt;Integer&gt; get_93ad619912a976c6c56623d3c6b73491_salary() {
return this._93ad619912a976c6c56623d3c6b73491_salary;
public ObjectArrayList(ArrayList&lt;String&gt; types) {this.types = types;}
public boolean add(Object value) {
boolean valid = true;
for(int i=0;i&lt;types.size();i++) {
try {</p>
      <p>valid = valid &amp;&amp; (Class.forName(types.get(i)).isInstance(value));
}catch(Exception e){System.out.println(e.toString());}
}
if(valid) {super.add(value); return true;}
return false;
Object types All types which are not XML datatypes are considered object
types. In this case, a proper intersection solution cannot be defined using an
automatic method. When a single range is defined for a ERDF property, the
collection will be parameterized with that type. If many ranges are used for the
same property, then the collection representing the property is parameterized
with the Java super type Object. The intersection of ranges is resolved at
runtime by the add method, checking if the value wanted to be added is instance of
all types expressed by its rdfs:range occurrences. For object types, we define
a new Collection implementation, ObjectArrayList, which will be used to
instantiate all object properties from our Java classes.</p>
      <p>Example 5. Implementing ObjectArrayList
public class ObjectArrayList extends ArrayList&lt;Object&gt;{</p>
      <p>private ArrayList&lt;String&gt; types;
}</p>
      <p>}
}</p>
      <p>}</p>
      <p>Since the Take engine manages itself properties having type Collection, we
just have to define a get method which returns the collection. Before adding
new values for a specific property, some constraints have to be verified (e.g. do
not have the same value many times). An implementation of Collection (i.e.
extending ArrayList by overriding the add method) is provided.</p>
      <sec id="sec-3-1">
        <title>Example 4. Implementing DatatypeArrayList</title>
        <p>public class DatatypeArrayList extends ArrayList&lt;Object&gt; {
public boolean add(Object value) {
if(!this.contains(value)) {super.add(value); return true;}
return false;
Mapping rdfs:domain Unlike in Java, ERDF properties are global and applies
to all classes defined as their domains. The proposed mapping creates a property
with the same name in each class appearing in their rdfs:domain occurrences.
Example 6. Mapping properties having multiple domains
&lt;erdf:Class erdf:about="http://example.org/v/Person" /&gt;
&lt;erdf:Class erdf:about="http://example.org/v/City" /&gt;
&lt;rdf:Property rdf:about="http://example.org/v/name" /&gt;
&lt;rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string" /&gt;
&lt;rdfs:domain rdf:resource="http://example.org/v/Person" /&gt;
&lt;rdfs:domain rdf:resource="http://example.org/v/City" /&gt;
&lt;/rdf:Property&gt;
public class _dd3a8fff3850417783dc9651d86b0395_Person {</p>
        <p>private Collection&lt;String&gt; _ba6a578397a5a376500712b8cb11e9e9_name;
}
public class _0545f96c913977fbf95b0c52de54d6af_City {</p>
        <p>private Collection&lt;String&gt; _ba6a578397a5a376500712b8cb11e9e9_name;
}
Mapping rdfs:subClassOf Since Java does not allows multiple inheritance,
but ERDF supports that by using rdfs:subClassOf property, we need to
emulate multiple inheritance by using Java interfaces. The following rule defines the
multiple inheritance approach:
Rule 2 (a) For each class implied in an inheritance chain, an empty interface
is generated; (b) Each class from the inheritance chain must implements all
interfaces corresponding to its superclasses; (c) Each class implied in the
inheritance chain contain a copy of all properties (and corresponding accessors and
comments) of its superclasses.</p>
        <p>This methodology allows the usage of the Java operator instanceof for
emulating multiple inheritance. All generated interfaces does not contains methods
and are used only for the above purpose.
2.4</p>
        <p>Expressing Closed, Open and Partial Properties and classes
ERDF specializes its classes and properties as closed, open or partial. Such a
classification is important during the inference process (OWA or CWA may
applies depending on the classification). The mapping uses Java annotations
as a solution for classifying classes and properties. The following annotations
are defined: (1) @closed - meaning closed class and/or property; (2) @open - to
express open class and/or property; (3) @partial - denoting partial class and/or
property. The default annotation is @open. Using Java annotation provides us
an elegant solution for identifying types of classes and properties.
Example 7. Annotating properties
&lt;erdf:Class rdf:about="http://example.org/v/Person" /&gt;
&lt;erdf:ClosedProperty rdf:about="http://example.org/v/authorOf" /&gt;
&lt;rdfs:range rdf:resource="http://example.org/v/Publication" /&gt;
&lt;rdfs:domain rdf:resource="http://example.org/v/Person" /&gt;
&lt;/erdf:ClosedProperty&gt;
public class _dd3a8fff3850417783dc9651d86b0395_Person {
@closed
private Collection&lt;_64742878a633276917290732b0301d3b_Publication&gt;</p>
        <p>_5470da641d7738e11e2e1ef15e3c23a8_authorOf;
}
3</p>
        <p>Conclusion and Future work
The paper provides a mapping solution from ERDF Schemas to Take vocabulary.
Some issues such as the intersection of ERDF property ranges are considered and
a concrete distinction between datatypes and object types is made.</p>
        <p>Further work includes empowering Take engine with support for reasoning
in both OWA and CWA taking in account classes and properties types and
considering two kinds of negation, namely strong negation and negation as failure.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>RDF</given-names>
            <surname>Semantics</surname>
          </string-name>
          .
          <source>W3C Recommendation 10 February</source>
          <year>2004</year>
          . http://www.w3.org/TR/rdf-mt/.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>A.</given-names>
            <surname>Analyti</surname>
          </string-name>
          , G. Antoniou,
          <string-name>
            <given-names>C. V.</given-names>
            <surname>Damasio</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G.</given-names>
            <surname>Wagner</surname>
          </string-name>
          .
          <article-title>Extended RDF as a Semantic Foundation of Rule Markup Languages</article-title>
          .
          <source>Journal of Artificial Intelligence Research</source>
          ,
          <volume>32</volume>
          :
          <fpage>37</fpage>
          -
          <lpage>94</lpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Anastasia</given-names>
            <surname>Analyti</surname>
          </string-name>
          , Grigoris Antoniou, Carlos Viegas Damasio, and
          <string-name>
            <given-names>Gerd</given-names>
            <surname>Wagner</surname>
          </string-name>
          .
          <article-title>Negation and Negative Information in the W3C Resource Description Framework</article-title>
          .
          <source>Annals of Mathematics, Computing and Teleinformatics</source>
          ,
          <volume>1</volume>
          (
          <issue>2</issue>
          ):
          <fpage>25</fpage>
          -
          <lpage>34</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Anastasia</given-names>
            <surname>Analyti</surname>
          </string-name>
          , Grigoris Antoniou, Carlos Viegas Damasio, and
          <string-name>
            <given-names>Gerd</given-names>
            <surname>Wagner</surname>
          </string-name>
          .
          <article-title>Stable Model Theory for Extended RDF Ontologies</article-title>
          . In Yolanda Gil,
          <string-name>
            <given-names>Enrico</given-names>
            <surname>Motta</surname>
          </string-name>
          , V. Richard Benjamins, and Mark A. Musen, editors,
          <source>Proceedings of the 4th International Semantic Web Conference</source>
          , volume
          <volume>3729</volume>
          of Lecture Notes in Computer Science (LNCS), pages
          <fpage>21</fpage>
          -
          <lpage>36</lpage>
          , Galway, Ireland,
          <fpage>6</fpage>
          -
          <lpage>10</lpage>
          November 2005. Springer-Verlag.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>D.</given-names>
            <surname>Brickley</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.V.</given-names>
            <surname>Guha</surname>
          </string-name>
          .
          <source>RDF Vocabulary Description Language 1</source>
          .0:
          <string-name>
            <given-names>RDF</given-names>
            <surname>Schema</surname>
          </string-name>
          .
          <source>W3C Recommendation February</source>
          <year>2004</year>
          . http://www.w3.org/TR/rdfschema/.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Jens</given-names>
            <surname>Dietrich</surname>
          </string-name>
          , Jochen Hiller, and
          <string-name>
            <given-names>Bastian</given-names>
            <surname>Schenke</surname>
          </string-name>
          .
          <article-title>Take - A Rule Compiler for Derivation Rules</article-title>
          .
          <source>In Proceedings of the International RuleML Symposium on Rule Interchange and Applications (RuleML-2007)</source>
          , volume
          <volume>4824</volume>
          of Lecture Notes in Computer Science (LNCS). Springer,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Heinrich</given-names>
            <surname>Herre</surname>
          </string-name>
          ,
          <string-name>
            <surname>Jan O. M. Jaspars</surname>
            , and
            <given-names>Gerd</given-names>
          </string-name>
          <string-name>
            <surname>Wagner</surname>
          </string-name>
          .
          <article-title>Partial Logics with Two Kinds of Negation as a Foundation for Knowledge-Based Reasoning</article-title>
          . In D.M.
          <article-title>Gabbay and H</article-title>
          . Wansing, editors, What is Negation? Kluwer Academic Publishers,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>8. Mandarax. project website. http://www.mandarax.org/.</mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Gerd</given-names>
            <surname>Wagner</surname>
          </string-name>
          , Adrian Giurca,
          <string-name>
            <surname>Ion-Mircea</surname>
            <given-names>Diaconescu</given-names>
          </string-name>
          , Grigoris Antoniou, and
          <article-title>Carlos Viegas Damasio</article-title>
          .
          <source>ERDF Implementation and Evaluation</source>
          .
          <source>Technical report, March</source>
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>