Semantics and Ontologies


P2P technologies utilize the infrastructure of today's Web, which was originally designed for use by humans. The Web is now slowly being extended for use by machines. However, it can be argued that most of the current work in standards, protocols, and interoperability stacks is just facilitating the placement of bits on the wire, with little effort going toward actually understanding the meaning of those bits and the content of the data being transmitted. If the eventual goal of the evolution of the Web is to facilitate integration between human tasks and machine tasks, meaning and context must be taken into account. At a minimum, it is clear that fundamental tasks such as efficient distributed searching, one of the major initial uses for P2P technologies, and task composition in general, would be greatly enhanced if the machines being used for the tasks had some semantic knowledge of the data.

Resource Description Framework

Of course, there have been numerous discussions as to what constitutes understanding. Leaving such discussions for the academic types, let us at least agree to require that Web content, and resources in general, be marked up with some structured metadata that can be processed by machines. Metadata is an essential component that facilitates tasks in everyday life, and would be similarly beneficial if introduced into the framework of any Web-based activities, especially distributed computing activities such as P2P computing. XML is the first implementation that makes structured metadata possible, but XML is just a language, and another layer of meaning has to be built on top of it. This layer of meaning is increasingly being exposed through RDF, an application of XML developed under the auspices of the W3C.

RDF, as the name implies, is a framework that enables you to describe resources as structured metadata, and to exchange and reuse these resources in various possibly unrelated applications. It is built on the following three concepts:

  • Resource A resource is anything that can be uniquely identified by a URI. Resources usually have a reference ID for cross-referencing. Resources also have properties.

  • Property A property is a resource that has a name and can be used to describe other resources. A property is defined as a property-type with a corresponding value. The value can either be an atomic value, such as a string, or another resource. A collection of properties that refer to the same resource is called a description. RDF is essentially a mechanism to represent resources and their descriptions in a direct labeled graph (DLG). Property-types are namespace qualified, allowing different groups to use the same property-type name to mean different things.

  • Statement A statement is a combination of a resource, a property-type, and a value.

A simple RDF example that defines a small subset of the graph shown in Figure 23.1 is as follows:

 <?xml version="1.0"?>  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"    xmlns:books="urn:X-Seriousbooks.com/rdf/books/">    xmlns:who="urn:X-Seriousbooks.com/rdf/who/">    <rdf:Description rdf:       rdf:about="http://seriousbooks.com/books/surgery">       <books:title>DIY Surgery</books:title>       <books:author rdf:HREF="#Person_213"</books:author>       <books:author rdf:HREF="#Person_214"</books:author>       <books:editor rdf:HREF="#Person_014"</books:editor>    </rdf:Description>    <rdf:Description rdf:       rdf:about="http://seriousbooks.com/people/terry">       <who:name>Terry Mitchell</who:name>       <who:email>tm@seriousbooks.com</who:email>    </rdf:Description>    <rdf:Description rdf:       rdf:about="http://seriousbooks.com/people/joe">       <who:name>Joe Mitchell</who:name>       <who:email>jm@seriousbooks.com</who:email>    </rdf:Description> </rdf:RDF> 
Figure 23.1. The RDF representation of one of the books introduced in Chapter 11, showing the relationships between the various resources.

graphics/23fig01.gif

Ontologies

Having a framework to define resources and their relationship is only the first step. What if different applications use different identifiers from different RDF definitions to indicate the same thing? In order for them to interoperate and exchange information, they must reconcile the two terms. This next layer of meaning on top of RDF is provided by ontologies. The term ontology, originally meaning "concerned with the nature and relations of being" according to Merriam-Webster, has been abused by different communities. In general AI circles, it has come to mean a document containing set of formal definitions of relations among terms. Common ontologies contain a taxonomy of terms and a set of inference rules to make sense of the terms, usually in machine-readable form. For example, this will allow a computer to know that the terms author and creator, found in two different schemas, actually mean the same thing when applied to a book.

Currently, the most comprehensive and widely accepted effort that extends XML and RDF for specifying and manipulating ontologies is DAML+OIL, a joint effort combining a language sponsored by the Defense Advanced Research Projects Agency (DARPA) called DAML (DARPA Agent Markup Language), and a European Union Information Society Technologies-sponsored language called OIL (Ontology Inference Layer, or Ontology Interchange Language). The DAML+OIL language defines core resources along with a large number of ontologies, and allows you to express complex classifications and resources (http://www.daml.org).

Listing 23.1 shows an example of a DAML document, representing a very simple ontology for the bookstore examples from Chapter 11. The ontology defines a root class (Item), some subclasses (Book and Magazine), an instance of a Book, data types such as SKU and price, and an enumeration of book categories. Much more sophisticated relationships and rules (such as intersections, unions, and transitive relations) can be defined using the language.

Listing 23.1 Bookstore Ontology
 <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"          xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"          xmlns:daml="http://www.w3.org/2001/10/daml+oil#"          xmlns:xsd="http://www.w3.org/2000/10/XMLSchema#"          xmlns:dt="http://seriousbooks.com/dt"          xmlns:sbooks="http://seriousbooks.com/metadata/"          xml:base="http://seriousbooks.com/metadata/">   <daml:Ontology rdf:about="">     <daml:versionInfo>1.0</daml:versionInfo>     <rdfs:comment>       A very simple bookstore ontology     </rdfs:comment>     <daml:imports rdf:resource="http://www.daml.org/2001/03/daml+oil"/>   </daml:Ontology>   <daml:Class rdf:>     <rdfs:label>Item</rdfs:label>     <rdfs:comment>Anything we sell</rdfs:comment>     <daml:disjointUnionOf parseType="daml:collection">       <daml:Class rdf:>         <rdfs:label>In Stock</rdfs:label>         <rdfs:comment>We have it and can ship it</rdfs:comment>       </daml:Class>       <daml:Class rdf:>         <rdfs:label>Out Of Stock</rdfs:label>         <rdfs:comment>We don't have it</rdfs:comment>       </daml:Class>     </daml:disjointUnionOf>   </daml:Class>   <!  *****************SIMPLE INHERITANCE*****************  >   <daml:Class rdf:>     <rdfs:label>Book</rdfs:label>     <rdfs:subClassOf rdf:resource="#Item"/>   </daml:Class>   <daml:Class rdf:>     <rdfs:label>Magazine</rdfs:label>     <rdfs:subClassOf rdf:resource="#Item"/>   </daml:Class>   <!  *****************INSTANCES*****************  >   <sbooks:Book rdf:>     <rdfs:label>DIY Surgery</rdfs:label>     <sbooks:SKU>46540365</sbooks:SKU>     <sbooks:price>32.49</sbooks:price>     <sbooks:category rdf:resource="#Medical"/>   </sbooks:BackPack>   <!  *****************DATATYPE PROPERTIES***************** >   <daml:DatatypeProperty rdf:>     <rdfs:label>SKU</rdfs:label>     <rdfs:domain rdf:resource="#Item"/>     <rdfs:range rdf:resource=         "http://www.w3.org/2000/10/XMLSchema#nonNegativeInteger"/>     <rdf:type rdf:resource=         "http://www.daml.org/2001/03/daml+oil#UniqueProperty"/>   </daml:DatatypeProperty>   <daml:DatatypeProperty rdf:>     <rdfs:label>price</rdfs:label>     <rdfs:domain rdf:resource="#Item"/>     <rdfs:range rdf:resource="http://www.w3.org/2000/10/XMLSchema#float"/>   </daml:DatatypeProperty>   <!  *****************OBJECT PROPERTIES***************** >   <daml:ObjectProperty rdf:>     <rdfs:label>category</rdfs:label>     <daml:domain rdf:resource="#Item"/>     <daml:range rdf:resource="#BookCategory"/>   </daml:ObjectProperty>   <!  *****************ENUMERATIONS***************** >   <daml:Class rdf:>     <rdfs:label>BookType</rdfs:label>     <daml:oneOf rdf:parseType="daml:collection">       <daml:Thing rdf:>         <rdfs:label>Hiking</rdfs:label>       </daml:Thing>       <daml:Thing rdf:>         <rdfs:label>Travel</rdfs:label>       </daml:Thing>       <daml:Thing rdf:>         <rdfs:label>Camping</rdfs:label>       </daml:Thing>       <daml:Thing rdf:>         <rdfs:label>Mountaineering</rdfs:label>       </daml:Thing>     </daml:oneOf>   </daml:Class> </rdf:RDF> 


JavaT P2P Unleashed
JavaT P2P Unleashed
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 209

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net