OWL - Web Ontology Language

Document Sample
OWL - Web Ontology Language Powered By Docstoc
					                OWL - Web Ontology Language
                                       Semantic Web


                            D. Krause and P.Siehndel
                                IVS Semantic Web Group

                                 December 16, 2010


1     Exercise 1: OWL
1.1     Exercise
Create an OWL ontology that models the following concepts:

    1. There should be three classes: Customer, Shop and Product.
    2. Customer and Shop should be equipped with properties name (xsd:string)
       and email (xsd:string), which are equivalent to foaf:name and foaf:mbox.
    3. Each Product should have an order number (xsd:int). An order number
       can be unambiguously assigned to a Product.
    4. A Shop should have a property sells (range: Product) and a Product
       should have a property soldBy (range: Shop) respectively.

    5. Instances of class Shop that sell more than 100 products should belong to
       a new class BigShop.
    6. A Product must not be a Customer.
    7. Instances that are both, Shop and Customer should belong to a class
       PurchaseAndSale.

1.2     Solution
 <?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
    <!ENTITY foaf "http://xmlns.com/foaf/0.1/" >
    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<rdf:RDF xmlns="http://www.ontologies.com/shopping.owl#"
     xml:base="http://www.ontologies.com/shopping.owl"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:foaf="http://xmlns.com/foaf/0.1/"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    <owl:Ontology rdf:about=""/>

    <!-- (1) the 3 main classes: -->



                                             1
    <owl:Class rdf:ID="Shop"/>
    <owl:Class rdf:ID="Customer"/>
    <owl:Class rdf:ID="Product">

    <!-- (2) properties name and email: -->
    <owl:DatatypeProperty rdf:ID="email">
        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
        <rdfs:domain>
            <owl:Class>
                <owl:unionOf rdf:parseType="Collection">
                    <owl:Class rdf:about="#Customer"/>
                    <owl:Class rdf:about="#Shop"/>
                </owl:unionOf>
            </owl:Class>
        </rdfs:domain>
<owl:sameAs rdf:resource="&foaf;mbox"/>
        <rdfs:comment xml:lang="en">The email adress of a person or organization...</rdfs:comment>
    </owl:DatatypeProperty>
    <owl:DatatypeProperty rdf:ID="name">
        <rdfs:domain>
            <owl:Class>
                <owl:unionOf rdf:parseType="Collection">
                    <owl:Class rdf:about="#Customer"/>
                    <owl:Class rdf:about="#Shop"/>
                </owl:unionOf>
            </owl:Class>
        </rdfs:domain>
        <rdfs:range rdf:resource="&xsd;string"/>
        <rdfs:comment xml:lang="en">The name of something.</rdfs:comment>
<owl:sameAs rdf:resource="&foaf;name"/>
    </owl:DatatypeProperty>

    <!-- (3) order number -->
    <owl:DatatypeProperty rdf:ID="orderNumber">
        <rdf:type rdf:resource="&owl;InverseFunctionalProperty"/>
        <rdfs:domain rdf:resource="#Product"/>
        <rdfs:range rdf:resource="&xsd;int"/>
        <rdfs:comment xml:lang="en">The order number of a product.</rdfs:comment>
    </owl:DatatypeProperty>


    <!-- (4) sells and soldBy -->
    <owl:ObjectProperty rdf:ID="sells">
        <rdfs:domain rdf:resource="#Shop"/>
        <rdfs:range rdf:resource="#Product"/>
        <owl:inverseOf rdf:resource="#soldBy">
     </owl:ObjectProperty>

    <owl:ObjectProperty rdf:ID="soldBy"/>

    <!-- (5) BigShop -->
    <owl:Class rdf:ID="BigShop">
        <rdfs:subClassOf>
            <owl:Restriction>
                <owl:onProperty rdf:resource="#sells"/>
                <owl:minCardinality rdf:datatype="&xsd;int">100</owl:minCardinality>
            </owl:Restriction>
        </rdfs:subClassOf>
        <rdfs:subClassOf rdf:resource="#Shop"/>
    </owl:Class>

    <!-- (6) A Product must not be a Customer -->
    <rdf:Description rdf:about="#Product">
        <owl:disjointWith rdf:resource="#Customer"/>
    </rdf:Description>

    <!-- (7) PurchaseAndSale -->
    <owl:Class rdf:ID="PurchaseAndSale">
        <rdfs:subClassOf>
            <owl:Class>
                <owl:intersectionOf rdf:parseType="Collection">
                    <owl:Class rdf:about="#Customer"/>
                    <owl:Class rdf:about="#Shop"/>
                </owl:intersectionOf>



                                             2
            </owl:Class>
        </rdfs:subClassOf>
    </owl:Class>

</rdf:RDF>



2     Exercise 2: OWL
2.1     Exercise
Answer the following questions (explain your answer):

    1. Which OWL dialect is used by the ontology created in exercise 1?
    2. What modifications are required to make the ontology an OWL DL on-
       tology?

    3. What modifications are required to make the ontology an OWL Lite on-
       tology?
    4. The properties name and email should be replaced by foaf:name and
       foaf:mbox. Which modifications does this cause?

    5. Draw the RDF graph of the definition of class PurchaseAndSale.

2.2     Solution
    1. Which OWL dialect is used by the ontology created in exercise 1?
       At the moment we are using OWL Full. It is not OWL DL because we
       used owl:sameAs to describe equivalent properties. In general, owl:sameAs
       is used to describe equivalent instances. In OWL DL the set of classes,
       instances and properties must not overlap, hence owl:sameAs can only
       be applied to instances. As name and email are properties, we are not
       allowed to apply owl:sameAs to those properties in an OWL DL ontology.

    2. What modifications are required to make the ontology an OWL DL on-
       tology?
       We can use owl:equivalentProperty instead of owl:sameAs, e.g.:

             <owl:DatatypeProperty rdf:ID="email">
               ...
               <owl:equivalentProperty rdf:resource="&foaf;mbox"/>
             </owl:DatatypeProperty>

      But now there is another problem: foaf:mbox is an ObjectProperty. OWL
      DL requires that properties are either ObjectProperties or DatatypeProp-
      erties. Hence, we should convert email in an ObjectProperty too.
    3. What modifications are required to make the ontology an OWL Lite on-
       tology?
       In addition to OWL DL restrictions OWL Lite does not allow the use of
       boolean combinations of class expressions, hence: owl:unionOf, owl:complementOf
       and owl:intersectionOf. Thus, we have to replace definitions like:


                                        3
       <rdfs:domain>
          <owl:Class>
             <owl:unionOf rdf:parseType="Collection">
                <owl:Class rdf:about="#Customer"/>
                <owl:Class rdf:about="#Shop"/>
             </owl:unionOf>
          </owl:Class>
       </rdfs:domain>

     with:

       ...
       <rdfs:domain rdf:resource="#Customer"/>
       <rdfs:domain rdf:resource="#Shop"/>
       ...

     The definition of class PurchaseAndSale is not possible in OWL Lite. Fur-
     thermore, cardinality restrictions are restricted to values 0 and 0. Hence,
     modelling the class BigShop is not possible too.
  4. The properties name and email should be replaced by foaf:name and
     foaf:mbox. Which modifications does this cause?
     The classes Customer and Shop must have the rdf:type foaf:Agent because
     the domain of foaf:mbox is foaf:Agent (see http://xmlns.com/foaf/spec/#term mbox).
  5. Draw the RDF graph of the definition of class PurchaseAndSale.




Figure 1: This Graph represents the RDF Statements that are written down
in Exercise 1.7 in order to describe the class PurchaseAndSale. Blank/Anonym
node names are freely choosen.




                                      4

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:5
posted:10/5/2011
language:English
pages:4