SNSW Co3
SNSW Co3
&
Semantic Web
CO 3: Knowledge Representation on the Semantic Web
Need
The key idea of the Semantic Web is to represent information
on and about the current Web using formal languages that
computers can process and reason with.
Recapturing the information on the current Web and adding
additional descriptions of Web resources (metadata) would
allow our machines to support us in performing intelligent
tasks such as providing analysis by combining information
from multiple sources.
The field of expert systems has developed a number of logic-
based knowledge representation languages for describing
both the domain knowledge and task knowledge of such
systems.
RDF was not conceived for the task of structuring documents like XML (Tree), but rather for
describing general relationships between objects of interest.
RDF was intended to serve as a description language for data on the WWW and other
electronic networks. Information in these environments is typically stored and managed in
decentralized ways, and indeed it is very easy to combine RDF data from multiple sources.
The simple union of two tree structures is not a tree anymore, so that additional choices must be
made to even obtain a well-formed XML document when combining multiple inputs.
RDF:URIs
RDF uses so-called Uniform Resource Identifiers (URIs) that are generalization of
URLs.
In general this might be any object that has a clear identity in the context of the given
application: books, places, people, publishing houses, events, relationships among
such things, all kinds of abstract concepts, and many more.
Such resources can obviously not be retrieved online and hence their URIs are used
exclusively for unique identification.
URIs that are not URLs are sometimes also called Uniform Resource Names (URNs).
RDF:URIs
◦ Path:
Location of the resource
◦ Query:
The query is an optional part of the URI that provides additional non-hierarchical
information
◦ Fragment
The optional fragment part provides a second level of identifying resources
RDF: Model
The RDF data model vaguely resembles an object-oriented data model.
It consists of entities, represented by unique identifiers, and binary relationships, or
statements, between those entities.
RDF expressions are formed by making statements (triples) of the form (subject,
predicate, object).
The subject of a statement must be a resource (blank or with a URI), the predicate
must be a URI and the object can be either kind of resource or a literal.
In a graphical representation of an RDF statement, the source of the relationship is
called the subject, the labeled arc is the predicate (also called property), and the
relationship’s destination is the object.
Both statements and predicates are first-class objects, which means they can be used as
the subjects or objects of other statements (see the section on reifying statements)
RDF
Example: Delhi is capital of India
The triple generated from this sentence is:
<Delhi> <capital of> <India>.
where Delhi is the subject, capital of is the predicate and
India is the object.
RDF
The triples can also be represented in the form of URIs
(Uniform Resource Identifier).
1. <http://www.abc.org/subject/Delhi>
2. <http://www.abc.org/predicate/capitalOf>
3. <http://www.abc.org/object/India>.
Every statement is terminated by a full-stop in RDF
triple.
The shown is an example statement, which can be read as: “The
resource http://www.daml.org/projects/#11 has a property
hasHomepage (described in http://www.semanticweb.org/schema-
daml01/#hasHomepage) the value of which is the resource
http://www-db.stanford.edu/OntoAgents.”
RDF: Model The three parts of this statement are
◦ the subject http://www.daml.org/projects/#11
◦ the predicate http://www.semanticweb.org/schema-daml01/#hasHomepage
◦ the object http://www-db.stanford.edu/OntoAgents.
A set of statements can be visualized as a graph.
By adding the property http://purl.org/dc/elements/1.1/Creator with
RDF: Model value Stefan Decker (a literal).
RDF: Model
The RDF data model distinguishes between resources, which are object identifiers
represented by URIs, and literals, which are just strings.
The subject and the predicate of a statement are always resources, while the object
can be a resource or a literal.
In RDF diagrams, resources are always drawn as ovals, and literals are drawn as
boxes.
The XML-namespace syntax is used to abbreviate URIs in statements.
For instance, we can define the substitution of the namespace-prefix sw for
http://www.SemanticWeb.org/schema-daml01/#, and then write simply
sw:hasHomepage.
RDF:
By virtue of RDF Schema (short RDFS), a further part of the W3C RDF
recommendation which we will deal with in the following sections, this kind of
background information – so-called terminological knowledge or alternatively
schema knowledge – about the terms used in the vocabulary can be specified.
In the first place, RDFS is nothing but another particular RDF vocabulary.
Consequently, every RDFS document is a well-formed RDF document.
This ensures that it can be read and processed by all tools that support just
RDF, whereby, however, a part of the meaning specifically defined for RDFS
(the RDFS semantics) is lost.
RDFS: Classes & Instances
The predefined URI rdf:type is used to mark resources as instances of a class.
In order to clearly separate semantics and syntax, we always use the term “class”
to denote a set of resources (being entities of the real world), whereas URIs
which represent or refer to a class are called class names.
An URI does not provide direct information whether it refers to a single object
or a class.
RDFS: Classes & Instances
Therefore, RDFS provides the possibility to indicate
class names by explicitly “typing” them as classes. In
other words: it can be specified that, e.g., the class
ex:Textbook belongs to the class of all classes.
RDFS: Subclasses and Class Hierarchies
Ifwe now searched for instances of the class of books denoted by
ex:Book, the URI book:uri denoting “Foundations of Semantic Web
Technologies” would not be among the results.
as
RDFS: Restrictions
Web Ontology Language (OWL)
The Web Ontology Language (OWL) was designed to add
the constructs of Description Logics (DL) to RDF,
significantly extending the expressiveness of RDF Schema
both in characterizing classes and properties.
DLs are a family of formal knowledge representation
languages, used in artificial intelligence to describe and
reason about the relevant concepts of an application
domain.
DLs are of particular importance in providing a logical
formalism for ontologies and the Semantic Web.
Web Ontology Language (OWL)
The Web Ontology Language is in fact a set of three
languages with increasing expressiveness: OWL Lite,
OWL DL and OWL Full. These languages are extensions
of each other (OWL Lite ⊆ OWL DL ⊆ OWL Full) both
syntactically and semantically.
Although it is generally believed that languages of the
OWL family would be an extension of RDF(S) in the
same sense, this is only true for OWL Full, the most
expressive of the family (RDF(S) ⊆ OW LFull).
OWL Full: vocabulary
OWL Full: vocabulary
OWL Full: vocabulary
Comparison to the Unified Modelling Language
(UML)
UML is most commonly used in the requirements
specification and design of object oriented software in the
middle tier of enterprise applications.
The chief difference between UML and RDF(S)/OWL is
their modelling scope.
UML contains modelling primitives specific for a special
kind of information resource, namely objects in an
information system characterized by their static attributes
and associations, but also their dynamic behavior.
Comparison to the Unified Modelling Language
(UML)
Unique features of RDF/OWL
◦ Less Constrained than the UML,which means that many RDF models
have no equivalent in UML.
◦ OWL allows to describe defined classes, i.e. definitions that give
necessary and sufficient conditions for an instance to be considered as a
member of the class.
◦ RDF/OWL both treat properties as first class citizens of the language.
Properties are global: they do not belong to any class, while UML
attributes and associations are defined as part of the description of a
certain class.
◦ Properties can be defined as sub properties of other properties, This is
possible, but much less straightforward in UML.
Comparison to the Unified Modelling Language
(UML)
Unique features of UML
◦ UML has the notion of relationship roles, which is not present in
RDF/OWL.
◦ UML allows n-array relations, which are not part of RDF,
although they can be re-represented in a number of ways.
◦ Two common types of part-whole relations are available in UML
(aggregation and composition). These can be remodeled in OWL
to some extent.
◦ UML makes a distinction between attributes and associations.
This is also different from the distinction between datatype and
object-properties in OWL.
Comparison to E/R model and the relational
model
The Entity/Relationship (E/R) model is commonly used in
information modelling for the data storage layer of applications,
because it maps easily to the relational model used for defining
data structures in database management systems (RDBMS).
The E/R language contains the constructs that are necessary for
modelling information on the basis of relationships.
Relationships are characterized in terms of the arity of the
relationship and the participating entity sets.
Similar to the reification features in RDF and UML, the E/R
model also allows attaching attributes to a relationship and
including relationships in other relationships.
Comparison to E/R model and the relational
model
Comparison to the Extensible Markup Language
(XML) and XML Schema
Up to date XML is the most commonly used technology for the exchange of
structured information between systems and services. From all languages discussed
the role of XML is thus the most similar to RDF in its purpose.
The most commonly observed similarity between XML and RDF is a similarity
between the data models: a directed graph for RDF, and a directed, ordered tree
for XML.
Much like RDF, XML itself is merely a common conceptual model and syntax for
domain specific languages each with their own vocabulary.
schemas written in XML schema languages not only define the types of elements
and their attributes but also prescribe syntax i.e. the way elements are allowed to be
nested in the tree.
Unlike XML, Schema languages for RDF (RDF Schema and OWL) do not impose
constraints directly on the graph model but effect the possible interpretations of
metadata.
Comparison to the
Extensible Markup
Language (XML) and
XML Schema
Comparison to the Extensible
Markup Language (XML) and
XML Schema