[go: up one dir, main page]

0% found this document useful (0 votes)
80 views13 pages

Semantic Web - Unit3 - Questions and Answers

Uploaded by

vanaprabhu01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views13 pages

Semantic Web - Unit3 - Questions and Answers

Uploaded by

vanaprabhu01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Semantic Web

Unit-3
1. A) Define the RDF.

Ans: The Resource Description Framework (RDF) is a W3C standard for describing
Web resources, such as the title, author, modification date, content, and copyright
information of a Web page. RDF stands for Resource Description Framework

 RDF is a framework for describing resources on the web


 RDF provides a model for data, and a syntax so that independent parties can
exchange and use it
 RDF is designed to be read and understood by computers
 RDF is not designed for being displayed to people
 RDF is written in XML
 RDF is a part of the W3C's Semantic Web Activity
 RDF is a W3C Recommendation

B) Explain the RDF Triple with neat diagram.


Ans. The RDF model is often called a “triple” because it has three parts, as subject,
predicate, and an object.
The following figure shows the RDF Triple model with symbols and associations.

Subject. In grammar, this is the noun or noun phrase that is the doer of the action. In
the sentence “The company sells batteries,” the subject is “the company.”

1
The subject of the sentence tells us what the sentence is about. In logic, this is the term
about which something is asserted. In RDF, this is the resource that is being described
by the ensuing predicate and object. Therefore, in RDF, we want a URI to stand for the
unique concept “company” like “http://www.business.org/ontology/#company” to
denote that we mean a form of business ownership and not friends coming for a visit.
Predicate. In grammar, this is the part of a sentence that modifies the subject and
includes the verb phrase. Returning to our sentence “The company sells batteries,” the
predicate is the phrase “sells batteries.” In other words, the predicate tells us something
about the subject. In logic, a predicate is a function from individuals (a particular type
of subject) to truth values with an arity based on the number of arguments it has. In
RDF, a predicate is a relation between the subject and the object. Thus, in RDF, we
would define a unique URI for the concept “sells” like “http://www.business.org/
ontology/#sells”.
Object. In grammar this is a noun that is acted upon by the verb. Returning to our
sentence “The company sells batteries,” the object is the noun “batteries.” In logic, an
object is acted upon by the predicate. In RDF, an object is either a resource referred to
by the predicate or a literal value. In our example, we would define a unique URI for
“batteries” like “http://www.business.org/ontology/#batteries”.
C) What is RDF container? Demonstrate types of RDF containers with an
example.
Ans. The container model allows groups of resources or values. RDF containers are
different than XML containers in that they are explicit.
Three types of RDF containers are available to group resources or literals:
Bag. An rdf:bag element is used to denote an unordered collection. Dupli- cates are
allowed in the collection. An example of when to use a bag would be when all members
of the collection are processed the same without concern for order.
Sequence. An rdf:seq element is used to denote an ordered collection (a “sequence”
of elements). Duplicates are allowed in the collection. One reason to use a sequence
would be to preserve the alphabetical order of elements. Another example would be to
process items in the order in which items were added to the document.
Alternate. An rdf:alt element is used to denote a choice of multiple values or
resources. This is referred to as a choice in XML. Some examples would be a choice
of image formats (JPEG, GIF, BMP) or a choice of makes and models, or any time you
wish to constrain a value to a limited set of legal values.
2. A) Describe RDF reification.
Ans: Reification allows higher-level statements to capture knowledge about other
statements.
2
Reification allows us to treat a statement as the object of another statement. This is
often referred to as “making statements about statements” and is called reification.
B) Illustrate about RDF reification with an example.
Ans: Reification allows you to treat a statement as the object of another statement. This
is often referred to as “making statements about statements” and is called reification.
The following statements shows a simple example of reification.
@prefix : <http://example.org/onto#>.
@prefix earl: <http://www.w3.org/2001/03/earl/0.95#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix dc: <http://purl.org/dc/elements/1.1/>.
:Jane earl:asserts
[ rdf:subject :MyPage; rdf:predicate earl:passes;
rdf:object “Accessibility Tests” ];
earl:email <mailto:Jane@example.org>;
earl:name “Jane Jones”.
:MyPage
a earl:WebContent;
dc:creator <http://example.org/onto/person/Mary/>.
C) What is RDF Graph? Demonstrate the RDF graph with an example.
Ans: RDF is a directed graph composed of triple statements.
An RDF graph statement is represented by:
1) a node for the subject
2) an arc that goes from a subject to an object for the predicate, and
3) a node for the object.
Each of the three parts of the statement can be identified by a Uniform Resource
Identifier (URI). An object can also be a literal value.
Example: The following example shows the sentence with triple.
Ric’s blog can be found at ricroberts.com

3
In this sentence, “Ric” is the subject, “blog” is the predicate and “ricroberts.com” is
the object.
Subject:
The resource in question is a person (me). In RDF, we use URIs to uniquely identify
resources. Let’s use http://swirrl.com/ric.rdf#me as the URI to identify me.
Predicate:
We need to find a term which we can use to mean “blog”. For this example, we are
going to use a term from the FOAF (Friend-of-a-Friend) vocabulary. Predicates are
also identified by URIs: FOAF’s URI for the weblog predicate
is ahttp://xmlns.com/foaf/0.1/weblog.
Object:
The object of this triple is just a URL which identifies the home page of my
blog http://ricroberts.com.
The triple:
subject: http://swirrl.com/ric.rdf#me
predicate: http://xmlns.com/foaf/0.1/weblog
object: http://ricroberts.com
The following diagram shows the RDF Graph for the above triple.

3. A) Define RDF Schema?


Ans: RDF Schema is language layered on top of RDF. This layered approach to create
the Semantic Web has been presented by the W3C and Tim Berners-Lee as the
“Semantic Web Stack,”.
RDF Schema is a simple set of standard RDF resources and properties to enable people
to create their own RDF vocabularies. The data model expressed by RDF Schema is

4
the same data model used by object-oriented programming languages like Java. The
data model for RDF Schema allows you to create classes of data.

B) List the key components of RDF Schema.


Ans: The following are the key components of RDF Schema:
rdfs:Class.
rdfs:label.
rdfs:subclassOf
rdf:Property
rdfs:domain.
rdfs:range.
rdf:type.
<rdf:Description rdf:about= “”>
<rdf:type rdf:resource =””>
rdfs:subPropertyof.
rdfs:seeAlso.
rdfs:isDefinedBy.
rdfs:comment.
rdfs:XMLLiteral.
C) Inspect about Semantic Web Stack with neat block diagram.
Ans: The Semantic Web layers are arranged following an increasing level of
complexity from bottom to top. Higher layers functionality depends on lower ones.
This design approach facilitates scalability and encourages using the simpler tools for
the purpose at hand. The following diagram shows the Semantic web stack.

5
URI and UNICODE

The two technologies that conform this layer are directly taken from the World Wide
Web. URI provides global identifiers and UNICODE is a character-encoding standard
that supports international characters.

XML and Namespaces

The Semantic Web should smoothly integrate with the Web. Therefore, it must be
interwoven with Web documents. HTML is not enough to capture all that is going to
be expressible in the Semantic Web.

XML is a superset of HTML that can be used the serialisation syntax for the Semantic
Web. XML was initially tried but more recently other possibilities have been
developed. They are presented and compared in the next section.

Namespaces where added to XML to increase its modularisation and the reuse of XML
vocabularies in conjunction with XML Schemas. They are also used in the Semantic
Web for the same purpose.

RDF Model and Syntax

The RDF Model and Syntax specification defines the building blocks to realise the
Semantic Web. This is the first layer that was specifically developed for it. This
specification defines the RDF graph model and the RDF abstract syntax.

RDF Schema

6
RDF Schema specification provides some primitives from semantic networks to define
metadata vocabularies. RDF Schemas implement metadata vocabularies in a modular
way, like XML Schemas.

Ontology

Ontologies are necessary when the expressiveness achieved with semantic network-
like tools is not enough. Metadata vocabularies defined by RDF Schemas can be
considered simplified ontologies. The tools included in this layer rise the developed
vocabularies to the category of ontologies. For a comparative with XML Schemas.

Rules

The rules layer allows proof without full logic machinery. Similar rules are those used
by the production systems presented in the corresponding Knowledge Representation
subsection. They capture dynamic knowledge as a set of conditions that must be
fulfilled in order to achieve the set of consequences of the rule.

Logic

The purpose of this layer is to provide the features of FOL. First Order Logic was
described as the most significant type of logic in the Logic types section. With FOL
support, the Semantic Web has all the capabilities of logic available at a reasonable
computation cost as shown in the Deduction section.

Proof

The use of inference engines in the Semantic Web makes it open, contrary to computer
programs that apply the black-box principle. An inference engine can be asked why it
has arrived to a conclusion, i.e. it gives proofs of their conclusions.

Trust

This is the top layer of the Semantic Web architecture. Agents that want to work with
the full-featured Semantic Web will be placed over it. They will conform the Web of
Trust.

The trust layer makes use of all the Semantic Web layers below. However, they do not
provide the required functionality to trustily bind statements with their responsible
parts. This is achieved with some additional technologies that are shown in the right
part of the Semantic Web stack Figure.

7
The used tools are digital signature and encryption. Thus, the trust web will make
intensive use of Public Key Infrastructures. They are already present in the Web, for
instance as digital certificates identifying parties that sign digital contracts.

4. A) Describe about XPath.


Ans: XPath stands for XML Path Language. It’s an expression language that is used
to query or transform. We use it to traverse among elements and attributes in an XML
document. The World Wide Web Consortium (W3C) defined XPath in 1999.
XPath is used to:
 Query or transform XML documents
 Traverse elements, attributes, and text through an XML document
 Find particular elements or attributes with matching patterns
 Uniquely identify or address parts of an XML document
 Extract information from any part of an XML document
 Test addressed nodes within a document to determine whether they match a
pattern

B) Apply XPath expressions with an example.


Ans. XPath is the XML Path Language, and it plays an important role in the XML
family of standards.
XPath uses a compact syntax to facilitate its use within URIs and XML attribute values.
XPath gets its name from its use of a path notation as in URLs for navigating through
the hierarchical structure of an XML document.
By using XPath, we can un-ambiguously define where components of an XML
document live. Because we can use XPath to specifically address where components
can be defined, it provides an important mechanism that is used by other XML
standards and larger XML frameworks and APIs.
The following diagrams shows the XPath expressions with an example.

8
9
C) Compare the XPath and XQuery.
Ans:

5. A) Define XSL.
Ans: XSL (Extensible Stylesheet Language) is a family of standards that specifies
how to define Extensible Markup Language (XML) document transformation and
presentation.
The standards are published by the World Wide Web Consortium (W3C), an
international community that develops specifications related to web architecture,
design, applications and other web technologies.
B) Describe the purpose of XSLT in XML document.
Ans:

10
XSLT - Basic Principle

Patterns and Templates

 A style sheets describes transformation rules


 A transformation rule: a pattern + a template
 Pattern: a configuration in the source tree
 Template: a structure to be instantiated in the result tree
 When a pattern is matched in the source tree, the corresponding pattern is
generated in the result tree

An Example: Transformation

<xsl:template match="Title">
<H1>
<xsl:apply-templates/>
</H1>
</xsl:template>

Input : <Title>Introduction</Title>

Output : <H1>Introduction</H1>

C) Explain about XSLT and XSLFO with neat block diagram.


Ans:

11
The XSLT standard defines a language for transforming XML documents into other
XML documents or into formats such as HTML, Extensible HTML, text or JavaScript
Object Notation (JSON).
An XSLT document is essentially a stylesheet written in well-formed XML to provide
specific styling information for one or more XML source documents. For example, an
XSLT stylesheet might be used to tell a browser to format the data in an XML
document as a table.
The XSL-FO standard defines a template-based vocabulary and expression language
for specifying XML formatting semantics.
The standard provides a type of markup language that can be used to define how
information is laid out on a page and presented to the reader.
XSL-FO is often used in conjunction with XSLT to apply formatting to the output from
an XSLT processor. Because XSL-FO supports sophisticated document formatting, it
is commonly used to generate PDF files from XML documents.
6. A) Illustrate about XQuery.
Ans. XQuery is a functional language that is used to retrieve information stored in
XML format. XQuery can be used on XML documents, relational databases containing
data in XML formats, or XML Databases. XQuery 3.0 is a W3C recommendation.
 Using XQuery, both hierarchical and tabular data can be retrieved.
 XQuery can be used to query tree and graphical structures.
 XQuery can be directly used to query webpages.
 XQuery can be directly used to build webpages.
 XQuery can be used to transform xml documents.
 XQuery is ideal for XML-based databases and object-based databases. Object
databases are much more flexible and powerful than purely tabular databases.

B) Describe about XPointer.


Ans. XPointer is the XML Pointer Language from the W3C, which is used as a
fragment identifier for any URI reference that locates an XML-based resource.
A powerful language, XPointer can “point” to fragments of remote documents using
XPath expressions and can point to ranges of data and points of data in documents.
C) Define XHTML? Demonstrate its implementation with an example.
Ans: XHTML, the Extensible Hypertext Markup Language, is the reformulation of
HTML into XML. The specification was created for the purpose of enhancing our
current Web to provide more structure for machine processing.

12
Because HTML is not well formed and is only a presentation language, it is not a
good language for describing data, and it is not extremely useful for information
gathering in a Semantic Web environment.
Because XHTML is XML, it provides structure and extensibility by allowing the
inclusion of other XML-based languages with namespaces. By augmenting our
current Web infrastructure with a few changes, XHTML can make intermachine
exchanges of information easier.
XHTML 1.0, a W3C Recommendation released in January 2000, was a reformulation
of HTML 4.0 into XML. The transition from HTML to XHTML is quite simple. Some
of the highlights include the following:
 An XHTML 1.0 document should be declared as an XML document using an
XML declaration.
 An XHTML 1.0 document is both valid and well formed. It must contain a
DOCTYPE that denotes that it is an XHTML 1.0 document, and that also
denotes the DTD being used by that document. Every tag must have an end tag.
 The root element of an XHTML 1.0 document is <html> and should con- tain a
namespace identifying it as XHTML.
 Because XML is case-sensitive, elements and attributes in XHTML must be
lowercase.

13

You might also like