Semantic Web (RDF)
Semantic Web (RDF)
(RDF)
What is RDF
• A typical Web page in the Semantic • The answer to the second question leads to the concept
Web world looks like the one of RDF (Resource Description Framework); to create a
shown in figure. markup file, one can use RDF language. RDF is the
language which is used to construct these metadata
• Two key questions we will have to files; we therefore realize the importance of RDF.
address are as follows: First, what
is this special file? Second, how is
it created?
• RDF is to the Semantic Web what HTML has been to the Web.
• RDF is an XML-based language for describing information contained in a Web resource. A Web
resource can be a Web page, an entire Web site, or any item on the Web that contains information in
some form.
• RDF provides a basis for coding, exchanging, and reusing structured metadata.
• RDF is structured; i.e., it is machine-understandable. Machines can do useful operations with the
knowledge expressed in RDF.
RDF DATA MODEL: THE BASIC ELEMENTS
OF RDF
• RESOURCE
• PROPERTY
• STATEMENT
RESOURCE
• The first key element is the resource. RDF is a standard for metadata.
• RDF offers a standard way of specifying data about something. This something can be
anything, and in the RDF world we call this something as resource
• A resource is identified by a uniform resource identifier (URI), and this URI is used as the
name of the resource. Why do we have to use a URI as the name of the resource? The
reason is summarized in the following rule:
• Rule #1: The name of a resource must be global. In other words, if you have a doubt that
someone else might also use the same name to refer to something else, then you cannot
use that name.
1. This resource is a real-world object, i.e., a Nikon D70 camera; it is a single lens reflex (SLR)
camera.
2. URL “http://www.yuchen.net/photography/SLR” is used as the first part of the URI. More
precisely, it is used as a namespace to guarantee that the underlying resource is uniquely
identified; this URL may or may not exist.
3. At the end of the namespace, “#” is used as the fragment identifier symbol to separate the
namespace from the local resource name, i.e., Nikon-D70.
4. Now the namespace + “#” + localResourceName gives us the final URI for the resource; it is
globally named.
PROPERTY
• Property is a resource that has a name and can be used as a property; i.e., it can be
used to describe some specific aspect, characteristic, attribute, or relation of the
given resource.
• An RDF statement is used to describe properties of resources. It has the following format:
• resource(subject) + property(predicate) + property value (object)
• Therefore, in general, an RDF statement indicates that a resource (the subject) is linked to another
resource (the object) via an arc labeled by a relation (the predicate). It can be interpreted as
follows:
<subject> has a property <predicate>, whose value is <object>
STATEMENT
• For example:
http://www.yuchen.net/photography/SLR#Nikon-D70 has a
http://www.yuchen.net/photography/SLR#weight whose value is 1.4 lb.
• This is certainly clear, but the drawback is that it is too long. Let us define the following
namespace:
xmlns:mySLR=http://www.yuchen.net/photography/SLR#
• Rule #2: Knowledge (or information) is expressed as a statement in the form of subject, predicate,
and object, and this order should never be changed.
• TABLE 1 : An RDF Triple Expressed in a Table Format
Subject Predicate Object
mySLR:Nikon-D70 mySLR:weight 1.4 lb
// format my question
question.subject = mySLR:Nikon-D70
question.predicate = mySLR:*;
// read all the RDF statements and store them in some array
rdfStatement[0].subject = mySLR:Nikon-D70;
rdfStatement[0].predicate = mySLR:weight;
rdfStatement[1].subject = mySLR:Nikon-D70;
rdfStatement[1].predicate = mySLR:pixel;
rdfStatement[2].subject = mySLR:Nikon-D50;
rdfStatement[2].predicate = mySLR:weight;
• Syntax names: RDF, Description, ID, about, parseType, resource, nodeID, datatype.
• We can interpret this RDF code as : The RDF document describes a resource whose name is Nikon-D70; it is an instance of
the class SLR, and its weight is 1.4 lb.