Docstoc

Semantic Web Techniques

Document Sample
Semantic Web Techniques Powered By Docstoc
					Semantic Web Techniques
    - Lecture Notes -

           Harold Boley
           Bruce Spencer
           NRC-IIT Fredericton
           University of New Brunswick


           CS 6795 SWT
           22 September 2006
    Introduction to the Semantic Web




1            CS6795 Semantic Web Techniques   22-Sep-06
    Five main points


       Tim Berners-Lee‟s vision
        –   web information should be machine understandable
       Taxonomies of words shared within web
        communities
        –   no single ontology
       RDF: meta-tags link XML tags to their roles
       US and European buy-in
        –   Where‟s Canada
       Aligns with IIT Fredericton‟s thrusts
        –   multi-agent, security, OneWeb, voice
7                     CS6795 Semantic Web Techniques       22-Sep-06
    Overview and Course Mindmap

       Increasing demand for
        formalized knowledge                            Namespaces
        on the Web: AI’s                                               CSS
        chance!                                DTDs/
                                               XSDs                           XSLT
       XML- & RDF-based           OWL DL                  Stylesheets
        markup languages
                                  Semantic    Services/
        provide a 'universal'     Matchers
        storage/interchange                   Agents                 Transformations
        format for such Web-
        distributed knowledge
                                    RuleML
                                                Rules
                                                         XML                     XPath
        representation                  RIF                          Queries     XQuery
       Course introduces
        knowledge markup &             SHOE
        resource semantics:                    Frames RDF[S] Acquisition
        we show how to marry
        AI representations (e.g.,
        logics and frames) with             TopicMaps
        XML & RDF [incl. RDF                                           Information
        Schema]                                            Protégé     Extraction


8                      CS6795 Semantic Web Techniques                       22-Sep-06
     The Semantic Web Activity
     of the W3C

    “The Semantic Web is a vision: the idea of having
    data on the Web defined and linked in a way that
    it can be used by machines not just for display purposes,
    but for
    • automation,
    • integration and
    • reuse of data across various applications.”

    (http://www.w3.org/2001/sw/Activity)

9                CS6795 Semantic Web Techniques      22-Sep-06
     What your computer sees in HTML

       <b>Joe‟s Computer Store
                                                  Presentation
       </b>
                                                   information
       <br>
       365 Yearly Drive

     What your computer sees in XML
       <location>
       <name>Joe’s Computer Store
       </name>                                     Content
       <address> 365 Yearly Drive                    description
       </address>
                                                   (less ambiguous)
       </location>
10               CS6795 Semantic Web Techniques                  22-Sep-06
     What a computer could understand

     <mail:address xmlns:mail=“http://www.canadapost.ca”>
       <mail:name>Joe‟s Computer Store </mail:name>
       <mail:street> 365 Yearly Drive </mail:street>
     </mail:address>

      www.canadapost.ca could define address, name, street, …
      Search engines could then identify mail addresses
      Consider shopbots being able to find
         –   price, quantity, feature, model number, supplier, serial number,
             acquisition date
        Assumes that namespaces will be used consistently


11                      CS6795 Semantic Web Techniques                 22-Sep-06
     Semantic Web

      Semantics = meaning
      Good Idea: Dictionary
       –   Create a dictionary of terms
       –   Put it on the web
       –   Mark up web pages so that terms are linked to these
           dictionary-entries
       –   This allow more precise matching
      Better   idea: Thesaurus
       –   has hierarchies of terms
       –   shades of meaning
      Best   idea: Ontology
       –   hierarchy of terms and logic conditions

12                   CS6795 Semantic Web Techniques          22-Sep-06
         Semantic Web

      An agent-enabled resource
      “information in machine-readable form, creating a
       revolution in new applications, environments and B2B
       commerce”
      W3C Activity launched Feb 9, 2001
      DAML: DARPA Agent Markup Language
         –   US Gov funding to define languages, tools
         –   16 project teams
        OIL is Ontology Inference Layer
         –   DAML+OIL is joint DARPA-EU
        Knowledge Representation is a natural choice


13                       CS6795 Semantic Web Techniques       22-Sep-06
14   CS6795 Semantic Web Techniques   22-Sep-06
     •SmokedSalmon is the intersection
     of Smoked and Salmon




                                                    Smoked Salmon




15                 CS6795 Semantic Web Techniques             22-Sep-06
     •SmokedSalmon is the intersection
     of Smoked and Salmon




                                                        Smoked Salmon


     •Gravalax is the intersection of
     Cured and Salmon, but not
     Smoked




                                           Gravalax




16                     CS6795 Semantic Web Techniques             22-Sep-06
     •SmokedSalmon is the intersection
     of Smoked and Salmon




                                                        Smoked Salmon


     •Gravalax is the intersection of
     Cured and Salmon, but not
     Smoked


                                                                     Lox
     •Lox is Smoked, Cured Salmon          Gravalax




17                     CS6795 Semantic Web Techniques             22-Sep-06
         The Semantic Web is about having the Internet use
         common sense.



        A search for keywords
                                                         Smoked Salmon
         Salmon and Cured
         should return pages that
         mention Gravalax, even if
         they don‟t mention
         Salmon and Cured

        A search for Salmon and
                                                                      Lox
         Smoked will return                   Gravalax
         smoked salmon, should
         also return Lox, but not
         Gravalax


18                     CS6795 Semantic Web Techniques              22-Sep-06
     OWL


                                            Smoked Salmon




                                                         Lox
                               Gravalax




19         CS6795 Semantic Web Techniques             22-Sep-06
     Tim Berners- Lee’s Semantic Web




20           CS6795 Semantic Web Techniques   22-Sep-06
     RDF Resource Description Framework

        Beginning of Knowledge Representation influence
         on Web
        Akin to Frames, Entity/Relationship diagrams, or
         Object/Attribute/Value triples




21                 CS6795 Semantic Web Techniques   22-Sep-06
     RDF Example

     <rdf:ProductSpecs about=
        “http://www.lemoncomputers.ca/model_2300”>
     <specs:colour>yellow</specs:colour>
     <specs:size>medium</specs:size>
     </rdf:ProductSpecs>

                                       model_2300

                                size                colour

                              medium             yellow




22              CS6795 Semantic Web Techniques               22-Sep-06
     RDF Class Hierarchy

        All lemon laptops get
         packed in cardboard
         boxes
        Allows one to
         customize existing                is_a
         taxonomies
                                   lemon_palmtop_
         –   Example: palmtop          20000
             computers still get
             packed in boxes                           model_2300

                                                       size          colour

                                                    medium          yellow



23                    CS6795 Semantic Web Techniques                          22-Sep-06
     Tim Berners- Lee’s Semantic Web




24           CS6795 Semantic Web Techniques   22-Sep-06
         Ontology Web Language: W3C


        Previously known as DAML+OIL
          –   US: DARPA Agent Markup Language
          –   EU: Ontology Interchange Layer (Language)


        Composed of a hierarchy with additional conditions

        Based on Description logic, limited expressivenss
          –   Reasoning procedures are well-behaved
          –   Just enough power




25                      CS6795 Semantic Web Techniques        22-Sep-06
     Identifying Resources

        URL/URI
         –   Uniform resource locator / identifier
         –   Information sources, goods and services
         –   financial instruments
                 money, options, investments, stocks, etc.
        “Where do you want to go today?”
         –   becomes “What do you want to find?”




26                      CS6795 Semantic Web Techniques        22-Sep-06
     Ontology


        Branch of philosophy dealing with the theory of being
        Tarski‟s assumption:
         –   individuals, relationships and functions
        “A common vocabulary and agreed-upon meanings to
         describe a subject domain”
         –   What real-world objects do my tags refer to?
         –   How are these objects related?
        Communication requires shared terms
         –   others can join in




27                      CS6795 Semantic Web Techniques           22-Sep-06
     Ontology Layer

        Widens interoperability and interconversion
         –   knowledge representation
        More meta-information
         –   Which attributes are transitive, symmetric
         –   Which relations between individuals are 1-1,
             1-many, many-many
        Communities exist
         –   DL, OIL, SHOE (Hendler)
         –   New W3C working group




28                    CS6795 Semantic Web Techniques        22-Sep-06
     Transitive, Subrole example

        One wants to ask about modes of transportation
         from Sydney to Fredericton
        “connected by Acadian Lines bus” is a role in a
         Nova Scotia taxonomy
        “connected by SMT bus” from New Brunswick
        Both are subroles of “connected”
        “connected” is transitive
        Note that ontologies can be combined at runtime



29                 CS6795 Semantic Web Techniques   22-Sep-06
     Combining Rich Ontologies


                                                        Amherst
        Only these facts are
         explicit                        Connected by Acadian Lines

         –   in separate ontologies
                                                                         Amherst
        “Connected by bus”                       Truro


         –   is superset                                          Connected by SMT Lines
                                   Connected by Acadian Lines
         –   is symmetric and
             transitive                     Sydney                Sussex

        Route from Sydney to
                                                             Connected by SMT Lines
         Fredericton is inferred
                                                           Fredericton

30                     CS6795 Semantic Web Techniques                          22-Sep-06
     Tim Berners- Lee’s Semantic Web




31           CS6795 Semantic Web Techniques   22-Sep-06
     Logic Layer



        Clausal logic encoded in XML
         –   RuleML, IBM CommonRules
        Special cases of first-order logic
         –   Horn Clauses for if-then type reasoning and integrity
             constraints
        Standard inference rules based on Resolution
         –   Various implementations: SQL, KIF, SLD (Prolog), XSB
         –   J-DREW reasoning tools in Java.
        Modus operandi: build tractable reasoning systems
         –   trade away expressiveness, gain efficiency


32                       CS6795 Semantic Web Techniques              22-Sep-06
         Logic Architecture Example


        Contracting parties integrate e-businesses via rules
         Seller E-Storefront                              Buyer’s ShopBot


             Business                                        Business
             Rules                  Contract Rules
                                                             Rules
                                    Interchange

               OPS5
                                                                Prolog




33                       CS6795 Semantic Web Techniques                     22-Sep-06
     Negotiation via rules

     usualPrice:
     price(per-unit, ?PO, $60) 
       purchaseOrder(?PO, supplierCo, ?AnyBuyer) 
       shippingDate(?PO, ?D) (?D  24April2001).

     volumeDiscountPrice:
     price(per-unit, ?PO, $55) 
       purchaseOrder(?PO, supplierCo, ?AnyBuyer) 
       quantityOrdered(?PO, ?Q) (?Q  1000) 
       shippingDate(?PO, ?D) (?D  24April2001).


     overrides(volumeDiscount, usualPrice).

34                 CS6795 Semantic Web Techniques    22-Sep-06
     Hot Research Topics:

        Tools to create ontologies
         –   Ontolingua
         –   Protégé-2000 (Stanford)
         –   OILED
         –   …
        Tools to learn ontologies from a large corpus such
         as corporate data
         –   Merging / aligning two different ontologies from different
             sources on the same topic
        Searching cum reasoning tools
         –   SHOE

35                    CS6795 Semantic Web Techniques             22-Sep-06
     Eventual Goal of these Efforts

        Agents locate goods, services
         –   use ontologies
         –   unambiguous
         –   business rules
         –   expressive language but reasoning tractable
         –   combine from various sources
        Gives rise to need of trust, privacy and security
         –   e.g. semantic web project to determine eligibility of
             patients for a clinical trial




36                    CS6795 Semantic Web Techniques             22-Sep-06
     Extensible Markup Language




37           CS6795 Semantic Web Techniques   22-Sep-06
     General Advantages of XML for KR

      XML offers new general possibilities, from which
      AI knowledge representation (KR) can profit:

      (1) Definition of self-describing data in worldwide
          standardized, non-proprietary format

      (2) Structured data and knowledge exchange for
          enterprises in various industries

      (3) Integration of information from different sources
          (into uniform documents)

38                CS6795 Semantic Web Techniques            22-Sep-06
     Specific Advantages of XML for KR

      XML provides the most suitable infrastructure for
      knowledge bases on the Web (incl. for W3C languages
      such as RDF)

      Additional special KR uses of XML are:
      • Uniform storage of knowledge bases
      • Interchange of knowledge bases between
        different AI languages
      • Exchange between knowledge bases and
        databases, application systems, etc.
      Even transformation/compilation of AI source programs
      using XML markup and annotations is possible
39               CS6795 Semantic Web Techniques      22-Sep-06
     Address Example: External to HTML


       External Presentation:
          Xaver M. Linde
          Wikingerufer 7
          10555 Berlin                             HTML tags are still
                                                   presentation-oriented
       HTML Markup:
          <em>Xaver M. Linde</em>
          <br>
          Wikingerufer 7
          <br>
          <strong>10555 Berlin</strong>
40                CS6795 Semantic Web Techniques                 22-Sep-06
     Address Example: HTML to XML


      HTML Markup:                                While not conveying
        <em>Xaver M. Linde</em>                   any formal semantics:
        <br>
        Wikingerufer 7                  XML tags are chosen for
        <br>                            content-structuring needs
        <strong>10555 Berlin</strong>
      XML Markup:
        <address>
          <name>Xaver M. Linde</name>
          <street>Wikingerufer 7</street>
          <town>10555 Berlin</town>
        </address>
41               CS6795 Semantic Web Techniques                22-Sep-06
     Address Example: XML to External


      XML Markup:
        <address>
          <name>Xaver M. Linde</name>
          <street>Wikingerufer 7</street>
          <town>10555 Berlin</town>
        </address>           XML stylesheets are,
                              e.g., usable to generate
      External Presentations: different presentations
         Xaver M. Linde                          Xaver M. Linde
         Wikingerufer 7                          Wikingerufer 7
         10555 Berlin              ...           10555 Berlin
42                CS6795 Semantic Web Techniques          22-Sep-06
     Address Example: XML to XML


      XML Markup 1:
        <address>
          <name>Xaver M. Linde</name>
          <street>Wikingerufer 7</street>
          <town>10555 Berlin</town>
        </address>                                  XML stylesheets are
      XML Markup 2:                                 also usable to transform
       <address>                                    XML representations
         <name>Xaver M. Linde</name>
         <place>
           <street>Wikingerufer 7</street>
           <town>10555 Berlin</town>
         </place>
       </address>
43                 CS6795 Semantic Web Techniques                     22-Sep-06
     Address Example: Some Stylesheets Will
     Contain Term-(Tree-)Rewriting Rules

                            address


         name                 street                     town

          N                     S                         T


                             address


         name                                    place

          N                              street          town

                                           S               T
44              CS6795 Semantic Web Techniques                  22-Sep-06
     Address Example: XML Queries

      XML Markup:
      e   <address>    subelementss
      l
      e     <name>Xaver M. Linde</name>
      m     <street>Wikingerufer 7</street>
      e     <town>10555 Berlin</town>
      n
      t   </address>

      XML Query (XML-QL):
      WHERE
       <address>
         <name>Xaver M. Linde</name>
         <street>$s</street>
         <town>$t</town> XML queries can
       </address>
      CONSTRUCT              select subelements
       <binding>             of XML elements           <binding>
         <s>$s</s>                                       <s>Wikingerufer 7</s>
         <t>$t</t>                                       <t>10555 Berlin</t>
       </binding>                                      </binding>
45                    CS6795 Semantic Web Techniques                22-Sep-06
     Address Example: Prolog Queries


      Prolog Term:
      s   address( substructuress
      t
      r     name("Xaver M. Linde"),
      u
      c     street("Wikingerufer 7"),
      t
      u     town("10555 Berlin")
      r
      e   )

      Prolog Query:
          address(                         Prolog queries can
            name("Xaver M. Linde"),        select substructures
            street(S),
                                           of Prolog structures
            town(T)
          )                                               S = "Wikingerufer 7"
                                                          T = "10555 Berlin"
46                   CS6795 Semantic Web Techniques                 22-Sep-06
     Address Example: The Element Tree


     XML Markup:                                 Prolog Term:
     e   <address>    subelements
                              s
                                                  s    address( substructuress
     l                                            t
     e     <name>Xaver M. Linde</name>            r      name("Xaver M. Linde"),
                                                  u
     m     <street>Wikingerufer 7</street>        c      street("Wikingerufer 7"),
     e                                            t
     n
           <town>10555 Berlin</town>              u      town("10555 Berlin")
                                                  r
     t   </address>                               e    )
     Node-Labeled, (Left-to-Right-)Ordered Element Tree:
                                      tree
                                    address

     s
     u
     b
     t
               name                  street                    town
     r
     e
     e
     s    Xaver M. Linde          Wikingerufer 7           10555 Berlin
47                    CS6795 Semantic Web Techniques                       22-Sep-06
      Address Example:
      Document Type Definition and Tree (1)

     Document Type Definition (DTD):            Extended Backus-Naur Form (EBNF):

     <!ELEMENT address     (name, street, town) >     address ::= name street town
     <!ELEMENT name        (#PCDATA) >                name ::= PCDATA
     <!ELEMENT street      (#PCDATA) >                street ::= PCDATA
     <!ELEMENT town        (#PCDATA) >                town ::= PCDATA

     Document Type Tree:
                           address


         name               street                    town

       PCDATA              PCDATA                    PCDATA
48                  CS6795 Semantic Web Techniques                     22-Sep-06
     Address Example:
     Document Type Definition and Tree (2)
     Document Type Definition (DTD):
       <!ELEMENT address       (name, place) >
       <!ELEMENT place         (street, town) >
       <!ELEMENT name          (#PCDATA) >
       <!ELEMENT street        (#PCDATA) >
       <!ELEMENT town          (#PCDATA) >
     Document Type Tree:
                         address


        name                               place

      PCDATA                         street         town

                                   PCDATA          PCDATA
49                CS6795 Semantic Web Techniques            22-Sep-06
     Well-Formedness and Validity

     XML principles for a                    XML principle for
     document being well-                    a document being valid
     formed:                                 with respect to (w.r.t.) a DTD :
        Open and close all tags                Match the constraints listed
        Empty tags end with />                  in the DTD (or, generate
        There is a unique root                  from DTD as linearized
         element                                 derivation tree, as shown
        Elements may not overlap                later)
        Attribute values are quoted
        < and & are only used to
                                                                 Checked by
         start tags and entities                          validators such as
        Only the five predefined                http://www.stg.brown.edu/s
         entity references are used                         ervice/xmlvalid/
50                   CS6795 Semantic Web Techniques                   22-Sep-06
     Mail-Box Example: Address Variant


     XML Markup:                               Prolog Term:
       <address>                                     address(
         <name>Xaver M. Linde</name>                   name("Xaver M. Linde"),
         <box>2001</box>                               box("2001"),
         <town>10555 Berlin</town>                     town("10555 Berlin")
       </address>                                    )
     Node-Labeled, (Left-to-Right-)Ordered Element Tree:

                                  address


             name                   box                     town

         Xaver M. Linde            2001                  10555 Berlin
51                  CS6795 Semantic Web Techniques                      22-Sep-06
     "|"-Disjoined Street/Mail-Box Example:
     Document Type Definition and Tree

     Document Type Definition (DTD):
     <!ELEMENT address       (name, (street | box), town) >
     <!ELEMENT name          (#PCDATA) >
     <!ELEMENT street        (#PCDATA) >
     <!ELEMENT box           (#PCDATA) >             "|": Choice
     <!ELEMENT town          (#PCDATA) >             The above box address
                                                    and the original street
     Document Type Tree:                            address are valid w.r.t.
                         address                    this "|"-DTD

        name        street         box              town

     PCDATA       PCDATA        PCDATA             PCDATA
52                CS6795 Semantic Web Techniques                    22-Sep-06
      Phone & Fax Example: Address Variant

       XML Markup:                                  Prolog Term:
          <address>                                      address(
            <name>Xaver M. Linde</name>                    name("Xaver M. Linde"),
            <street>Wikingerufer 7</street>                street("Wikingerufer 7"),
            <town>10555 Berlin</town>                      town("10555 Berlin"),
            <phone>030/1234567</phone>                     phone("030/1234567"),
            <phone>030/1234568</phone>                     phone("030/1234568"),
            <fax>030/1234569</fax>                         fax("030/1234569")
          </address>                                     )
       Node-Labeled, (Left-to-Right-)Ordered Element Tree:
                                      address


          name        street         town          phone        phone          fax

     Xaver M. Linde Wikingerufer 7 10555 Berlin 030/1234567 030/1234568 030/1234569
53                      CS6795 Semantic Web Techniques                      22-Sep-06
     "+"/"*"-Repetitive-Phone & -Fax Example:
     Document Type Definition and Tree
     Document Type Definition (DTD):
     <!ELEMENT address       (name, street, town, phone+, fax*) >
     <!ELEMENT name          (#PCDATA) >
     <!ELEMENT street        (#PCDATA) > "+"/"*": One/Zero or More
     <!ELEMENT town          (#PCDATA) > The above two-phone/one-fax
     <!ELEMENT phone         (#PCDATA) > address is valid w.r.t. this
     <!ELEMENT fax           (#PCDATA) >
                                                "+"/"*"-DTD but the
     Document Type Tree:                        original no-phone/no-fax
                             address            address is not (1 phone!)

         name       street              town          phone       fax

       PCDATA      PCDATA              PCDATA       PCDATA      PCDATA
54                 CS6795 Semantic Web Techniques                       22-Sep-06
     Country Example: Address Variant

     XML Markup:                                  Prolog Term:
        <address>                                     address(
          <name>Xaver M. Linde</name>                   name("Xaver M. Linde"),
          <street>Wikingerufer 7</street>               street("Wikingerufer 7"),
          <town>10555 Berlin</town>                     town("10555 Berlin"),
          <country>Germany</country>                    country("Germany")
        </address>                                    )

     Node-Labeled, (Left-to-Right-)Ordered Element Tree:
                                   address


           name               street                  town            country

      Xaver M. Linde       Wikingerufer 7        10555 Berlin        Germany
55                   CS6795 Semantic Web Techniques                       22-Sep-06
     "?"-Optional-Country Example:
     Document Type Definition and Tree

     Document Type Definition (DTD):
     <!ELEMENT address       (name, street, town, country?) >
     <!ELEMENT name          (#PCDATA) >
     <!ELEMENT street        (#PCDATA) >            "?": One or Zero
     <!ELEMENT town          (#PCDATA) >            The above country
     <!ELEMENT country       (#PCDATA) >            address and the
                                                     original countriless
     Document Type Tree:                             address are valid w.r.t.
                           address                   this "?"-DTD

        name             street               town             country

      PCDATA          PCDATA                PCDATA             PCDATA
56                 CS6795 Semantic Web Techniques                    22-Sep-06
     Country Address: A Complete XML
     Document Referring to an External DTD
     XML Document (just ASCII, e.g. stored in a file):
      <?xml version="1.0" standalone="no"?>
      <!DOCTYPE address SYSTEM "country-address.dtd">
      <address>
        <name>Xaver M. Linde</name>
        <street>Wikingerufer 7</street>
        <town>10555 Berlin</town>
        <country>Germany</country>
      </address>
     The XML declaration uses standalone attribute with "no" value: DTD import
     The DOCument TYPE declaration names the root element address and, after
     the SYSTEM keyword, refers to an external DTD "country-address.dtd"
     (or, at some absolute URL, to an "http://www.test.org/country-address.dtd")
57                   CS6795 Semantic Web Techniques                   22-Sep-06
     "minOccurs"-Optional-Country Example:
     XML Schema Definition

     Equivalent XML Schema Definition (XSD):
     <?xml version="1.0"?>
     <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:element name="address">
       <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="name" type="xsd:string"/>
          <xsd:element name="street" type="xsd:string"/>
          <xsd:element name="town" type="xsd:string"/>
          <xsd:element name="country" type="xsd:string" minOccurs="0"/>
        </xsd:sequence>
       </xsd:complexType>
      </xsd:element>
     </xsd:schema>

58                   CS6795 Semantic Web Techniques                22-Sep-06
     "minOccurs"-Optional-Country Example:
     XML Schema Tree

     Equivalent Document Schema Tree:
                          address


         name           street                town       country

      xsd:string      xsd:string            xsd:string   xsd:string




59                 CS6795 Semantic Web Techniques              22-Sep-06
     Country Address: A Complete XML
     Document Referring to an External XSD
     Equivalent XML Document (just ASCII, e.g. stored in a file):
      <?xml version="1.0"?>
      <address
        xsi:noNamespaceSchemaLocation="country-address.xsd"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      >
        <name>Xaver M. Linde</name>
        <street>Wikingerufer 7</street>
        <town>10555 Berlin</town>
        <country>Germany</country>
      </address>
     The xsi:noNamespaceSchemaLocation attribute is embedded in the root
     element address and refers to an external XSD "country-address.xsd"
     (or, at some absolute URL, to an "http://www.test.org/country-address.xsd")
60                   CS6795 Semantic Web Techniques                    22-Sep-06
     Horn Logic Markup Languages




61           CS6795 Semantic Web Techniques   22-Sep-06
     Herbrand Terms: Individual Constants,
     Variables, Flat Ground Structures, ...
         Representation of Herbrand terms in XML as <ind> and
         <struc> elements (<var> similar):
        Individual constant for channel-tunnel between Britain and
         France: element <ind>channel-tunnel</ind>

        Ground structure
         undersea-connection(britain,france)

         is <struc> element with embedded element for constructor,
         followed by elements for argument terms:
          <struc>
            <constructor>undersea-connection</constructor>
            <ind>britain</ind>
            <ind>france</ind>
          </struc>
62                    CS6795 Semantic Web Techniques           22-Sep-06
      Herbrand Terms: ...,
      Nested Ground Structures
                           <struc>
     Embedded <struc> <constructor>service-tunnel</constructor>
     elements:               <struc>
                              <constructor>undersea-connection</constructor>
     service-tunnel(          <ind>britain</ind>
       undersea-connection( <struc>
                                <constructor>surrounded-country</constructor>
        britain,                <ind>belgium</ind>
        surrounded-country( <ind>luxembourg</ind>
         belgium,               <ind>germany</ind>
         luxembourg,            <ind>switzerland</ind>
         germany,               <ind>italy</ind>
                                <ind>spain</ind>
         switzerland,         </struc>
         italy,              </struc>
         spain)))          </struc>
63                    CS6795 Semantic Web Techniques               22-Sep-06
     Interim Discussion: Tag and Type


        In Prolog not clear, in isolation, that channel-tunnel is
         individual constant, whereas service-tunnel is constructor

        In XML, as in strongly typed LP languages, made explicit -
         however at every occurrence of a symbol

        Example gives impression of self-description advantage - but
         also „space requirement‟ - of this generous application of
         “syntactic sugar”




64                   CS6795 Semantic Web Techniques            22-Sep-06
     Horn Clauses: Relation Symbol
     Applications

     Predicate or relation symbol in XML is <relator> element.
     For example, relation symbol travel is
     <relator>travel</relator>

     Relation symbol application to terms is labeled with
     <relationship> element.
     Application travel(john,channel-tunnel)
     on two individual constants thus is

     <relationship>
       <relator>travel</relator>
       <ind>john</ind>
       <ind>channel-tunnel</ind>
     </relationship>
65                  CS6795 Semantic Web Techniques          22-Sep-06
     Horn Clauses: Facts

     Hence, Horn fact can be asserted as <hn> element that
     possesses <relationship> elements as subelements
     In the example, the Prolog fact
     travel(john,channel-tunnel).
     becomes
     <hn>
       <relationship>
         <relator>travel</relator>
         <ind>john</ind>
         <ind>channel-tunnel</ind>
       </relationship>
66   </hn>           CS6795 Semantic Web Techniques          22-Sep-06
     Horn Clauses: Rules

     Then, Horn rule is asserted as <hn> Element that has a
     head <relationship> element followed by at least one
     body <relationship> element
     So, above example generalized to Prolog rule
     travel(Someone,channel-tunnel) :- carry(eurostar,Someone).
                            and rewritten as
     <hn>
       <relationship>
        <relator>travel</relator>
        <var>someone</var>
        <ind>channel-tunnel</ind>
       </relationship>
       <relationship>
        <relator>carry</relator>
        <ind>eurostar</ind>
        <var>someone</var>
       </relationship>
67   </hn>
                   CS6795 Semantic Web Techniques             22-Sep-06
     Attributes for Extended Logics

     Nested elements - trees - allow representation of
     arbitrary information, but in some situations lead
     to unnecessarily deeply/widely nested representations
     Therefore XML attributes:
     Start-Tag is „attributed‟ with n attribute-value pairs ai=vi
     Element: <tag a1=v1 ... an=vn> . . . </tag>
     Helpful Prolog uses of XML attributes are arity labelings of
     relation symbols such as our binary relation symbol travel:
     Prolog‟s travel/2 in XML with an arity attribute becomes
     <relator arity="2">travel</relator>
     Analogously, annotations become possible on arbitrary
     element levels: mode declarations for logic variables,
     determinism specifications for clauses or procedures,
     and context conditions for entire knowledge bases
68                   CS6795 Semantic Web Techniques                 22-Sep-06
     ID and IDREF

     Attribute types ID and IDREF for naming and
     referencing of elements

     ID-typed value must uniquely identify an element
     and IDREF-typed value must occur as ID value of
     an element

     E.g., clause can be named (in a hypothesis knowledge base):

     <hn id="john-channel">
       <relationship>
        <relator>travel</relator>
        <ind>john</ind>
        <ind>channel-tunnel</ind>
       </relationship>
     </hn>
69                   CS6795 Semantic Web Techniques                22-Sep-06
     ID and IDREF

     Now a “modal Prolog fact”
     belief(mary,travel(john,channel-tunnel)).
     can access the "john-channel" assertion:
     <hn>
       <relationship>
        <relator>belief</relator>
        <ind>mary</ind>
        <prop idref="john-channel"/>
       </relationship>
     </hn>
     Propositional argument of the belief operator written as
     <prop idref="john-channel"/> (XML abbreviation of
     empty elements <tag ...> </tag> to <tag .../>)
     Also disbelief fact has "john-channel" access with
     idref: ID/IDREF “break out of the tree” and enable
70   „sharing‟       CS6795 Semantic Web Techniques             22-Sep-06
     DTDs: Elements as Derivation Trees

     Up to now:     Examples for Horn Logic in XML etc.
     Now:           General language definition
     XML's Document type definitions (DTDs) initially only as
     ELEMENT declarations for non-attributed elements
     For nonterminals: DTD  ordinary context-free grammar
     in modified (EBNF) notation
     For terminals: Usually arbitrary permutations of the base
     alphabet ("PCDATA'') instead of fixed terminal sequences
     DTD grammar derives context-free word patterns:
     derivation trees themselves - linearized through brackets -
     as generated result
     XML element is valid with respect to DTD:
     can be generated from DTD as linearized derivation tree
71                  CS6795 Semantic Web Techniques             22-Sep-06
     DTDs: Defining Horn Logic in XML

     Syntactic ELEMENT declaration of Horn logic as a
     knowledge base (kb) of zero or more Horn clauses (hn*):
     <!ELEMENT kb                  (hn*) >
     <!ELEMENT hn                  (relationship, relationship*) >
     <!ELEMENT relationship (relator, (ind | var | struc)*) >
     <!ELEMENT struc               (constructor, (ind | var | struc)*) >
     <!ELEMENT relator             (#PCDATA) >
                                                         Note   struc recursion!
     <!ELEMENT constructor (#PCDATA) >
     <!ELEMENT ind                 (#PCDATA) >
     <!ELEMENT var                 (#PCDATA) >
72                  CS6795 Semantic Web Techniques                    22-Sep-06
     DTDs:
     Generation of the Example Rule (1)
     (Start-)symbol kb brackets derived clause(s) as linearized
     start-tag/end-tag-tree representation <kb> . . . </kb>:
     kb

     <kb> hn* </kb>
     . . .
     <kb> <hn> relationship relationship </hn> </kb>
     . . .
     <kb>
      <hn>
       <relationship>
       <relator>#PCDATA</relator> <var>#PCDATA</var> <ind>#PCDATA</ind>
       </relationship>
       <relationship>
       <relator>#PCDATA</relator> <ind>#PCDATA</ind> <var>#PCDATA</var>
       </relationship>
      </hn>
     </kb>
73                   CS6795 Semantic Web Techniques                22-Sep-06
     DTDs:
     Generation of the Example Rule (2)
     <kb>
      <hn>
        <relationship>
         <relator>travel</relator>
         <var>someone</var>
         <ind>channel-tunnel</ind>
        </relationship>
        <relationship>
         <relator>carry</relator>
         <ind>eurostar</ind>
         <var>someone</var>
        </relationship>
      </hn>
74   </kb>          CS6795 Semantic Web Techniques   22-Sep-06
     Attribute DTDs (1)


     DTDs for attributed elements: ATTLIST declarations, which
     associate element name with an attribute name plus attribute type
     and possible occurrence indication

     1st Example: declare the relator attribute arity as CDATA-typed
     (cf. #PCDATA) and occurring optionally (#IMPLIED):
     <!ATTLIST relator arity CDATA #IMPLIED >

     2nd Example (Preparation): define the extended Horn logic
     with (named hn clauses and) embedded propositions:
     <!ELEMENT relationship (relator, (ind|var|struc|prop)*) >
     <!ELEMENT prop EMPTY >
75                  CS6795 Semantic Web Techniques            22-Sep-06
     Attribute DTDs (2)


     2nd Example (Execution): Append an ATTLIST declaration that
     specifies, for the hn respectively prop elements, the attributes
     id - as optional ID type - respectively
     idref - as mandatory IDREF type:

     <!ATTLIST hn          id      ID         #IMPLIED >

     <!ATTLIST prop        idref IDREF #REQUIRED >

     With entire DTD now, e.g., earlier "john-channel"-named fact and
     its accessing facts can be generated


76                  CS6795 Semantic Web Techniques          22-Sep-06
     Horn Queries in XML Notation

     Assume fact:
     <hn>
       <relationship>
         <relator>carry</relator>
         <ind>eurostar</ind>           carry(eurostar,fred).
         <ind>fred</ind>
       </relationship>
     </hn>
     A Horn-logic interpreter can use it to answer this query:
     <relationship>
       <relator>carry</relator>
       <ind>eurostar</ind>             carry(eurostar,Someone)
       <var>someone</var>
     </relationship>
     by binding
     <var>someone</var>                Someone
     to
     <ind>fred</ind>                   fred
77                  CS6795 Semantic Web Techniques           22-Sep-06
     Horn Inferences in XML Notation (1)

     With carry basis fact
                                              carry(eurostar,fred).
     a rule is usable to dynamically derive travel assertions as
     needed, without having to store them all-inclusively and
     statically:
     travel(Someone,channel-tunnel) :- carry(eurostar,Someone).
     That is, its earlier XML version is useable by a Horn-logic
     interpreter for inferential queries like
                     Someone=fred
     travel(fred,Where)  carry(eurostar,Someone)  true
                     Where=channel-tunnel              Where=channel-tunnel

78                  CS6795 Semantic Web Techniques                     22-Sep-06
     Horn Inferences in XML Notation (2)

     Rule:                                        Fact:
     <hn>                                         <hn>
       <relationship>                               <relationship>
        <relator>travel</relator>                     <relator>carry</relator>
        <var>someone</var>                            <ind>eurostar</ind>
        <ind>channel-tunnel</ind>                     <ind>fred</ind>
       </relationship>                              </relationship>
       <relationship>                             </hn>
        <relator>carry</relator>
        <ind>eurostar</ind>
        <var>someone</var>
       </relationship>
     </hn>
                                    3-Step Animation:
     <relationship>
     <relationship someone="fred" where="channel-tunnel">
     <ind where="channel-tunnel">
        <relator>travel</relator>
        <relator>carry</relator>
       true
        <ind>fred</ind>
        <ind>eurostar</ind>
     </ind>
        <var>where</var>
        <var>someone</var>
     </relationship>
79                       CS6795 Semantic Web Techniques                          22-Sep-06
     Horn Inferences in XML Notation (2)

     Rule:                                        Fact:
     <hn>                                         <hn>
       <relationship>                               <relationship>
        <relator>travel</relator>                     <relator>carry</relator>
        <var>someone</var>                            <ind>eurostar</ind>
        <ind>channel-tunnel</ind>                     <ind>fred</ind>
       </relationship>                              </relationship>
       <relationship>                             </hn>
        <relator>carry</relator>
        <ind>eurostar</ind>
        <var>someone</var>
       </relationship>
     </hn>
                                    3-Step Animation:
     <relationship>
       <relator>travel</relator>
       <ind>fred</ind>
       <var>where</var>
     </relationship>
80                       CS6795 Semantic Web Techniques                          22-Sep-06
     Horn Inferences in XML Notation (2)

     Rule:                                        Fact:
     <hn>                                         <hn>
       <relationship>                               <relationship>
        <relator>travel</relator>                     <relator>carry</relator>
        <var>someone</var>                            <ind>eurostar</ind>
        <ind>channel-tunnel</ind>                     <ind>fred</ind>
       </relationship>                              </relationship>
       <relationship>                             </hn>
        <relator>carry</relator>
        <ind>eurostar</ind>
        <var>someone</var>
       </relationship>
     </hn>
                                    3-Step Animation:
      <relationship someone="fred" where="channel-tunnel">
        <relator>carry</relator>
        <ind>eurostar</ind>
        <var>someone</var>
      </relationship>
81                       CS6795 Semantic Web Techniques                          22-Sep-06
     Horn Inferences in XML Notation (2)

     Rule:                                        Fact:
     <hn>                                         <hn>
       <relationship>                               <relationship>
        <relator>travel</relator>                     <relator>carry</relator>
        <var>someone</var>                            <ind>eurostar</ind>
        <ind>channel-tunnel</ind>                     <ind>fred</ind>
       </relationship>                              </relationship>
       <relationship>                             </hn>
        <relator>carry</relator>
        <ind>eurostar</ind>
        <var>someone</var>
       </relationship>
     </hn>
                                    3-Step Animation:

     <ind where="channel-tunnel">
       true
     </ind>

82                       CS6795 Semantic Web Techniques                          22-Sep-06
     Horn Inferences: SLD-Resolution,
     XML-QL Implementation, Open World


     • This inference is carried out as an SLD-resolution step

     • The procedural semantics of SLD-resolution can be used

     • An XML-QL implementation seems possible as for queries

     • A functional-logic generalization of HornML is RFML

     If distribution of the clauses over different documents in the
     Web is assumed, in this “open world” logical completeness,
     in particular, can hardly still be asked for

83                 CS6795 Semantic Web Techniques                22-Sep-06
     The Java Deductive Reasoning Engine
     for the Web




84           CS6795 Semantic Web Techniques   22-Sep-06
     Train people to build the Rule-based
     web services


        Courses on systems employing rule engines
         and Internet applications
         –   Writing deduction engines in Java/C/C++
         –   Interfacing with Internet API
         –   Old techniques (Prolog 30 years ago)
         –   New techniques from CADE System Competition
        Meier and Warren‟s book: Programming in
         Logic, 1988
         –   Updated in Java?
         –   Specific to Prolog at low level
85                     CS6795 Semantic Web Techniques      22-Sep-06
     Will such a course work?

      No
       –   Guts of Prolog, Internet API‟s, how to program in logic
       –   At least three courses here
      Yes
       –   Students understand recursion
       –   How to build a tree
           how to search a space
               Propositional theorem prover
       –   how to interface to Internet




86                      CS6795 Semantic Web Techniques         22-Sep-06
     This talk

      Architecture     for building deduction systems
       –   first order
       –   easily configured
              forward or backward
       –   embedded
       –   supports calls to and from rest of system
      Tour    of internals
       –   backward & forward engines
       –   tree/proof
       –   terms
       –   bindings
       –   discrimination tree
      Prototypes
87                     CS6795 Semantic Web Techniques    22-Sep-06
     Choose the right abstractions


        Goal, Unifier, ProofTree
        use Java iterators: pay as you go
         –   for finding the next proof
        Make every Goal responsible for its list of
         matching clauses
         –   hasNextMatchingClause()
         –   attachNextMatchingClause()
        Place Goals in stack of backtrack points
         –   popped in reverse chronological order


88                     CS6795 Semantic Web Techniques   22-Sep-06
         Propositional Prover

initially proofTree has an open Goal                chronologicalBacktrack
loop                                                    while(choicePoints.nonEmpty())
   if(proofTree.hasNoOpenGoal())                             Goal g = choicePoints.pop();
          halt('success');                                   g.removeAttachedClause();
   else                                                      if(g.hasMoreClauses())
         Goal g = proofTree.selectOpenGoal();                      return;
         g.createMatchingClauseList();                  halt('failure')
         if(g.hasMoreMatchingClauses())
              DefiniteClause c = g.nextClause();
               g.attachClause(c);
              choicePoints.push(g);                           Remove bindings
          else
              chronologicalBacktrack();

                                                   Create bindings
                                                   Java Iterator
 91                          CS6795 Semantic Web Techniques                       22-Sep-06
     Tree with initial goal p(Z)

     p(X) :- q(X), r(X).
     q(g(X)).
     q(k).
     r(g(h))

                       ?:-p(Z)
                   a                                     ChoicePoints
                p(Y1) :- q(Y1), r(Y1)
                         b           c
                           b’                        c     Y2/h
                q(g(Y2))         r(g(h))
                          q(k)                       b Y1/k
                                                     b’ Y1/g(Y2)
                                                     a     Z/Y1


92                  CS6795 Semantic Web Techniques                      22-Sep-06
     Moving to First Order Logic

        Students struggle with variables
         –   Unification
         –   Composition of substitutions
         –   Unbinding on backtracking

        Can we hide the hard stuff?
         –   Powerful abstraction




93                    CS6795 Semantic Web Techniques   22-Sep-06
     Shallow or deep variables?

      Deep
       –   variable binding is a list of replacements
       –   traverse list for each lookup
       –   undoing: remove most recent replacements
           {X  f(Y)}  {Y  a}

      Shallow
       –   an array of (all) variables and their current values
           [X  f(a)
            Ya
            …]
       –   undoing: pop stack of previous values (trail)

95                    CS6795 Semantic Web Techniques              22-Sep-06
         Goal Tree and flatterms

                                                           N
                                                           p

        Each node has head and
         body atoms                                            p1        pm

        Body atoms form goals
                                                                              D
                                             C    q                                r
          –   attach children
        resolved p1 from
           d  p1, …, pm
                                                      q1            qn

         against q from
           q  q1, …, qn
        resolved pm against r .

97                       CS6795 Semantic Web Techniques                           22-Sep-06
         Flatterms to represent atoms

        j-DREW uses flatterms
          –   Array of pairs:
                  symbol table ref
                  length of subterm
          –   Not structure sharing
        Flatterms save theorem
         provers time and space
         (de Nivelle, 1999)
        Data transfer between
         deduction engine and
         rest of application
98                         CS6795 Semantic Web Techniques   22-Sep-06
         Variables are clause-specific

      Variables use
       negative
       indexes
      Bindings are
       references to
       flatterm &
       position

        Unifier
         X  g2
         Y  f(g2)
         W  h(g2)
         Z  f(g2)
99                     CS6795 Semantic Web Techniques   22-Sep-06
      Composing and undoing Bindings



         Local shallow bindings currently do not allow
          composition
          –   bindings must be done to a flatterm
          –   new binding on a new flatterm

         Backtracking is integrated with unbinding
          –   for quick unbinding, we use a stack of flatterms for
              each goal.



100                     CS6795 Semantic Web Techniques               22-Sep-06
      Discrimination trees


         Given a goal we want to access matching clauses
          quickly
         Every-argument addressing
          –   unlike Prolog‟s first argument addressing
         Useful for RDF triples
          –   a pattern may have variable in first argument
          –   rdf(X, ownedby, „Ora Lassila‟)




102                     CS6795 Semantic Web Techniques        22-Sep-06
          Discrimination trees

         Given a goal, want to access
          input clauses with matching                           p       q    r
          heads quickly                                         f
         Index into clauses via a
                                                           g1       h
          structure built from heads
                                                           h        *
         Replace vars by *
                                                           g2       h
           –   imperfect discrimination
         merge prefixes as much as                        g1       *
          possible          • We added                              f
           –   a tree arises          p(f(g1 ),h(g2 ),g1 )          *
                                      p(f(h( X)),h(Y),f(Z, Z))
                                                                    *
103                       CS6795 Semantic Web Techniques                    22-Sep-06
  Finding heads for goal p(X,h(g2),Y)

                                                                p       q    r
         replace vars in goal by *
          –   p(*,h(g2),*)                                      f

                                                           g1       h
         Find instances of goal                           h        *
          –   * in goal, skip subtree
                                                           g2       h
      • Find generalizations of goal                       g1       *
          –* in tree, skip term in goal
                                                                    f
      •Find unifiable
         –combination of both                                       *

                                                   p(f(g1 ),h(g2 ),g1 )
104                                                p(f(h( X)),h(Y),f(Z, Z))
                        CS6795 Semantic Web Techniques                      22-Sep-06
      Iterator for matching clauses

         We use Java idioms where possible
         Java‟s iterators give access to sequence
          –   next()
          –   hasNext()
         Used for access to sequence of matching clauses
          –   used in discrimination tree for access to roots leaves of
              skipped tree
              (McCune‟s term: jump-list)




105                    CS6795 Semantic Web Techniques             22-Sep-06
106   CS6795 Semantic Web Techniques   22-Sep-06
      •SmokedSalmon is the intersection
      of Smoked and Salmon

                                                       Smoked Salmon




107                   CS6795 Semantic Web Techniques             22-Sep-06
      •SmokedSalmon is the intersection
      of Smoked and Salmon

                                                         Smoked Salmon


      •Gravalax is the intersection of
      Cured and Salmon, but not
      Smoked




                                            Gravalax




108                     CS6795 Semantic Web Techniques             22-Sep-06
      •SmokedSalmon is the intersection
      of Smoked and Salmon

                                                         Smoked Salmon


      •Gravalax is the intersection of
      Cured and Salmon, but not
      Smoked


                                                                      Lox
      •Lox is Smoked, Cured Salmon          Gravalax




109                     CS6795 Semantic Web Techniques             22-Sep-06
          A search for keywords
           Salmon and Cured should                          Smoked Salmon
           return pages that mention
           Gravalax, even if they don‟t
           mention Salmon and Cured

          A search for Salmon and
           Smoked will return pages
           with smoked salmon, should
                                                                         Lox
           also return pages with Lox,         Gravalax
           but not Gravalax

          The Semantic Web vision is to make information on
          the web “understood” by computers, for searching,
          categorizing, …
110                        CS6795 Semantic Web Techniques             22-Sep-06
                                       Smoked Salmon




                                                    Lox
                          Gravalax




111   CS6795 Semantic Web Techniques             22-Sep-06
      One possible encoding

      Search criteria:                       A search for keywords
                                             Salmon and Cured
      retrieve(P) :-                         should return pages
                                             that mention Gravalax,
        about(P, cured),                     even if they don’t
        about(P, salmon).                    mention Salmon and
                                             Cured.


      Ontology:                         about(p1, gravalax).
      about(P, cured) :-
       about(P, gravalax).              retrieve(p1) succeeds
      about(P, salmon) :-
       about(P, gravalax).
112              CS6795 Semantic Web Techniques                  22-Sep-06
                                          A search for Salmon
      retrieve(P) :-                      and Smoked will
        about(P, smoked),                 return pages with
        about(P, salmon).                 smoked salmon,
                                          should also return
                                          pages with Lox, but
      about(P, cured) :-                  not Gravalax.
       about(P, lox).
      about(P, salmon) :-
       about(P, lox).                      about(p1, gravalax).
      about(P, smoked) :-
                                           about(p2, lox).
       about(P, lox).
      about(P, cured) :-
       about(P, gravalax).
                                           retrieve(p1) fails
      about(P, salmon) :-                  retrieve(p2) succeeds
       about(P, gravalax).
113                 CS6795 Semantic Web Techniques                22-Sep-06
      Working Prototypes:

         Basic Prolog Engine
          –   Accepts RuleML, or Prolog, or mixture
          –   Iterator for instances of the top goal
          –   Main loop is same code as propositional theorem prover
              (shown earlier)
          –   Builds, displays deduction tree
                  available to rest of system
          –   Negation as failure




114                      CS6795 Semantic Web Techniques       22-Sep-06
      More working prototypes:
      Variants of Top-Down Engine

         User directed
          –   User selects goals
          –   User chooses clauses
                  keeps track of clauses still left to try
          –   Good teaching tool
         Bounded search
          –   iteratively increase bound
          –   every resolution in search space will eventually be tried
          –   a fair selection strategy
         Original variable names supplied
          –   particularly important for RuleML


115                           CS6795 Semantic Web Techniques              22-Sep-06
      Bottom-Up / Forward Chaining


         Set of support prover for definite clauses
         Facts are supports
         Theorem: Completeness preserved when
          definite clause resolutions are only between
          first negative literal and fact.
          –   Proof: completeness of lock resolution (Boyer‟s PhD)
         Use standard search procedure to reduce
          redundant checking (next)
         Unlike OPS/Rete, returns proofs and uses first
          order syntax for atoms
119                     CS6795 Semantic Web Techniques           22-Sep-06
       Theorem Prover’s Search Procedure

                                   main loop
       Priority   queue            select new fact
        –   new facts               for each matching rule
                                       resolve
       Discrimination
                                       process new result
       trees:                       add to old facts
        –   used facts
                                   process new result(C)
        –   rules, indexed on        if C is rule
            first goal                  for each old fact matching first goal
                                          resolve
                                          process new result
                                        add C to rules
                                     else
                                        add C to new facts
120                     CS6795 Semantic Web Techniques                 22-Sep-06
      Event – Condition - Action



         Suppose theorem prover saturates
          –   may need datalog, subsumption
          –   Then a new fact is added from
                  push process
                  Java event listener
          –   adding a fact restarts saturation
                  could generate new Java events
         ECA interaction with Java 1.1 events



121                       CS6795 Semantic Web Techniques   22-Sep-06
      j-DREW sound and complete

         Sound unification
         Search complete variant
          –   fair search procedure rather than depth-first
          –   uses increasing bounds
         Sound negation
          –   delay negation-as-failure subgoals
          –   until ground or until only NAF goals remain




122                    CS6795 Semantic Web Techniques         22-Sep-06
      Related Work

         j-DREW compared to Prolog
          –   j-DREW not compiled
          –   More flexible
                  Dynamic additions
                  Web-ized
                  Programmer‟s API
          –   Performance requirements different
                  j-DREW unlikely to yield megalips




123                      CS6795 Semantic Web Techniques   22-Sep-06
      Summary

       Architecture    for Java-based reasoning engines
        –   forward & backward
       Backward:     variable binding/unbinding automatic
        –    tied with choicepoints
        –   configurable
       Integrated with other Java APIs
       Small footprint
        –   Depolyed as thread, on server, on client, mobile
       Dynamic     additions to rules
        –   Integration of RuleML and Prolog rules in same proofs
       Proofs   available

125                   CS6795 Semantic Web Techniques           22-Sep-06
126   CS6795 Semantic Web Techniques   22-Sep-06
      Todays Topics

         Resolution
          –   top down and bottom up
         j-DREW BU procedure
         Subsumption
          –   change to procedure
         Infinite Loops
         RuleML input
          –   Prolog output




127                   CS6795 Semantic Web Techniques   22-Sep-06
      Resolution

         Clausal Logic: Syntax
          –   an atom in logic is (syntactically) a relation symbol
              followed by its arguments, each of which is a term
          –   a term is either a variable, a constant or a function
              symbol followed by its arguments (which are also terms)
                  brother(„Harry‟, future_king(„England‟))
                  passes(„Fang‟, cs6999)
          –   each clause is a disjunction of positive or negative atoms
                  attends(Student, Course) \/ ~passes(Student, Course)
                  Rule Notation: a \/ b \/ ~c \/ ~d becomes a \/ b  c /\ d
          –   a literal is a positive or negative atom
         Definite clauses have
          –   one positive literal and any number of negative literals

128                      CS6795 Semantic Web Techniques                  22-Sep-06
      Resolution

         Given two clauses, to form the resolvent:
          –   find two literals, one from each clause, that
                  can be made to match (with assignments to the variables)
                  differ in sign
          –   construct the disjunction of all literals except these two
          –   apply the substitution
         Resolve
          –   b(X) \/ ~c(X, 3) against c(2, Y) \/ ~d(Y, Z)
          –   gives b(2) \/ ~d(3, Z)
         In rule notation
          –   b(X)  c(X, 3) against c(2, Y)  d(Y, Z)
          –   gives b(2)  d(3, Z)

129                      CS6795 Semantic Web Techniques              22-Sep-06
      Bottom Up Reasoning

         Single literal definite clauses are called facts
          –   passes(„Fang‟, cs6999)
         Resolving a fact against a condition in a rule is
          called forward reasoning
          –   attends(Student, Course)  passes(Student, Course)
          –   Resolvent: attends(„Fang‟, cs6999)
         Usually a derivation tree is viewed with given facts
          at the bottom and derived facts at the top
          –   so forward reasoning also called bottom up reasoning
         Prolog does top-down, backward reasoning
          –   starting from a negative clause, called a query
130                    CS6795 Semantic Web Techniques           22-Sep-06
      j-DREW Bottom Up

         More or less efficient than top down?
          –   depends on details of each search method
         More
          –   can reuse subderivations
          –   saves space and time
         Less
          –   Less goal directed
          –   Much unfocused search
         Infinite loops possible with both


131                   CS6795 Semantic Web Techniques     22-Sep-06
       Theorem Prover’s Search Procedure

                                   main loop
       Priority   queue            select new fact
        –   new facts               for each matching rule
                                       resolve
       Discrimination
                                       process new result
       trees:                       add to old facts
        –   used facts
                                   process new result(C)
        –   rules, indexed on        if C is rule
            first goal                  for each old fact matching first goal
                                          resolve
                                          process new result
                                        add C to rules
                                     else
                                        add C to new facts
132                     CS6795 Semantic Web Techniques                 22-Sep-06
      Preventing Infinite Loops

         To prevent infinite loops in the search procedure,
         use subsumption (next slides) and either
         1a) use ground facts and rules only, or
         1b) use no function symbols

          Sometimes it helps if the positive literal has no
          new variables (that do not already occur in the
          body)




133                  CS6795 Semantic Web Techniques       22-Sep-06
      Subsumption

         A clause C subsumes a clause D if there is a
          substitution  such that C  D
          –   C is more general than D
          –   Given C you do not need D
         We use subsumption between facts (atoms)
          –   Atoms C subsumes atom D if
              there exists  such that C = D
         Subsumption is checked by
          –   first grounding all variables in D to new constants
          –   then trying to unify C with grounded D


134                    CS6795 Semantic Web Techniques               22-Sep-06
      Forward subsumption

         New result is checked against old results to see if
          it is more general
         We can prevent some infinte loops by checking
          subsumption of new fact against old facts
         Should this be done when the new fact is derived
          or when it is selected?
          –   experience shows that subsumption on selection is
              better
         What about subsumption of rules?



135                   CS6795 Semantic Web Techniques          22-Sep-06
       Theorem Prover’s Search Procedure
                                   main loop
       Priority   queue            select new fact
                                    if it is not forward subsumed
        –   new facts
                                       for each matching rule
       Discrimination                     resolve
       trees:                              process new result
        –   used facts                 add to old facts
        –   rules, indexed on      process new result(C)
            first goal               if C is rule
                                        for each old fact matching first goal
                                          resolve
                                          process new result
                                        add C to rules
                                     else
                                        add C to new facts
136                     CS6795 Semantic Web Techniques                 22-Sep-06
      Event – Condition - Action

         Suppose theorem prover saturates
          –   Then a new fact is added from
                  push process
                  Java event listener
          –   adding a fact restarts saturation
                  could generate new Java events
         ECA interaction with Java 1.1 events




137                       CS6795 Semantic Web Techniques   22-Sep-06
          System Architecture

          j-DREW           j-DREW BU                         Listener
                                                               Listener
           runs                                                  Listener
                                                New Fact
                                Rules                               Listener
          Listeners
           register with     Old Facts
           Broadcaster
          New fact
           added                                             Event Broadcaster
          New               New Facts           New Facts
           conclusions
           drawn
          Events sent
           to Listeners
138                    CS6795 Semantic Web Techniques                   22-Sep-06
                                                    <imp>
                                                     <_head>
       RuleML                                          <atom>
                                                        <_opr><rel>discount</rel></_opr>
                                                        <var>customer</var>
                                                        <var>product</var>
          Input to j-DREW BU may also                  <ind>5.0 percent</ind>
                                                       </atom>
           be RuleML                                 </_head>
          RuleML queries are ignored                <_body>
                                                       <and>
           currently                                    <atom>
                                                         <_opr><rel>premium</rel></_opr>
                                                         <var>customer</var>
                                                        </atom>
                                                        <atom>
      discount(customer,product1,'5.0 percent')          <_opr><rel>regular</rel></_opr>
         :-                                              <var>product</var>
                                                        </atom>
         premium(customer),regular(product).
                                                       </and>
                                                     </_body>
                                                    </imp>




139                       CS6795 Semantic Web Techniques                      22-Sep-06
      Related Literature


         Set of support prover for definite clauses
         Facts are supports
         Theorem: Completeness preserved when
          definite clause resolutions are only between
          first negative literal and fact.
          –   Proof: completeness of lock resolution (Boyer‟s PhD)
         Use standard search procedure to reduce
          redundant checking
         Unlike OPS/Rete, returns proofs and uses first
          order syntax for atoms
140                     CS6795 Semantic Web Techniques           22-Sep-06
      The Rule Markup Language




141           CS6795 Semantic Web Techniques   22-Sep-06
      Motivation (I)

         Rules in (and for) the Web have become a
          mainstream topic since
          –   inference rules were
                  marked up for E-Business
                  identified as a Design Issue of the Semantic Web
          –   transformation rules were used for document
              generation from central XML repository

      • Rule interchange is becoming more important in
        Knowledge Representation (KR), especially in
         – Intelligent Agents
         – Web Services
142                      CS6795 Semantic Web Techniques               22-Sep-06
      Motivation (II)

         The Rule Markup Initiative has taken initial steps towards
          defining a shared Rule Markup Language (RuleML) for
          interoperation between the currently 34 Participant Groups
          around the world
         RuleML permits rules in XML & RDF/DAML+OIL for
          –   derivation, query, transformation (stable DTDs/Schemas)
          –   integrity checking (still regarded as special queries)
          –   reactive behavior (currently as translators to, e.g., Jess)




143                      CS6795 Semantic Web Techniques                     22-Sep-06
      Semantic Web and Web Services
      Use Databases and Rule Systems

      Semantic Web: DAML+OIL                          Web Services : WSDL
      Category-Based Search Engines                   Mediator Agents
      & Document Retrieval                            & Information Integration
      Formal Ontologies                               Interface Descriptions
      & Metadata Repositories                         & CGI Scripts
      First-Order Logic                               Communication Protocols
      & Knowledge Representation                      & Remote Procedure Calls


      Databases: SQL                                  Rule Systems: RuleML
      (Integration of) Schemas & Dictionaries         Derivation Rules
      (Distributed) Transaction Processing            Transformation Rules
      Triggers & Events                               Reaction Rules

144                       CS6795 Semantic Web Techniques                          22-Sep-06
      Rule Systems for
      Web-Based B2C or B2B Rule Exchange
        Merchant1                                Merchantm
                              ...
                         translate to
                      standard format
         publish      (e.g., RuleML)             publish
         rulebase1                               rulebasem


                                             compare, instantiate,
                                             and run rulebases

                 Customer or Company
145             CS6795 Semantic Web Techniques                  22-Sep-06
       From Natural Language to Horn Logic

      English Business Rules:
        ''The discount for a customer buying a product is 5.0
        percent
        ''The customer is premium and the product is
        if the discount for a customer buying a product is 7.5
        regular.''
        percent
        . . the customer is premium and the product is
        if .
        luxury.''
      Prolog-like formalization (syntax generated from XML):




146                CS6795 Semantic Web Techniques      22-Sep-06
       RuleML: Markup and Tree

          ''The discount for a customer buying a product is 5.0
          percent
      <imp> the customer is premium and the product is
          if                          imp
        <_head>                         head
          regular.''
          <atom>                             atom
            <_opr><rel>discount</rel></_opr>                opr   rel       discount
            <var>customer</var>                                   var       customer
            <var>product</var>                                    var       product
            <ind>5.0 percent</ind>                                ind       5.0 percent
          </atom>
        </_head>
        <_body>                                    body
          <and>                                           and
            <atom>                                           atom
              <_opr><rel>premium</rel></_opr>                   opr   rel     premium
              <var>customer</var>                                     var     customer
            </atom>
            <atom>                                          atom
              <_opr><rel>regular</rel></_opr>                  opr    rel     regular
              <var>product</var>                                      var     product
            </atom>
          </and>
        </_body>
147   </imp>             CS6795 Semantic Web Techniques                      22-Sep-06
      Intertranslating RuleML and RFML
       ''The discount for a customer buying a product is 5.0
       percent
                                            product is
       if the customer is premium and the <hn>
      <imp>
       regular.''
         <_head>
           <atom>                            <pattop>
            <_opr><rel>discount</rel></_opr>              <con>discount</con>
            <var>customer</var>                           <var>customer</var>
            <var>product</var>                            <var>product</var>
            <ind>5.0 percent</ind>                        <con>5.0 percent</con>
          </atom>                                       </pattop>
        </_head>              ruleml2rfml.xsl
        <_body>
          <and>               rfml2ruleml.xsl
            <atom>                                      <callop>
              <_opr><rel>premium</rel></_opr>             <con>premium</con>
              <var>customer</var>                         <var>customer</var>
            </atom>                                     </callop>
            <atom>                                      <callop>
              <_opr><rel>regular</rel></_opr>             <con>regular</con>
              <var>product</var>                          <var>product</var>
            </atom>                                     </callop>
          </and>
        </_body>
148   </imp>           CS6795 Semantic Web Techniques </hn>               22-Sep-06
      Structure of the RuleML DTD Hierarchy

         Our system of DTDs (current version: 0.8) uses a
          modularization approach similar to XHTML in order
          to accomodate the various rule subcommunities
         The evolving hierarchy of RuleML DTDs forms
          a partial order with ruleml as the greatest element
          (a ruleml-rooted DAG) -- many „smallest‟ elements
         Each DTD node in the hierarchy (conformance
          “lattice”) corresponds to a specific RuleML
          sublanguage:
          –   „Union‟ (join) of sublanguages reached via outgoing links:
              to smaller or equal nodes below
          –   „Intersection‟ (meet) of sublanguages via incoming links:
              from greater or equal nodes above
149                    CS6795 Semantic Web Techniques            22-Sep-06
      The Module Hierarchy of RuleML DTDs

                                 ruleml

                     ur-equalog                       Rooted DAG will be extended with
                                                      branches for further sublanguages
                     ur-hornlog         equalog

                     ur-datalog         hornlog
                                                                        ur-datalog =
                                        datalog                         join(ur,datalog)

      ur             urc-datalog                      bin-datalog
      URL/URI-like
      ‘ur’-objects
                                  urc-bin-datalog
                              urc-bin-data-ground-log
                              urc-bin-data-ground-fact                 RDF-like triples
150                  CS6795 Semantic Web Techniques                         22-Sep-06
      Planned RuleML Extensions

         Reaction Rules: Encompass Situated, ECA, ...
         Rule Modules: „Send‟ queries to agents
         Negations: Strong negation & negation as failure
         Rule Prioritizing: Labels and/or salience factors
         Integrity Constraints: Directly (not as queries)




151                CS6795 Semantic Web Techniques   22-Sep-06
      RuleML Conclusions

         RuleML DTD 0.8, a system of DTDs, is available at
          http://www.dfki.de/ruleml/indtd0.8.html; sample rulebases
          at http://www.dfki.de/ruleml/0.8/exa, use cases at
          http://www.dfki.de/ruleml/library
         RuleML DTD 0.81 also has transformation rules with call-
          by-value function nestings
         Further rule categories (e.g. integrity constraints and
          reaction rules) will be available via main RuleML page
          at http://www.dfki.de/ruleml
         Distributed KR can already be based on current DTDs --
          using (XSLT) transformations to reach follow-up and
          Participants‟ DTDs

152                  CS6795 Semantic Web Techniques        22-Sep-06
      Simple HTML/XML Ontology Extensions




153           CS6795 Semantic Web Techniques   22-Sep-06
      SHOE Basics

        SHOE (Simple HTML Ontology Extensions)
        (http://www.cs.umd.edu/projects/plus/SHOE/)

        provides distributed ontologies consisting of

        Categories: Organized hierarchically, with multiple
        inheritance, for classifying instances

        Relationship rules: Horn clauses (the first well-known
        Horn language publishing KBs in the Web)

        SHOE originally specified in HTML (before the definition
        of XML); meanwhile also specified as an XML DTD
154                CS6795 Semantic Web Techniques             22-Sep-06
      Instances (Individuals) as URLs/URIs


      Individual constants in SHOE are represented through
      an (official) URL/URI

      In the earlier Horn-rule example there appear two individuals,
      which could be represented in SHOE, e.g., as

      eurostar                =         http://www.eurostar.com/

      channel-tunnel          =         http://www.eurotunnel.com/




155                CS6795 Semantic Web Techniques                  22-Sep-06
      A SHOE Rule

      With these URLs/URIs, the rule in SHOE becomes
      <DEF-INFERENCE
         DESCRIPTION="travel(?someone,http://www.eurotunnel.com/) if
                       carry(http://www.eurostar.com/,?someone)">
         <INF-IF>
             <RELATION NAME="carry">
                 <ARG POS="1" VALUE="http://www.eurostar.com/">
                 <ARG POS="2" VALUE="someone" USAGE="VAR">
             </RELATION>
         </INF-IF>
         <INF-THEN>
             <RELATION NAME="travel">
                 <ARG POS="1" VALUE="someone" USAGE="VAR">
                 <ARG POS="2" VALUE="http://www.eurotunnel.com/">
             </RELATION>
         </INF-THEN>
      </DEF-INFERENCE>
156                   CS6795 Semantic Web Techniques                   22-Sep-06
      XML Namespaces




157          CS6795 Semantic Web Techniques   22-Sep-06
      XML Namespaces and
      Programming-Language Modules

         XML namespaces are akin to namespaces,
          packages, and modules in programming languages
         Disambiguation of tag–and attribute–names from
          different XML applications (“spaces”) through
          different prefixes
         A prefix is separated from the local name by a “:”,
          obtaining prefix:name tags
         Namespaces constitute a layer on top of XML 1.0,
          since prefix:name is again a valid tag name and
          namespace bindings are ignored by some tools

158                 CS6795 Semantic Web Techniques     22-Sep-06
      Namespace Bindings

         Prefixes are bound to namespace URIs by attaching
          an xmlns:prefix attribute to the prefixed element or
          one of its ancestors, prefix:name1 ,..., prefix:namen
         The value of the xmlns:prefix attribute is a URI,
          which may or (unlike for DTDs!) may not point to a
          description of the namespace‟s syntax
         An element can use bindings for multiple name-
          spaces via attributes xmlns:prefix1 ,..., xmlns:prefixm


159                  CS6795 Semantic Web Techniques       22-Sep-06
      Namespaceless Example:
      Address Variant

      Namespaceless XML Markup:
        <address>
          <name>Xaver M. Linde</name>
          <street>Wikingerufer 7</street>
          <town>10555 Berlin</town>
          <bill>12.50</bill>                         bill is ambiguous
          <phone>030/1234567</phone>                 tag (name clash
          <phone>030/1234568</phone>                 from two XML
          <fax>030/1234569</fax>
          <bill>76.20</bill>                         applications)
        </ address>




160                 CS6795 Semantic Web Techniques                22-Sep-06
      Two-Namespace Example:
      Snail-Mail and Telecoms Address Parts
      Namespace XML Markup:
         <mail:address xmlns:mail="http://www.deutschepost.de/"
                        xmlns:tele="http://www.telekom.de/">
           <mail:name>Xaver M. Linde</mail:name>
           <mail:street>Wikingerufer 7</mail:street>
           <mail:town>10555 Berlin</mail:town>
           <mail:bill>12.50</mail:bill>
           <tele:phone>030/1234567</tele:phone>
                                                        bill disambiguation
           <tele:phone>030/1234568</tele:phone>         through mail and
           <tele:fax>030/1234569</tele:fax>             tele prefixes
           <tele:bill>76.20</tele:bill>
         </ mail:address>
      • The root element, mail:address, as well as the children mail:name, mail:street,
        mail:town, and mail:bill, use the mail prefix, bound to a deutschepost URI
      • The tele:phone, tele:fax, and tele:bill children use the tele prefix, bound to a telekom
        URI
161                       CS6795 Semantic Web Techniques                            22-Sep-06
      Acquiring and Processing
      Knowledge Markups




162           CS6795 Semantic Web Techniques   22-Sep-06
      Acquiring and Processing
      Knowledge Markups

         acquisition
          –   Protégé with XML Plugin
          –   Web Onto
         transformation techniques and stylesheet languages
          –   CSS
          –   XSLT
         query languages
          –   XQL and XPath
          –   XML-QL
          –   XQuery
163                     CS6795 Semantic Web Techniques         22-Sep-06
      Acquiring XML Knowledge Bases




164           CS6795 Semantic Web Techniques   22-Sep-06
      Protégé-2000 as an XML Editor


         Represents the latest in a series of interactive tools for
          knowledge-system development
         Facilitates construction of knowledge bases in a principled
          fashion from reusable components
         Allows a variety of “plug-ins” to facilitate customization in
          various dimensions
         One plug-in used for XML import/export, i.e.
          Protégé proposed as an XML editor (also as an RDF[S]
          and OIL editor)

165                    CS6795 Semantic Web Techniques               22-Sep-06
      Knowledge-Base Development with
      Protégé-2000

      1.   Build or import a domain ontology (a conceptual
           model of the application area)
      2.   Custom-tailor GUI for acquisition of content
           knowledge
      3.   Elicit content knowledge from application
           specialists
      4.   Map domain ontology to appropriate problem
           solvers for automation of particular tasks
      5.   Export ontology and content knowledge to target
           format (OKBC, XML, RDF[S], OIL, DAML+OIL ...)

166                CS6795 Semantic Web Techniques    22-Sep-06
      Protégé as an OKBC-Compliant System
      (Open Knowledge Base Connectivity)

      OKBC:
         Standard mechanism for knowledge bases stored
          as “frames” of classes, slots, facets, instances, ...
         Adopted by several well-known knowledge-
          representation systems (Ontolingua, LOOM,
          Protégé-2000, XOL)
         Allows Protégé-2000 to be used as an ontology-
          and knowledge-editing system for any OKBC-
          compliant server
167                  CS6795 Semantic Web Techniques       22-Sep-06
       XML Import Strategy


         tag/element names become class names, except
          “leaves” which become slots
         example:
      <Customer>
          <Name>
            <FirstName>Bill</FirstName>
            <LastName>Buckram</LastName>
          </Name>
          <Cardnum>234 ...</Cardnum>
      </Customer>




168                           CS6795 Semantic Web Techniques   22-Sep-06
      Example (Import):
      Book Order




169            CS6795 Semantic Web Techniques   22-Sep-06
      XML Export Strategy


         instances:
          –   unreferenced instances become top level elements (cyclic
              references are handled)
          –   classes and slots become tag names
          –   objects that are referenced more than
              once are shared/reused with id/idref
         ontology:
          –   as simple XML tree or RDF Schema




170                    CS6795 Semantic Web Techniques          22-Sep-06
      Example (Export):
      Newspaper Instances




171           CS6795 Semantic Web Techniques   22-Sep-06
      Example: Newspaper Ontology As XML
      Tree




172           CS6795 Semantic Web Techniques   22-Sep-06
      Processing XML




173           CS6795 Semantic Web Techniques   22-Sep-06
      Cascading Style Sheets

         CSS is a language for applying styles such as bold and
          Arial to XML elements
         also works with HTML (supported in most modern
          browsers)
         example (style sheet for poems):
             poem     { display:   block }
             title    { display:   block; font-size: 16pt; font-weight: bold}
             poet     { display:   block; margin-bottom: 10px }
             stanza   { display:   block; margin-bottom: 10px }
             verse    { display:   block }
         attached to XML documents with processing instruction:
          <?xml-stylesheet type="text/css" href="poem.css"?>

174                   CS6795 Semantic Web Techniques                            22-Sep-06
      XSLT (XSL Transformations)

         XSL (Extensible Stylesheet Language) =
              XSLT + Formatting Objects
         XSLT is a rule-based transformation language for
          XML documents/trees
         result of a transformation usually is again an XML
          document, but may also be HTML or plain text
         transformation takes place
          –   offline (useful for XML-to-HTML transformation)
          –   on server (e.g., with Apache´s Cocoon or Xalan)
          –   in client (browser, preliminary support in Netscape 6 and
              IE 5.x)

175                    CS6795 Semantic Web Techniques            22-Sep-06
      XML to HTML: XSLT Example – Input

       <addresses>

        <address>
         <name>Xaver M. Linde</name>
         <street>Wikingerufer 7</street>
         <town>10555 Berlin</town>
        </address>

        <address>
         <name>John Doe</name>
         <street>42 Gary Cooper Street</street>
         <town>Stanwyck City</town>
        </address>

       </addresses>

176                   CS6795 Semantic Web Techniques   22-Sep-06
      XML to HTML: XSLT Example – Stylesheet

       <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

        <xsl:template match="/">
         <html>
          <head><title>Addresses</title></head>
          <body bgcolor="white">                             template for
           <xsl:apply-templates/>
          </body>                                           document root
         </html>
        </xsl:template>

        <xsl:template match="address">
         <p>
           <i><xsl:value-of select="name"/></i><br/>        template for
           <xsl:value-of select="street"/><br/>
           <b><xsl:value-of select="town"/></b>
                                                              address
         </p>                                                 elements
        </xsl:template>

       </xsl:stylesheet>
177                        CS6795 Semantic Web Techniques                  22-Sep-06
      XML to HTML: XSLT Example – Output

       <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
        "http://www.w3.org/TR/REC-html40/strict.dtd">

       <html>
        <head><title>Addresses</title></head>
        <body bgcolor="white">
         <p><i>Xaver M. Linde</i><br>
             Wikingerufer 7<br>
             <b>10555 Berlin</b>
         </p>
         <p><i>John Doe</i><br>
             42 Gary Cooper Street<br>
             <b>Stanwyck City</b>
         </p>
        </body>
       </html>

       (The HTML code was produced with
       Apache´s Cocoon in HTML mode, hence
       <br/> became <br>)

178                    CS6795 Semantic Web Techniques     22-Sep-06
       XML to XML: Transformational
       Semantics via an XSLT Stylesheet
      <addresses>                      <addresses>                       % start fact base for addresses
       <address>                        <address>                         address(
        <name>Me2XML</name>              <name>Me2XML</name>                 name("Me2XML"),
        <street>96 Hyper Road</street>   <place>                             place(
        <town>Boston</town>               <street>96 Hyper Road</street>       street("96 Hyper Road"),
       </address>                         <town>Boston</town>                  town("Boston")
       <address>                         </place>                            )
        <name>RDF4All</name>            </address>                        ).
        <street>2001 Broadway</street> <address>                          address(
        <town>New York</town>            <name>RDF4All</name>                name("RDF4All"),
       </address>                        <place>                             place(
       <address>                          <street>2001 Broadway</street>       street("2001 Broadway"),
        <name>XML4You</name>              <town>New York</town>                town("New York")
        <street>96 Hyper Road</street>   </place>                            )
        <town>Boston</town>             </address>                        ).
       </address>                       <address>                         address(
      </addresses>                       <name>XML4You</name>                name("XML4You"),
                                         <place>                             place(
                                          <street>96 Hyper Road</street>       street("96 Hyper Road"),
        XSLT templates                    <town>Boston</town>                  town("Boston")
                                         </place>                            )
                                        </address>                        ).
                                       </addresses>                      % end fact base for addresses
179                           CS6795 Semantic Web Techniques                                22-Sep-06
      XML to XML: XSLT Stylesheet with a
      Tree-Transforming Template 1

                                                       addresses

                                                           . . .
                                Subtree                              Subtree

      <!-- process addresses and position address nester -->
      <xsl:template match="/addresses">
        <addresses>
         <xsl:apply-templates/>
        </addresses>
      </xsl:template>                                    addresses

                                                           . . .
                                Subtree                              Subtree

180                       CS6795 Semantic Web Techniques             22-Sep-06
        XML to XML: XSLT Stylesheet with a
        Tree-Transforming Template 2
                                                               address


                                            name                    street                  town

                                       PCDATA                  PCDATA                      PCDATA
      <!-- apply address nester to each flat address -->
      <xsl:template match="address">
        <address>
         <name><xsl:value-of select="name"/></name>
         <place>
           <street><xsl:value-of select="street"/></street>     address
           <town><xsl:value-of select="town"/></town>
         </place>
        </address>
      </xsl:template>                         name                                 place

                                       PCDATA                                 street        town

181                                CS6795 Semantic Web Techniques
                                                                             PCDATA        PCDATA
                                                                                           22-Sep-06
      XQL and XPath

         XSLT uses XPath to select parts of the input XML
          documents, e.g.:
          –   <xsl:template match="/">      document root
          –   <xsl:value-of select="name"/> element „name“
         syntax is not XML-based, but intended to be used
          in URLs (XPointer) and XSLT as above
         XQL is a variant of XPath especially designed for
          querying XML documents
         XPath/XQL expressions select parts of XML
          documents (no transformations!)

182                   CS6795 Semantic Web Techniques         22-Sep-06
      XQL Expressions 1

         XQL expressions (relative to a context node):
          –   address
              select element nodes with tag name „address“
          –   address/name
              select „name“ element nodes directly below „address“
              element nodes
          –   address/name=´John Doe´
              as before, plus the content of the name element must be
              ´John Doe´
          –   book//name
              select „name“ element nodes anywhere below „book“
              element nodes

183                   CS6795 Semantic Web Techniques           22-Sep-06
      XQL Expressions 2

         absolute XQL expressions:
          –   /
              document root (the node that contains the document
              element)
          –   /addresses/address/name
          –   //name
              „name“ element nodes anywhere in the document
         expressions with attributes (prefixed with @):
          –   address/@type
              attribute nodes with name „type“ below „address“ element
              nodes
          –   address/@type=´email´
              as above, plus the value of the „type“ attribute is ´email´

184                    CS6795 Semantic Web Techniques            22-Sep-06
      XQL Expressions 3


         filter expressions:
          –   address[name]
              select „address“ element nodes with a direct „name“ sub-
              element node
          –   address[name=´John Doe´]
              as above, plus the content of the „name“ element is
              ´John Doe´
          –   address[@type=´email´]
              select „address“ element nodes that have a „type“
              attribute whose value is ´email´



185                   CS6795 Semantic Web Techniques           22-Sep-06
      XML-QL

         borrows features of query languages developed by
          the database research community for
          semistructured data
         similar to SQL
         (simplified) base construct is
              WHERE pattern1 IN URI1, ...
              CONSTRUCT patternn
          where the patterns are XML fragments with
          variables (prefixed with $)
         XML-QL introduces an abbreviated XML syntax for
          simplicity: <tag>...</> instead of <tag>...</tag>
186                 CS6795 Semantic Web Techniques   22-Sep-06
      XML-QL Example 1

         return short addresses (town-city renaming,
          without street):
                                                 <address>
                         <street> elements         <name>Xaver M. Linde</name>
          WHERE          are also matched          <street>Wikingerufer 7</street>
           <address>                               <town>10555 Berlin</town>
            <name>$n</>                          </address>
            <town>$t</>
           </> IN "www.test.org/addresses.xml"
          CONSTRUCT
                                       <shortaddress>
           <shortaddress>                 <name>Xaver M. Linde</name>
            <name>$n</>                   <city>10555 Berlin</city>
            <city>$t</>                </shortaddress>

           </>

187                   CS6795 Semantic Web Techniques                        22-Sep-06
      XML-QL Example 2

         XML-QL allows joining by value:
          WHERE
           <address>
            <name>$n</>
           </> ELEMENT_AS $a IN "www.test.org/addresses.xml",
           <book>
            <author>$n</>
            <title>$t</>
           </> IN "www.test.org/books.xml"
          CONSTRUCT
           <book>
            <title>$t</>
            $a
           </>



188                    CS6795 Semantic Web Techniques           22-Sep-06
      XQuery

         derived from Quilt
         borrows features from several languages:
          –   XPath and XQL: path expression syntax
          –   XML-QL: notion of binding variables and then using the bound
              variables to create new structures
          –   SQL: series of clauses based on keywords that provide a
              pattern for restructuring data (the SELECT-FROM-WHERE
              pattern in SQL)
          –   OQL: functional language composed of several different kinds
              of expressions that can be nested with full generality



189                    CS6795 Semantic Web Techniques              22-Sep-06
      XQuery: Examples 1

         Path expressions:
          –   In the second chapter of the document named "zoo.xml", find
              the figure(s) with caption "Tree Frogs":
              document("zoo.xml")/chapter[2]//figure[caption = "Tree Frogs"]
          –   Ranges: Find all the figures in chapters 2 through 5 of the
              document named "zoo.xml":
              document("zoo.xml")/chapter[RANGE 2 TO 5]//figure
          –   Dereferencing: Find captions of figures that are referenced by
              <figref> elements in the chapter of "zoo.xml" with title "Frogs":
              document("zoo.xml")/chapter[title = "Frogs"]
              //figref/@refid->fig/caption

190                     CS6795 Semantic Web Techniques                  22-Sep-06
      XQuery: Examples 2

         FLWR (FOR-LET-WHERE-RETURN) Expressions and Element Constructors:
           –   List the titles of books published by Morgan Kaufmann in 1998:
               FOR $b IN document("bib.xml")//book
               WHERE $b/publisher = "Morgan Kaufmann"
               AND $b/year = "1998"
               RETURN $b/title[xyz:*]
           –   List each publisher and the average price of its books:
               FOR $p IN distinct(document("bib.xml")//publisher)
               LET $a := avg(document("bib.xml")/book[publisher = $p]/price)
               RETURN
               <publisher>                              element
                <name> $p/text() </name> ,             constructor
                <avgprice> $a </avgprice>
               </publisher>



191                           CS6795 Semantic Web Techniques                    22-Sep-06
      XQuery: Examples 3

         Functions (& Namespaces, XML Schema Data Types):
          –   Find the maximum depth of the document named "partlist.xml" :
              NAMESPACE xsd = http://www.w3.org/2000/10/XMLSchema-datatypes


              FUNCTION depth(ELEMENT $e) RETURNS xsd:integer
                {
                    -- An empty element has depth 1
                    -- Otherwise, add 1 to max depth of children
                    IF empty($e/*) THEN 1
                    ELSE max(depth($e/*)) + 1
                }


              depth(document("partlist.xml"))



192                       CS6795 Semantic Web Techniques                      22-Sep-06
      XML-Based Agent Techniques




193           CS6795 Semantic Web Techniques   22-Sep-06
      XML-Based Agent Techniques

         XML-Protocol, SOAP, XML-RPC, WSDL
           –   remote procedure calls starting with HTTP for the transport
               and XML for the encoding
         FIPA (Foundation of Intelligent Physical Agents)
           –   XML (and RDF) as language for message contents
         DAML
           –   DARPA Agent Markup Language
         ACORN
           –   Keyphrase-Based Information Sharing Multi-Agent Architecture: Virendra C.
               Bhavsar and Ali A. Ghorbani
         RACSA
           –   Rule Applying Comparison Shopping Agent



194                         CS6795 Semantic Web Techniques                            22-Sep-06
      RACSA (1)


      The RACSA project contributes to the Semantic Web,
      especially to e-commerce in the Semantic Web


      Unlike in standard comparison shopping,
      the main idea of RACSA is

      • marking up shopping web pages with
        Semantic Web languages

      • based on their list prices,
        computing the real end prices
        by applying various business rules
195                CS6795 Semantic Web Techniques     22-Sep-06
      RACSA (2)


      From a more technical point of view,

      RACSA is a rule-empowered shopping agent, using
      RuleML as the XML-based rule language and
      Mandarax (a Java-based Prolog engine) as the
      inference component for processing knowledge and
      data bases (i.e. facts and rules)

      The goal of RACSA is to demonstrate an e-commerce
      application enabled by the Semantic Web techniques:
      Supporting purchase-decisions by simplifying price
      comparisons
196                CS6795 Semantic Web Techniques     22-Sep-06
      RACSA (3)

      The project is restricted to an exemplary domain:

      Refrigerators/freezers offered by 3 small fictitious shops

      Rule application takes place in a wide variety of areas:
      • gross/net prices
      • calculation of warranty time
      • additional insurance and transport costs
      • payment and customer discounts

            Online Demo: http://www.dfki.de/racsa/
197                CS6795 Semantic Web Techniques          22-Sep-06
      Resource Description Framework




198           CS6795 Semantic Web Techniques   22-Sep-06
      Disclaimer and Footnote

           “There is nothing
           interesting in what we are
           doing. The only interesting
           thing is the scale upon
           which we are attempting to
           do it.”             R.V. Guha, Epinions

      Adobe‟s eXtensible Metadata Platform (XMP) now uses RDF
      for Photoshop® 7.0, Acrobat® 5.0, and FrameMaker®:
      http://www.adobe.com/products/xmp/main.html
199               CS6795 Semantic Web Techniques       22-Sep-06
      Outline

         Motivation: Why XML is not enough
         Introduction to RDF
          –   Requirements for KR on the Web
          –   The RDF Data Model
          –   RDF Schema

         Extensions of RDF(S)
         Tools for RDF and RDF Schema
          –   Parser, Query, and Inference Engines


200                   CS6795 Semantic Web Techniques   22-Sep-06
      Why The Shift Towards More
      Semantics?

         Information Overload
          –   Information on the Web currently aiming at Human
              Consumption
          –   Information Consumption is too time consuming
         Search Engines fail more and more
          –   combined coverage is less than 42% of the HTML-Web
         Data Interchange growing (e.g. B2B)
          –   needs a common semantics
                                                                    XML?


201                    CS6795 Semantic Web Techniques              22-Sep-06
      Extensible Markup Language (XML)
      Revisited

         Key idea: separate structure from presentation
         XML DTDs or Schemas define document structure
         Replace HTML with two things
                  A domain specific markup language (defined in XML)
                  A map from that markup language to HTML (defined using
                   XSLT)

         DTD enables document recipients to tell whether
          they‟ve received a grammar-conforming document
          –   Gives a minimal level of validation


202                      CS6795 Semantic Web Techniques             22-Sep-06
      Why XML is Not Enough

         Main advantage of using XML is reusing the parser
          and document validation
         Many different possibilities to encode a domain of
          discourse
         Leads to difficulties when understanding of foreign
          documents is required
      ==> Next step: separate content from structure!



203                   CS6795 Semantic Web Techniques    22-Sep-06
      Encoding of Knowledge: Example

      “The Creator of the Resource “http://www.w3.org/Home/Lassila” is Ora Lassila

                                           Creator                  Ora Lassila
         http://www.w3.org/Home/Lassila



                   Endless encoding possibilities in XML:
                     <Creator>
                        <uri>http://www.w3.org/Home/Lassila</uri>
                        <name>Ora Lassila</name>
                     </Creator>

                    <Document uri=“http://www.w3.org/Home/Lassila”
                       <Creator>Ora Lassila</Creator>
                    </Document>


        <Document uri=“http://www.w3.org/Home/Lassila” Creator=“Ora Lassila”/>

204                       CS6795 Semantic Web Techniques                          22-Sep-06
      Point to Point Communication
      for Machine-Understandable Data

                                               Conceptual Domain Model         Person is_a Mammal
                                               (Objects and Relations)           Student is_a Person
                                                                                    ----

                                               Translation Step


         <xsd:schema xmlns:xsd="http://...">   DTD or XML Schema
           <xsd:annotation> A-Schema
           </xsd:...
         </xsd:schema>
                                                Deployment

                          XML-based Communication
                          using DTD A                             Parse Tree
                                              XML-
                                              Parser

         Sender using DTD A                                       Recipient using DTD A
                                  Common Semantics
205                        CS6795 Semantic Web Techniques                                         22-Sep-06
      Many Previously Unknown
      Communication Partners




206           CS6795 Semantic Web Techniques   22-Sep-06
      New Partners Don’t Understand
      Each Other

                                        ?

                Communication Partner                         Communication Partner
                using DTD B                                   using DTD C

           ?                                                   ?
                    XML-based Communication
                    using DTD A     XML-       Parse Tree
                                    Parser

         Sender using DTD A                     Recipient using DTD A




207                 CS6795 Semantic Web Techniques                       22-Sep-06
      Merging Steps Between Models
       Steps                  DTD A                                 DTD B

                           <xsd:schema                           <xsd:schema
       Reengineering       xmlns:xsd="http://...">               xmlns:xsd="http://...">
       of the conceptual     <xsd:annotation>A-Schema              <xsd:annotation>B-Schema
       model                 </xsd:...                             </xsd:...
                           </xsd:schema>                         </xsd:schema>



        Matching

                                                      Matching

       XML Document
       Translation
       Generation
       (e.g. in XSLT)
                            <xsl:stylesheet version="1.0”                <xsl:stylesheet version="1.0”
                              xmlns:xsl="http://....Transform"           xmlns:xsl="http://....Transform"
      XML Document
                             <xsl:template match="/">                     <xsl:template match="/">
      Translation from
                               ....                                         ....
      DTD A to DTD B
                              </xsl:template>                              </xsl:template>
      (and B to A)
                            </xsl:stylesheet>                            </xsl:stylesheet>
208                           CS6795 Semantic Web Techniques                                      22-Sep-06
      Merging/Aligning Models


         Reengineering step is costly and unnecessary,
          when a conceptual language is in use
         Generation document translation procedures is
          again complicated and unnecessary
      ==> use a level on top of XML
         What are requirements for such a level?



209                 CS6795 Semantic Web Techniques   22-Sep-06
      Postulates: Fundamental Requirements
      for KR on the Web


      1. Knowledge on the Web is distributed
         (link Knowledge on the Web)
      2. Knowledge on the Web is biased - there is no
         universal truth
         it must be possible to dispute statements
      3. Many different user communities:
         Extensibility and Simplicity

      ==> Resource Description Framework (RDF)

210               CS6795 Semantic Web Techniques    22-Sep-06
      Introduction to RDF

         RDF (Resource Description Framework)
          –   Beyond Machine readable to Machine understandable
         RDF unites a wide variety of stakeholders:
          –   Digital librarians, content-raters, privacy advocates, B2B
              industries, AI...
          –   Significant (but less than XML) industrial momentum,
              lead by W3C
         RDF consists of two parts
          –   RDF Model (a set of triples)
          –   RDF Syntax (different XML serialization syntaxes)
         RDF Schema for definition of Vocabularies (simple
          Ontologies) for RDF (and in RDF)

211                    CS6795 Semantic Web Techniques             22-Sep-06
      RDF Data Model

         Resources
          –   A resource is a thing you talk about (can reference)
          –   Resources have URI‟s
          –   RDF definitions are themselves Resources (linkage, see
              requirement 1)
         Properties
          –   slots, define relationships to other resources or atomic
              values
         Statements
          –   “Resource has Property with Value”
          –   (Values can be resources or atomic XML data)
         Similar to Frame Systems

212                    CS6795 Semantic Web Techniques             22-Sep-06
      A Simple Example

         Statement
          –   “Ora Lassila is the creator of the resource
              http://www.w3.org/Home/Lassila”

         Structure
          –   Resource (subject)               http://www.w3.org/Home/Lassila
          –   Property (predicate)      http://www.schema.org/#Creator
          –   Value    (object)        "Ora Lassila”
         Directed graph

                                         s:Creator          Ora Lassila
      http://www.w3.org/Home/Lassila




213                      CS6795 Semantic Web Techniques                   22-Sep-06
      Another Example

         To add properties to Creator, point through an
          intermediate Resource.

                       http://www.w3.org/Home/Lassila

                                           s:Creator


                                              Person://fi/654645635


                                       Name                              Email



                                     Ora Lassila                      lassila@w3.org




214                 CS6795 Semantic Web Techniques                                     22-Sep-06
      Collection Containers

         Multiple occurrences of the same PropertyType
          don‟t establish a relation between the values
          –   The Millers own a boat, a bike, and a TV set
          –   The Millers need (a car or a truck)
          –   (Sarah and Bob) bought a new car
         RDF defines three special Resources:
          –   Bag     unordered values      rdf:Bag
          –   Sequence       ordered values rdf:Seq
          –   Alternative    single value   rdf:Alt
                  Core RDF does not enforce „set‟ semantics amongst
                   values


215                      CS6795 Semantic Web Techniques            22-Sep-06
      Example: Bag

         The students in
          course 6.001
           are Amy, Tim,    /courses/6.001
          John, Mary,                                   Rdf:Bag
          and Sue
                                             rdf:type
                                                                              /Students/Amy
                        students
                                                         rdf:_1
                                                                  rdf:_2      /Students/Tim

                               bagid1                              rdf:_3
                                                                              /Students/John
                                                                    rdf:_4

                                                                               /Students/Mary
                                                                     rdf:_5

                                                                               /Students/Sue


216                    CS6795 Semantic Web Techniques                                     22-Sep-06
      Example: Alternative

         The source code for X11 may be found at ftp.x.org,
          ftp.cs.purdue.edu, or ftp.eu.net

           http://x.org/package/X11
                                                  rdf:Alt
                                       rdf:type

                   source

                                                   rdf:_1
                             altid
                                                                ftp.x.org
                                                    rdf:_2

                                                              ftp.cs.purdue.edu
                                                     rdf:_3

                                                                 ftp.eu.net



217                          CS6795 Semantic Web Techniques                       22-Sep-06
      Statements About Statements
      (Requirement 2: Dispute Statements)


         Making statements about statements requires a
          process for transforming them into Resources
          –   subject            the original resource
          –   predicate          the original property
          –   object             the original value
          –   type               rdf:Statement




218                     CS6795 Semantic Web Techniques   22-Sep-06
      Example: Reification

         Ralph Swick believes that
           –   the creator of the resource
               http://www.w3.org/Home/Lassila is Ora Lassila
            http://www.w3.org/Home/Lassila                                            s:Creator
                                                              rdf:predicate
                                             s:Creator
                           rdf:subject

                                                  genid1

                          rdf:type                                            rdf:object
                                                         b:believedBy
          rdf:Statement                                                                Ora Lassila
                                              Ralph Swick




219                         CS6795 Semantic Web Techniques                                           22-Sep-06
      A Formal Model of RDF

         RDF itself is mathematically straightforward:

          –   Basic Definitions
                 Resources

                 Properties Resources
                 Literals

                 Statements  Properties  Resources               {Resources Literals}

          –   Typing
                 rdf:type Properties

                 {RDF:type, sub, obj} Statements obj Resources
                     –   for triples like {p,r1,r2} the RDF spec should use some different bracketing, like (p,r1,r2)


220                          CS6795 Semantic Web Techniques                                                  22-Sep-06
      Formal Model of RDF II

        –   Reification
                rdf:Statement  Resources \ Properties

               {rdf:predicate, rdf:subject, rdf:object } Properties
               Reification of a triple {pred, sub, obj} of Statements is an element r of Resources
                representing the reified triple and the elements s1, s2, s3, and s4 of Statements such
                that
                   – s1: {RDF:predicate, r, pred}
                   – s2: {RDF:subject, r, sub}
                   – s3: {RDF:object, r, obj}
                   – s4: {RDF:type, r, [RDF:Statement]}


        –   Collections
               { RDF:Seq, RDF:Bag, and RDF:Alt } Resources \ Properties
               There is a subset of Properties corresponding to the ordinals (1, 2, 3, ...) called Ord.
                We refer to
               elements of Ord as RDF:_1, RDF:_2, RDF:_3, ...

221                      CS6795 Semantic Web Techniques                                       22-Sep-06
       RDF Syntax I

          Data model does not enforce particular syntax
          Specification suggests many different syntaxes
           based on XML
          General form:
                             Starts an RDF-Description             Subject (OID)

      <rdf:RDF>
        <rdf:Description about="http://www.w3.org/Home/Lassila">
           <s:Creator>Ora Lassila</s:Creator>
           <s:createdWith rdf:resource=“http://www.w3c.org/amaya”/>
        </rdf:Description>
      </rdf:RDF>
                                  Literal

                                                         Resource (possibly another RDF-description)
                Properties



222                          CS6795 Semantic Web Techniques                                   22-Sep-06
       Resulting Graph


                                   http://www.w3.org/Home/Lassila


                       s:Creator                                    s:createdWith



             Ora Lassila                                      http://www.w3c.org/amaya



      <rdf:RDF>
        <rdf:Description about="http://www.w3.org/Home/Lassila">
           <s:Creator>Ora Lassila</s:Creator>
           <s:createdWith rdf:resource=“http://www.w3c.org/amaya”/>
        </rdf:Description>
      </rdf:RDF>



223                        CS6795 Semantic Web Techniques                                22-Sep-06
       RDF Syntax II: Syntactic Varieties

         Typing Information                     Subject (OID)
                                                                            In-Element Property



      <s:Homepage rdf:about="http://www.w3.org/Home/Lassila”
                                     s:Creator=“Ora Lassila”/>

             <s:createdWith>
               <s:HTMLEditor rdf:about=“http://www.w3c.org/amaya”/>
             </s:createdWith>

      </s:Homepage>
                                                                rdf:type
      Property           http://www.w3.org/Home/Lassila                     s:Homepage


                              s:Creator
                                                            s:createdWith
                                                                                  rdf:type
                        Ora Lassila                 http://www.w3c.org/amaya                  HTMLEditor

224                             CS6795 Semantic Web Techniques                                    22-Sep-06
      RDF Schema (RDFS)



         RDF just defines the data model
         Need for definition of vocabularies for the data
          model - an Ontology Language!
         RDF schemas are Web resources (and have
          URIs) and can be described using RDF




225                 CS6795 Semantic Web Techniques      22-Sep-06
      Most Important Modeling Primitives

         Core Classes
           –   Root Class rdfs:Resource
           –   MetaClass rdfs:Class
           –   Literals rdfs:Literal
         rdfs:subclassOf property

         Inherited from RDF: properties (slots)
         rdfs:domain & rdfs:range
         rdfs:subPropertyOf property

         rdfs:label, rdfs:comment, etc.

         Inherited from RDF: InstanceOf (rdf:type)


226                     CS6795 Semantic Web Techniques   22-Sep-06
      RDF-Schema: Example (incomplete)


      s = rdfs:subClassOf                   rdfs:Resource


                                                                   s


                                                            xyz:MotorVehicle


                                        s                                      s
                                                              s
                            xyz:Van                                        xyz:Truck


                  s                   xyz:PassengerVehicle


                            xyz:MiniVan                       s




227                     CS6795 Semantic Web Techniques                                 22-Sep-06
      RDF-Schema: Example


      s = rdfs:subClassOf                            rdfs:Resource
      t = rdf:type
                                    s            t
                                                                            s

            t         rdfs:Class                         t
                                                                     xyz:MotorVehicle
                                             t
                          t
                                    t
                                                 s                                      s
                                                                       s
                                   xyz:Van                                          xyz:Truck
        t
                  s                          xyz:PassengerVehicle


                                   xyz:MiniVan                         s




228                           CS6795 Semantic Web Techniques                                    22-Sep-06
      Example: RDF-Schema in RDF-Schema

          Namespace-URL:
           http://www.w3.org/2000/01/rdf-schema#
          <rdfs:Class rdf:ID="Resource">
            <rdfs:label xml:lang="en">Resource</rdfs:label>
            <rdfs:label xml:lang="fr">Ressource</rdfs:label>
            <rdfs:comment>The most general class</rdfs:comment>
          </rdfs:Class>
          <rdfs:Class rdf:ID="Class">
            <rdfs:label xml:lang="en">Class</rdfs:label>
            <rdfs:label xml:lang="fr">Classe</rdfs:label>
            <rdfs:comment>The concept of Class</rdfs:comment>
            <rdfs:subClassOf rdf:resource="#Resource"/>
          </rdfs:Class>
          <rdf:Property ID="subClassOf">
            <rdfs:label xml:lang="en">subClassOf</rdfs:label>
            <rdfs:label xml:lang="fr">sousClasseDe</rdfs:label>
            <rdfs:comment>Indicates a subclass of a class</rdfs:comment>
            <rdfs:range rdf:resource="#Class"/>
            <rdfs:domain rdf:resource="#Class"/>
          </rdf:Property>


229                       CS6795 Semantic Web Techniques                   22-Sep-06
      Extensibility of RDF


         Define an Ontology of your Language with RDF
          Schema (like RDF-Schema itself)
         Describe Instance Data using your new
          Vocabulary
         Advantage: all Languages use the same Data
          Model (simplifies Interoperability)


230                  CS6795 Semantic Web Techniques   22-Sep-06
      Photo Archive Using RDF: Introduction


         W3C project for describing & retrieving (digitized)
          photos with (RDF) metadata
          –    Explained in a W3C Note by Yves Lafon and Bert Bos

         Metadata separated into three different schemas:
          1.   Dublin Core schema: Title, date, subject, etc.
          2.   Technical schema: Photo and camera details
          3.   Content schema: Vocabulary for DC "subject" property


231                    CS6795 Semantic Web Techniques           22-Sep-06
      Photo Archive Using RDF: Sample Photo




232           CS6795 Semantic Web Techniques   22-Sep-06
      Photo Archive Using RDF: Photo Metadata
      <?xml version="1.0"?>
      <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns="http://www.w3.org/1999/09/28-Photo-ns#"
         xmlns:DC="http://purl.oclc.org/dc/documents/rec-dces-199809.htm#"
         xmlns:Technical="http://www.w3.org/2000/PhotoRDF/technical-1-0#">
       <rdf:Description about="">
        <DC:Description>Waves breaking in a small gulf on an island near Brisbane</DC:Description>
        <DC:Type>image/jpeg</DC:Type>
        <DC:Subject>Landscape</DC:Subject>
        <DC:Source>35mm slide</DC:Source>
        <DC:Rights>http://www.w3.org/People/Lafon/Copyright?1998</DC:Rights>
        <DC:Title>Sea near Brisbane</DC:Title>
        <DC:Date>1998-04-20</DC:Date>
        <DC:Coverage>Brisbane - Australia</DC:Coverage>
        <DC:Creator>http://www.w3.org/People/Lafon/</DC:Creator>
        <Technical:devel-date>2000-05-01</Technical:devel-date>
        <Technical:lens>Minolta AF70-210</Technical:lens>
        <Technical:camera>http://www.w3.org/People/Lafon/Minolta800i</Technical:camera>
        <Technical:film>Fuji</Technical:film>
       </rdf:Description>
233   </rdf:RDF>
                           CS6795 Semantic Web Techniques                             22-Sep-06
      Photo Archive Using RDF: RDFS Excerpt
      This is an excerpt of a minimal RDF Schema for the Dublin Core:
      Each property is a restriction of the DC property of the same name,
      as found in http://purl.org/dc/elements/1.1/ :
      <rdf:RDF xmlns:rdfs="http://www.w3.org/TR/1999/PR-rdf-schema-19990303#“
               xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

      <rdf:Property rdf:ID="title">
       <rdfs:label xml:lang="en">Title</label>
       <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/elements/1.1/title"/>
      </rdf:Property>

      <rdf:Property rdf:ID="creator">
       <rdfs:label xml:lang="en">Author/creator</label>
       <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/elements/1.1/creator"/>
      </rdf:Property>

      <rdf:Property rdf:ID="subject">
       <rdfs:label xml:lang="en">Subject</label>
       <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/elements/1.1/subject" />
       <rdfs:range rdf:resource="http://www.w3.org/2000/PhotoRDF/content-1-0#Keywords"/>
      </rdf:Property>
      . . .
234   </rdf:RDF>         CS6795 Semantic Web Techniques                         22-Sep-06
      Protégé-2000 as RDF[S]-Editor




                                          <rdfs:Class rdf:about="&mv;MotorVehicle">
                                             <rdfs:subClassOf rdf:resource="&rdfs;Resource"/>
                                          </rdfs:Class>
                                          <rdfs:Class rdf:about="&mv;PassengerVehicle">
                                             <rdfs:subClassOf rdf:resource="&mv;MotorVehicle"/>
                                          </rdfs:Class>
                                          <rdf:Property rdf:about="&mv;rearSeatLegRoom"
                                             a:maxCardinality="1" a:range="integer">
                                             <rdfs:domain rdf:resource="&mv;MotorVehicle"/>
                                             <rdfs:range rdf:resource="&rdfs;Literal"/>
                                          </rdf:Property>


235            CS6795 Semantic Web Techniques                                          22-Sep-06
      Ontology Languages on Top of RDF:
      The Principle
       Legend:
                                                  Instance
      Definition uses the                         Data
      data model of

      Defined in terms of

                            Ontology
      Is extension of       Language                         RDF Schema




                                                    RDF




236                         CS6795 Semantic Web Techniques          22-Sep-06
      The Semantic Web

         A Web of machine understandable Data, based on declarative
          languages on top of RDF (all use the same data model!)
         Intelligent Agent enabling architecture
         W3C‟s vision for the Semantic Web Architecture:




237                   CS6795 Semantic Web Techniques             22-Sep-06
      Tools

         Tools for RDF and RDF Schema
          –   Editors
                  Protégé-2000 (SMI)
                  HTML Annotation Tool (Siegfied Handschuh)
          –   Parsers and Generators
                  RDF-API (Sergey Melnik, Stanford)
          –   Query and Inference Engines
                  N3 (Tim Berners-Lee)
                  Squish (Libby Miller)
                  SiLRI (Stefan Decker & Juergen Angele)
                  TRIPLE (Stefan Decker and Michael Sintek)

238                       CS6795 Semantic Web Techniques       22-Sep-06
      RDF Resources

         RDF-Editor: Protégé
          www-smi.stanford.edu/projects/protege
         RDF-Parser and APIs/Query Engines
          –   http://www-db.stanford.edu/~melnik/rdf
          –   http://www.aifb.uni-karlsruhe.de/~sde/rdf
         RDF Knowledge Sources
          –   DMOZ - Open Directory (largest human created Web-
              directory) http://www.dmoz.org
         General Information:
          –   RDF Interest Mailing list: www-rdf-interest@w3.org
              Archive: http//lists.w3.org/Archives/Public/www-rdf-interest/
          –   SemanticWeb.org

239                    CS6795 Semantic Web Techniques               22-Sep-06
      Open Issues of RDF



         RDF-Schema is still evolving
         URIs: What is the URI of a person?
          Other real world entity?
         “Killer Applications”: Search Engines? B2B-
          Communication (e.g. ebXML.org ?)
         Interoperability between RDF-Schemas


240                 CS6795 Semantic Web Techniques      22-Sep-06
      Description Logic:
      Class-Forming Operations




241           CS6795 Semantic Web Techniques   22-Sep-06
      e-Business Example in Description Logic:
      Classification - Before -

       s = rdfs:subClassOf




                                    Organisation

                                        s

                               s

                                       Business                      ForProfit
                                                         operation




         Electronic                    Cybershop                     ForProfit
                      transaction                        operation



242                     CS6795 Semantic Web Techniques                      22-Sep-06
      e-Business Example in Description Logic:
      Classification - After -

       s = rdfs:subClassOf




                                    Organisation

                                        s




                                       Business                      ForProfit
                                                         operation

                               s


         Electronic                    Cybershop
                      transaction



243                     CS6795 Semantic Web Techniques                     22-Sep-06
      Class Intersection:
      Example

      s = rdfs:subClassOf




                                                      TallThing


                                            s                            Man


                                                                                     s




                            TallMan := TallThing Π Man

             Intensional conjunction of classes: TallThingΠMan(x)  TallThing(x)  Man(x)
             Intensional disjunction of classes similar but computationally more complex
244                        CS6795 Semantic Web Techniques                                   22-Sep-06
      Class Intersection and Definition:
      Example

       s = rdfs:subClassOf
      := = daml:Class




                                                 TallThing


                                         s                   Man

                                    :=
              TallMan                                              s




                             TallMan := TallThing Π Man




245                      CS6795 Semantic Web Techniques                22-Sep-06
      Class Complement:
      Example

      c = daml:complementOf




                                                         Person


                                                                  c




                               Car       ¬Person



246                     CS6795 Semantic Web Techniques                22-Sep-06
      Class Complement and Subsetting:
      Example

      s = rdfs:subClassOf
      c = daml:complementOf




                                                         Person

                                  s
               Car                                                c




                               Car       ¬Person



247                     CS6795 Semantic Web Techniques                22-Sep-06
      Qualified Role:
      Example

      t = rdf:type




                                                                  Over17

                                                                   age      t




                            RipeThing := age.Over17

                              Existential role: age.Over17(x)  y age(x,y)  Over17(y)
                              Universal role similar
248                  CS6795 Semantic Web Techniques                               22-Sep-06
      Qualified Role and Definition :
      Example

       t = rdf:type
      := = daml:Class




                                                           Over17
                               :=
             RipeThing                                      age     t




                                RipeThing := age.Over17



249                      CS6795 Semantic Web Techniques                 22-Sep-06
      DAML+OIL




250          CS6795 Semantic Web Techniques   22-Sep-06
      DARPA Agent Markup Language, OIL,
      and OWL
         OIL: European Ontology Interchange Language
         DARPA funded Research Program (also funded
          the Development of the ARPANNET -> Internet):
          –   Foundation for the Semantic Web: http://www.daml.org
         Ontology Language DAML+OIL: Result of a Joint
          (European + American) Committee
         Rule Language SWRL, jointly with RuleML
         W3C‟s recent OWL (Web Ontology Language)
          mainly divides DAML+OIL into three sublanguages:
          –   OWL Light: Frames
          –   OWL DL: Description logic
          –   OWL Full: A proper superset of DL and RDFS
251                   CS6795 Semantic Web Techniques         22-Sep-06
      DAML+OIL

         Extension of RDF Schema
         Ontology Language DAML+OIL: Result of a Joint
          (European + US-American) Committee
         Extension of RDF Schema
          –   Class Expressions (Intersection, Union, Complement)
          –   XML Schema Datatypes
          –   Enumerations
          –   Property Restrictions
                  Cardinality Constraints
                  Value Restrictions



252                      CS6795 Semantic Web Techniques       22-Sep-06
       Example: Intersection & Synonyms

      <daml:Class rdf:ID="TallMan">
        <daml:intersectionOf rdf:parseType="daml:collection">
           <daml:Class rdf:about="#TallThing"/>
           <daml:Class rdf:about="#Man"/>
        </daml:intersectionOf>
      </daml:Class>


      <daml:Class rdf:ID="HumanBeing">
        <daml:sameClassAs rdf:resource="#Person"/>
      </daml:Class>




253                CS6795 Semantic Web Techniques    22-Sep-06
      Example: Disjoint & Complement

      <daml:Disjoint rdf:parseType="daml:collection">
        <daml:Class rdf:about="#Car"/>
        <daml:Class rdf:about="#Person"/>
        <daml:Class rdf:about="#Plant"/>
      </daml:Disjoint>

      Disjoint not strictly necessary, since expressible via pairwise subClassOf
      of complementOf, as for Car and Person:
      <daml:Class rdf:ID="Car">
        <rdfs:comment>no car is a person</rdfs:comment>
        <rdfs:subClassOf>
           <daml:Class>
            <daml:complementOf rdf:resource="#Person"/>
           </daml:Class>
        </rdfs:subClassOf>
      </daml:Class>
254                     CS6795 Semantic Web Techniques                    22-Sep-06
       Example: Properties
       (Transitive, Inverse, subProperty, UniqueProperty, range, Datatypes)


      <daml:TransitiveProperty rdf:ID="hasAncestor"/>

       <daml:ObjectProperty rdf:ID="hasChild">
         <daml:inverseOf rdf:resource="#hasParent"/>
       </daml:ObjectProperty>

      <daml:UniqueProperty rdf:ID="hasMother">
        <rdfs:subPropertyOf rdf:resource="#hasParent"/>
        <rdfs:range rdf:resource="#Female"/>
      </daml:UniqueProperty>




      <daml:DatatypeProperty rdf:ID="age">
         <rdf:type rdf:resource="http://www.daml.org/2001/03/daml+oil#UniqueProperty"/>
         <rdfs:range rdf:resource="http://www.w3.org/.../XMLSchema#nonNegativeInteger"/>
      </daml:DatatypeProperty>

255                        CS6795 Semantic Web Techniques                       22-Sep-06
       Using User-defined Datatypes
       (based on XML Schema)
      <xsd:simpleType name="over17">
        <!--over17 is an XMLS datatype based on decimal-->
        <!--with the added restriction that values must be >=18-->
        <xsd:restriction base="xsd:decimal">
          <xsd:minInclusive value="18"/>
        </xsd:restriction>
      </xsd:simpleType>


      <daml:Class rdf:ID="Adult">
        <daml:intersectionOf rdf:parseType="daml:collection">
           <daml:Class rdf:about="#Person"/>
           <daml:Restriction>
             <daml:onProperty rdf:resource="#age"/>
             <daml:hasClass rdf:resource="somefile#over17"/>
           </daml:Restriction>
        </daml:intersectionOf>
      </daml:Class>
256                  CS6795 Semantic Web Techniques       22-Sep-06
      Instances (Individuals)

      <Person rdf:ID="Adam">
        <rdfs:label>Adam</rdfs:label>
        <rdfs:comment>Adam is a person.</rdfs:comment>
        <age><xsd:integer rdf:value="13"/></age>
        <shoesize>
           <xsd:decimal rdf:value="9.5"/>
        </shoesize>
      </Person>


      <daml:Class rdf:ID="Person">
        . . .
      </daml:Class>




257                 CS6795 Semantic Web Techniques       22-Sep-06
      Protégé as OIL Editor

         supports following subset of OIL:
           –   class definitions with subclass and slot constraints (property restrictions) with
                    class expressions: and, or, not, class[names], slot constraints, top, and bottom
                    slot constraints: has-value, value-type, max-cardinality, min-cardinality, cardinality
                    missing: concrete-type-exp, filler-exp
           –   slot definitions:
                    subslot-of, inverse (using Protégé's inverse slot mechanism), domain, range
                    properties (transitive, symmetric, functional)
           –   global axioms (disjoint, covered, disjoint-covered, equivalent)
           –   missing: instance-of, related
         special widgets for displaying OIL expressions
         connects to FaCT description logic classifier for classification and
          satisfiability checking
         generates SHIQ LaTeX output

258                           CS6795 Semantic Web Techniques                                       22-Sep-06
      Protégé as OIL Editor: Screenshot




259            CS6795 Semantic Web Techniques   22-Sep-06
      TRIPLE




260            CS6795 Semantic Web Techniques   22-Sep-06
      TRIPLE: Motivation

         RDF data available
         Needed: Query and Inference Language for/in
          RDF
         Existing Approaches:
          –   SiLRI
          –   Metalog
          –   RQL
          –   …




261                     CS6795 Semantic Web Techniques   22-Sep-06
      What’s wrong with existing
      approaches?

         Built in Semantics (e.g. SiLRI, RQL)
          –   Many RDF based languages with different Semantics
              (DAML+OIL, RDF-Schema, UML/RDF,…)

         No support for RDF-Models
          –   One large heap of RDF-Data




262                   CS6795 Semantic Web Techniques        22-Sep-06
      Graph Separated in Models

      source1                                    source2
                                                           source3




263             CS6795 Semantic Web Techniques                 22-Sep-06
      New System: Triple

         Native support for
          – Resources + Namespaces
          – Models (sets of RDF statements)
          – Reification
          – Data Integration/Translation
          – Rules with Expressive Bodies (Full FOL Syntax)




264                CS6795 Semantic Web Techniques   22-Sep-06
      Object Expressions + Models



         http://..123[age->”32”;spouse->http//..256].
         http://..123[age->”32”;spouse->http//..256[age->”31”]].
         http://..123[age->”32”]@mod1
         http://..123[age->”32”]@(mod1 intersect mod2)
         http://..123[age->”32”]@(mod1 union mod2)
         http://..123[age->”32”]@(mod1 \ mod2)
         http://..123[age->”32”]@test(X)




265                    CS6795 Semantic Web Techniques               22-Sep-06
      Reification


                             hasAuthor
         http://…1234                             “Ora Lassila”


                                                                  believedBy




                                                            “Ralph Swick”



      <http://…1234[hasAuthor->”OraLassila”]>[believedBy->”Ralph Swick”].




266                     CS6795 Semantic Web Techniques                     22-Sep-06
       Example: RDF-Schema
                                                                            Namespace
                                                                            Declarations
      rdf := 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'.
      rdfs := 'http://www.w3.org/TR/1999/PR-rdf-schema-19990303#'.
                                                                          Abbreviations
      type := rdf:type.
      subPropertyOf := rdfs:subPropertyOf.
      subClassOf := rdfs:subClassOf.                                       Model Block
      FORALL Mdl @rdfschema(Mdl) {
       FORALL O,P,V O[P->V] <- O[P->V]@Mdl.
       FORALL O,P,V O[P->V] <- EXIST S S[subPropertyOf->P] AND O[S->V].       Transitivity
       FORALL O,V O[subClassOf->V] <-                                            Rule
          EXISTS W (O[subClassOf->W] AND W[subClassOf->V]).
      FORALL O,V O[subPropertyOf->V] <-
          EXISTS W (O[subPropertyOf->W] AND W[subPropertyOf->V]).
       FORALL O,T O[type->T] <-
          EXISTS S (S[subClassOf->T] AND O[type->S]).}



267                            CS6795 Semantic Web Techniques                      22-Sep-06
      Mapping to Horn Logic

       first implementation (and informal semantics) by mapping
         to Horn Logic / XSB system (Prolog with tabled resolution)
       Lloyd-Topor transformation for quantifiers etc.
       RDF-specific transformations given as rewrite rules:




268                       CS6795 Semantic Web Techniques              22-Sep-06
      Summary

         New RDF specific Query and Inference Language
         Allows specification of multiple semantics
         Integration/Translation of heterogeneous data
          (InterDataWorking.com)
         Every Horn Logic Inference Engine can be used
         Provides a formal foundation for N3
         Part of RuleML ( http://www.dfki.de/ruleml )


269                 CS6795 Semantic Web Techniques       22-Sep-06
      Topic Maps




270           CS6795 Semantic Web Techniques   22-Sep-06
      Topic Maps

      • Aiming at User Support for classifying and navigating large corpora
        of resources
      • Topic Navigation Maps generalize:
          – indexes
          – glossaries
          – thesauri
          – catalogs
          – cross-references
      • Allow browsing as well as querying of Information
      • ISO Standard (ISO13250) (defined by the SGML/XML Community)


271                      CS6795 Semantic Web Techniques              22-Sep-06
      Topic Navigation Maps in a Nutshell I

      • Topics (e.g. Germany)
          – have a topic-type (e.g. Country)
          – at least one base-name (Germany)
          – multiple display names (e.g. Federal Republic of Germany)
          – have occurrences (in external resources)
            (eg. In CIA-World Fact Book:
            http://www.odci.gov/cia/publications/factbook/gm.html)
              • occurrences have a role: eg. “MENTION” (again a
                 Topic)




272                  CS6795 Semantic Web Techniques          22-Sep-06
      Topic Navigation Maps in a Nutshell II

         Topics can be related to each other via associations
          (eg. “Rau is_head_of Germany”)
         Association-Types (eg. “is_head_of”) are again a topics.
         Association-Roles define the role of a topic in a
          association
          (“President” for “Rau”, and “Country” for “Germany”).
          Association-Roles are again topics.
         An association may have a scope
          (eg. “Rau is_head_of Germany” has scope “1999-now”)
         Axioms (eg. Transitivity or Symmetry) are considered
          useful, but not part of the ISO-Standard


273                   CS6795 Semantic Web Techniques            22-Sep-06
      Example of a Browsing Interface




274            CS6795 Semantic Web Techniques   22-Sep-06
      XML Topic Maps (XTM): Design Goals

      1.    XTM shall be straightforwardly usable over the Internet
      2.    XTM shall support a wide variety of applications
      3.    XTM shall be compatible with XML, XLink, and ISO 13250
      4.    It shall be easy to write programs that process XTM
            documents
      5.    The number of optional features in XTM is to be kept to the
            absolute minimum, ideally zero
      6.    XTM documents should be human-legible and reasonably
            clear
      7.    The XTM design should be prepared quickly
      8.    The design of XTM shall be formal and concise
      9.    XTM documents shall be easy to create
      10.   Terseness in XTM markup is of minimal importance
275                    CS6795 Semantic Web Techniques            22-Sep-06
      XML Topic Maps (XTM): Purpose of a
      Topic Map


      The purpose of a topic map is to
        convey knowledge about resources
        through a superimposed layer, or map,
           of the resources

      A topic map captures
            the subjects of which resources speak,
            and the relationships between
      subjects, in a way that is implementation-
      independent
276             CS6795 Semantic Web Techniques   22-Sep-06
      XML Topic Maps (XTM): Topics,
      Associations, and Occurrences

      •   A topic is a resource within the computer that stands in for
          (or “reifies”) some real-world subject. Examples of subjects:
          the play Hamlet, the playwright William Shakespeare, or
          the “authorship” relationship
      •   Topics can have names. They can also have occurrences:
          information resources considered relevant to their subject.
          Finally, topics can participate in relationships, called
          associations, in which they play roles as members
      •   Thus, topics have three kinds of characteristics: names,
          occurrences, and roles played as members of associations.
          Characteristics considered valid within scope or context
      •   Topic maps can be merged: at the discretion of the user or
          application (at runtime), or indicated by the topic map's
          author at the time of its creation
      •   Terseness in XTM markup is of minimal importance
277                  CS6795 Semantic Web Techniques             22-Sep-06
      XML Topic Maps (XTM):
      Sample Topic

      A topic representing one of William Shakespeare's plays
      in XTM might look like this:


      <topic id="hamlet">
       <instanceOf><topicRef xlink:href="#play"/></instanceOf>
       <baseName>
         <baseNameString>Hamlet, Prince of Denmark</baseNameString>
       </baseName>
       <occurrence>
         <instanceOf>
           <topicRef xlink:href="#plain-text-format"/>
         </instanceOf>
         <resourceRef
           xlink:href="ftp://www.gutenberg.org/pub/gutenberg/etext97/1ws2610.txt"/>
       </occurrence>
      </topic>

278                     CS6795 Semantic Web Techniques                         22-Sep-06
      XML Topic Maps (XTM):
      Sample Association

      An association representing the relationship
      between Shakespeare and the play Hamlet
      might look like this:

      <association>
       <instanceOf><topicRef xlink:href="#written-by"/></instanceOf>
       <member>
         <roleSpec><topicRef xlink:href="#author"/></roleSpec>
         <topicRef xlink:href="#shakespeare"/>
       </member>
       <member>
        <roleSpec><topicRef xlink:href="#work"/></roleSpec>
        <topicRef xlink:href="#hamlet"/>
       </member>
      </association>
279                    CS6795 Semantic Web Techniques            22-Sep-06
      Acknowledgements

         Stefan Decker and Michael Sintek for their key contributions to starting it all:

          http://www.dfki.uni-kl.de/km/knowmark/, http://www.dfki.uni-kl.de/km/kmrs/

         William Grosso, Rohit Khare, Peter Karp, Dan Brickley for their kind permission

          to use material

         Andreas Abecker, Heiko Maus, Andreas Lauer, Hansi Hein, Stefan Klink, Bertin

          Klein, and other colleagues at DFKI for fruitful discussions

         All colleagues at Karlsruhe, Stanford, ISI, NRC, and UNB for related interactions

         Peter Fankhauser for valuable input on query languages

         Elliotte Rusty Harold for his XML Bible: http://www.ibiblio.org/xml/books/bible2/

         The Joint (Agent Markup Language) Committee and the Rule Markup Initiative

          for discussions: http://www.daml.org/committee/, http://www.ruleml.org
280                         CS6795 Semantic Web Techniques                           22-Sep-06
      References




281           CS6795 Semantic Web Techniques   22-Sep-06
      References

      Cocoon
               The Cocoon Publishing Framework. Available at http://xml.apache.org/cocoon/index.html

      CSS2
               Cascading Style Sheets, level 2. Available at http://www.w3.org/TR/REC-CSS2/

      DAML
               DARPA Agent Markup Language. Availabe at http://www.oasis-open.org/cover/daml.html ,
               http://dtsn.darpa.mil/iso/programtemp.asp?mode=347 , and http://www.daml.org/

      Dublin Core
              Available at http://purl.oclc.org/dc/

      Fernandez99
             XML Query Languages: Experiences and Exemplars, Mary Fernandez, Jérôme Siméon, Philip Wadler,
             1999. Available at http://www.w3.org/1999/09/ql/docs/xquery.html

      FRODO
               The FRODO Project. Homepage available at http://www.dfki.uni-kl.de/frodo/

      OIL
               Ontology Interchange Language. Availabe at http://www.ontoknowledge.org/oil/

      Protégé-XML
              The Protégé XML-Tab. Available at http://smi-web.stanford.edu/people/sintek/


282                                CS6795 Semantic Web Techniques                                      22-Sep-06
      References

      Q&T
               Querying and Transforming XML. Available at http://www.w3.org/TandS/QL/QL98/pp/query-transform.html

      RACSA
               Online Demo at http://www.dfki.de/racsa/

      RDF
               Homepage: http://www.w3.org/RDF/
               Specification: http://www.w3.org/TR/REC-rdf-syntax
               FAQ: http://www.w3.org/RDF/FAQ
               Tutorial: Carl Lagoze et al: WWW7 Tutorial. Available at http://purl.oclc.org/~emiller/talks/www7/tutorial

      RDF-Schema
            Specification at http://www.w3.org/TR/rdf-schema

      RuleML
               The Rule Markup Language. Homepage at http://www.ruleml.org or http://www.dfki.de/ruleml

      Semantic Web
             Portal at http://www.SemanticWeb.org

      SHOE
               Simple HTML Ontology Extensions. Available at http://www.cs.umd.edu/projects/plus/SHOE/

      XML
               Extensible Markup Language (XML), Version 1.0. W3C Recommendation. Available at
               http://www.w3.org/TR/1998/REC-xml-19980210
283                               CS6795 Semantic Web Techniques                                                 22-Sep-06
      References

      XML Namespaces
            Namespaces in XML. W3C Recommendation at http://www.w3.org/TR/REC-xml-names/

      XML-QL
               XML-QL: A Query Language for XML. Available at http://www.w3.org/TR/NOTE-xml-ql/

      XML-RPC
            XML Remote Procedure Calls. Available at http://www.xmlrpc.com/

      XPath
               World Wide Web Consortium. XML Path Language. W3C Recommendation. Available at
               http://www.w3.org/TR/xpath

      XPointer
              World Wide Web Consortium. XML Pointer Language (XPointer). W3C Working Draft. Available at
              http://www.w3.org/TR/xptr

      XQuery
               A Query Language for XML. Available at http://www.w3.org/TR/xquery/

      XQL
               XML Query Language (XQL). Available at http://www.w3.org/TandS/QL/QL98/pp/xql.html

      XSL
               World Wide Web Consortium. Extensible Stylesheet Language (XSL). W3C Working Draft. Available at
               http://www.w3.org/TR/WD-xsl

      XSLT
               World Wide Web Consortium. XSL Transformations (XSLT). W3C Recommendation. Available at
               http://www.w3.org/TR/xslt


284                               CS6795 Semantic Web Techniques                                        22-Sep-06

				
DOCUMENT INFO
mikesanye mikesanye
About