Chapter 2

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 54

Chapter 2

EXPRESSING
MEANING
WEB 2.0
WEB 3.0
The Semantic Web is about
◦ Capturing information, using standards-based formal knowledge
representation structures and mechanisms, to make such information
process-able by machines, thus facilitating its sharing and reuse across
disparate systems and applications.

The Resource Description Framework (RDF) is one of the


fundamental Semantic Web specifications.
Anything can be a resource, including physical things,
documents, abstract concepts, web pages, numbers, and
strings.
In RDF, the basic element of knowledge representation is
the triple.
Resource Description
Framework
RDF : Graph Database: is a model for data
publishing and interchange on the
Web standardized by W3C.
Being a graph database, triplestores store data as a network of
objects with materialized links between them.
This makes RDF triplestores the preferred choice for managing
highly interconnected data.
Triplestores are more flexible and less costly than a relational
database.
The RDF database often called a semantic graph database.
RDF can handle powerful semantic queries and of
using inference for uncovering new information out of the
existing relations.
X has Wife Y
Z has Parent X
Z has parent Y
Subject Predicate Object
X hasWife Y
Z hasParent X
Z hasParent Y
RidleyScott directed BladeRunner
S1 Address VidyaNagar
S2 Name Rama

Subject Predicate Object


RidleyScott directed BladeRunner
S1 Address VidyaNagar
S2 Name Rama
Title of movie as triple
bbladeRunner name BladeRunner

name
bladeRunner BladeRunner

bladeRunner releaseDate “June25,1982”

releaseDate
bladeRunner June25,1982
Triplestores offer several advantages compared to traditional
database management systems:

Flexibility: There’s no need to define a schema in advance, and no


need for artificial entities such as tables to represent a many to
many relationship. No predefined schema, means altering the data
model is easy.
Easy Import/Export: RDF can be imported or exported using the
standardized formats N-Triples or N-Quads. As a result, users aren’t
locked in to using a specific vendor’s implementation.
Efficient Querying: Triplestores can be queried using the language
SPARQL. Unlike queries using SQL, which become complicated and
inefficient if the database wasn’t designed with columns to join and
indexes to make the search efficient, triplestores can easily handle
complex queries.
Easy Sharing: Because triplestores use URIs, sharing data is
simple. This is an advantage for analytics programs that need to
bring together data from multiple sources.

Relationship Discovery: When combined with ontologies that


formally define the objects and their relationship types,
triplestores support inferencing that enables the discovery of
implicit facts and relationships.
Exercise
“Baron Way Building is located in Amsterdam.”
Represent above statement in terms of graph.
Add the statement “Amsterdam is a city.”
The Nightwatch was created by Rembrandt van Rijn.
The Nightwatch was created in 1642.
The Nightwatch has medium oil on canvas.
Rembrandt van Rijn was born in 1606.
Rembrandt van Rijn has nationality Dutch.
Johannes Vermeer has nationality Dutch.
Woman with a Balance was created by Johannes Vermeer.
Woman with a Balance has medium oil on canvas.
URI: Uniform Resource Identifier
Consider a list of plays that Shakespeare wrote, or These would
be represented as triples thus:

Subject Predicate Object


Shakespeare Wrote As You Like It
Shakespeare Wrote Henry V
Shakespeare Wrote Love’s Labours Lost
Shakespeare Wrote Measure for Measure
Shakespeare Wrote Twelfth Night
Shakespeare Wrote Winter’s Tale
Shakespeare Wrote Hamlet
Shakespeare Wrote Othello
Namespaces, URIs and Identity
IS there only one shakesphere? Will everyone
refer to same shakesphere?
In semantic web we have to be more specific and
which is achieved by URI a global identifier.
Note: URIs and URLs look exactly the same, and in
fact a URL is just a special case of the URI.
URI expressed as a qname has two parts: a namespace
and an identifier
Ex: geo:England
Note: geo has to be defined.
What happens, when we merge together the
information from these sources?
Is Combining of graph straightforward process?
only when it is known which nodes in each of the source graphs match.
The essence of the merge comes down to answering the
question, “when is a node in one graph the same node as a
node in another graph?”

We have labelled the nodes and edges in the graphs with


simple names, like Shakespeare or Wales.

On the Semantic Web, this is not sufficient information to


determine whether two nodes are really the same.

To merge graphs in a semantic web setting, we have to be


more specific.
Global naming is required when it is on web.
In RDF, this issue is resolved through the use of Uniform
Resource Identifiers, or URIs.
A URI provides a global identification for a resource that is
common across the web.
If two agents on the web want to refer to the same
resource, recommended practice on the web is for them to
agree to a common URI for that resource.
A node from one graph is merged with a node from another
graph, exactly if they have the same URI.
Produce an RDF graph that reflects the content of this table in such a way that the
information intent is preserved, but the data is now amenable for RDF operations like
merging and RDF query.
Solution
Each row in the table describes a single entity, all of the same
type. That type is given by the name of the table itself, Product.
We know certain information about each of these items, based on
the columns in the table itself; e.g., the model number, the
division, etc. We want to represent this data in RDF.
Since each row represents a distinct entity, each row will have a
distinct identifier -primary key in relational dB, For the semantic
web, we need a globally unique identifier. The simplest way to
form such an identifier is by having a single URI for the database.
Use that URI as the namespace for all the identifiers in the
database. Since this is a database for a manufacturing company,
let’s call that namespace mfg:.
The triples in result are a bit different from the triples
we used earlier.
while the subject and predicate of these triples are RDF
resources (complete with qname namespaces!), the
objects are not resources, but instead are literal data, i.e.,
strings, integers, etc.
RDF borrows from XML all the literal data types as
possible values for the object of a triple; in this case, the
types of all data are strings or integers.
The usual interpretation of a table is that each row in the table
corresponds to one individual, and that the type of these
individuals corresponds to the name of the table. Each row
corresponds to a Product. We can represent this in RDF by
adding one triple per row that specifies the type of the individual
described by each row, as follows:
Making a statement about another statement. This
process is called reification.
Shakespeare wrote Hamlet in 1604, or
Wikipedia states that Shakespeare wrote Hamlet in
1604
Sample Questions
Express a given statement in triples.
Convert the given relational database into RDF
representation.
Given two graphs merge the graphs using semantic
modeling.
Definition of URI, Namespace with example.
2nd chapter completed

THANK YOU 

07/05/2024 54

You might also like