Chapter 4 WD 4th SEM CSE

7
Chapter 4: Descriptive Markup 4.1 Descriptive Markup Instead of inserting the desired formatting codes directly, descriptive markup inserts information into the text that describes or identifies features of a text. This introduces an additional layer of abstraction, and information about how to render these features can be held separately. A formatter then uses both the descriptive markup and the formatting information together to produce the desired result. Descriptive markup offers not only more flexibility in rendering for different devices, the information contained in the descriptive markup can be used for many additional purposes, for example to provide a list of books mentioned, a topical index etc. Thus these are very helpful relative to search engines. One of the most commonly used descriptive markup tag is META tag. It is explained as follows: 4.1.1 Meta tag The HEAD element contains general information (meta- information) about a document. HTML also includes a META element that goes inside the head element. The purpose of the meta element is to provide meta- information about the document. Most often the meta element is used to provide information that is relevant to browsers or search engines like describing the content of your document. This META element defines a description of a web page: <META name="description" content="Free Web tutorials on HTML, CSS, XML, and XHTML">

Transcript of Chapter 4 WD 4th SEM CSE

Page 1: Chapter 4 WD 4th SEM CSE

Chapter 4: Descriptive Markup

4.1 Descriptive Markup

Instead of inserting the desired formatting codes directly, descriptive markup inserts information into the text that describes or identifies features of a text. This introduces an additional layer of abstraction, and information about how to render these features can be held separately. A formatter then uses both the descriptive markup and the formatting information together to produce the desired result.

Descriptive markup offers not only more flexibility in rendering for different devices, the information contained in the descriptive markup can be used for many additional purposes, for example to provide a list of books mentioned, a topical index etc. Thus these are very helpful relative to search engines.

One of the most commonly used descriptive markup tag is META tag.

It is explained as follows:

4.1.1 Meta tag

The HEAD element contains general information (meta-information) about a document.

HTML also includes a META element that goes inside the head element. The purpose of the meta element is to provide meta-information about the document.

Most often the meta element is used to provide information that is relevant to browsers or search engines like describing the content of your document.

This META element defines a description of a web page:

<META name="description" content="Free Web tutorials on HTML, CSS, XML, and XHTML">

Or

This META element defines keywords for a web page:

<META name="keywords" content="HTML, DHTML, CSS, XML, XHTML, JavaScript, VBScript">

Page 2: Chapter 4 WD 4th SEM CSE

Descriptive Markup

4.1.2 Semantic tags for aiding Search

It’s not that search engines are existential; it’s just that when a search engine visits a site to catalog the content on it, it’s not simply creating a list of words that appear on the site. But the real reason is to try and figure out what the words on the site mean; the more meaning they can extract, the better they’ll do at associating the site with somebody’s search, without the user having to search for the exact words used on the site..

Extracting meaning is very complicated, so the more help given Google, MSN, Yahoo, Ask, Looksmart, etc… the better off the site will be.

Good SEO (Search Engine Optimization) is only possible when the HTML tags are semantic in nature. The HTML that builds the web pages has to impart meaning, not just be a method of creating visual formatting. There are lots of different tags, some more useful than others:

The title of a page is set by the <TITLE> tag. Headings are created by <H1>, <H2>, <H3>, <H4>, <H5>,

<H6> (depending on their importance). Words are emphasized with the <EM> tag.

The key point is that semantic tags must give the text meaning. For example, the <EM> tag just referred to. Most browsers render this by putting the words inside this tag in italics. There’s also a tag specifically for “italics”: <I>. It’s shorter! Why not use that? Because of semantics. The <I> tag instructs the browser to italicize the text, but the <EM> means something: “emphasize this” (as opposed to straight italics, which could be a book title, a motto, or something else entirely).

The fact that both tags look the same in a default browser configuration is a red herring—since <EM> has actual meaning, search engines can more easily figure out what to do with the text; this generally leads to better ranking for the page’s topic. The differences in one tag aren’t much, but multiply that over thousands of tags across a handful of pages.

Good semantics mean more accessible sites

The web isn’t just people using web browsers on PCs and Macs. Cell phones, PDAs, screen readers for the blind, and yes, even search engines are non-browser devices that are interested in the content on the site. New devices enter the market every day. In order to be “future-proof” and not require redesign when some new gadget comes out, the web site has to be semantic in nature, or else people with these gadgets will have a hard time getting around on the site, or worse, be completely locked out of it (incidentally, this is one of the reasons why there’s such a huge difference between high quality web sites built by professionals and the stuff one can hire the neighbor kid to do; unfortunately, it’s also

Page 3: Chapter 4 WD 4th SEM CSE

Descriptive Markup

one of the things people tend to overlook until it’s too late, certainly to their loss).

Things to do

1. Content should be kept separate from Presentation when a site is being written.

2. HTML is supposed to describe what the content means rather than what it looks like.

3. Tag usage should be as minimal as possible. Pages with very few tags almost always get better search visibility.

Things to avoid

1. Archaic tags like <FONT>. These are presentational in nature, and only obscure the meaning the designer trying to convey.

2. Embedding style into the markup, like <P style="color: blue">blue text</P>. This too provides noise that just gets in the way of the actual content itself. Keep style sheets externally linked.

4.1.2 RDF (Resource Description Framework)

“THE RESOURCE DESCRIPTION FRAMEWORK (RDF) IS A LANGUAGE FOR REPRESENTING INFORMATION ABOUT RESOURCES IN THE WORLD WIDE WEB.”

It is particularly intended for representing metadata about Web resources, such as the title, author, and modification date of a Web page, copyright and licensing information about a Web document, or the availability schedule for some shared resource. However, by generalizing the concept of a "Web resource", RDF can also be used to represent information about things that can be identified on the Web, even when they cannot be directly retrieved on the Web. Examples include information about items available from on-line shopping facilities (e.g., information about specifications, prices, and availability), or the description of a Web user's preferences for information delivery.

RDF is intended for situations in which the information needs to be processed by applications, rather than being only displayed to people. RDF provides a common framework for expressing the information so it can be exchanged between applications without loss of meaning.

Page 4: Chapter 4 WD 4th SEM CSE

Descriptive Markup

RDF is based on the idea of identifying things using Web identifiers (called Uniform Resource Identifiers, or URIs), and describing resources in terms of simple properties and property values.

RDF is intended to provide a simple way to make statements about Web resources, e.g., Web pages.

RDF was based on the idea of expressing simple statements about resources, where each statement consists of a subject, a predicate, and an object like:

http://www.example.org/index.html has a creation-date whose value is August 16, 1999http://www.example.org/index.html has a language whose value is English

This mechanism for describing resources is a major component in what is proposed by the W3C's Semantic Web activity: an evolutionary stage of the World Wide Web in which automated software can store, exchange, and use machine-readable information distributed throughout the Web, in turn enabling users to deal with the information with greater efficiency and certainty. RDF's simple data model and ability to model disparate, abstract concepts has also led to its increasing use in knowledge management applications unrelated to Semantic Web activity.

The basic ideas behind the RDF/XML syntax can be illustrated using some of the examples as:

Take as an example the English statement:

http://www.example.org/index.html has a creation-date whose value is August 16, 1999

RDF/XML for the Web Page's Creation Date :

1. <?xml version="1.0"?>2. <rdf: RDF xmlns: rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"3. xmlns: exterms="http://www.example.org/terms/">

4. <rdf:Description rdf:about="http://www.example.org/index.html">5. <exterms:creation-date>August 16, 1999</exterms:creation-date>6. </rdf:Description>

7. </rdf:RDF>

Page 5: Chapter 4 WD 4th SEM CSE

Descriptive Markup

Line 1: <?xml version="1.0"?>, is the XML declaration, which indicates that the following content is XML, and what version of XML it is.

Line 2: begins an rdf:RDF element. This indicates that the following XML content (starting here and ending with the </rdf:RDF> in line 7) is intended to represent RDF.

Following the rdf:RDF on this same line is an XML namespace declaration, represented as an xmlns attribute of the rdf:RDF start-tag. This declaration specifies that all tags in this content prefixed with rdf: are part of the namespace identified by the URIref http://www.w3.org/1999/02/22-rdf-syntax-ns#. URIrefs beginning with the string http://www.w3.org/1999/02/22-rdf-syntax-ns# are used for terms from the RDF vocabulary.

Line 3: specifies another XML namespace declaration, this time for the prefix exterms:. This is expressed as another xmlns attribute of the rdf:RDF element, and specifies that the namespace URIref http://www.example.org/terms/ is to be associated with the exterms: prefix. URIrefs beginning with the string http://www.example.org/terms/ are used for terms from the vocabulary defined by the example organization, example.org.

Line 4: Lines 4-6 provide the RDF/XML for the specific statement

The rdf:Description start-tag in line 4 indicates the start of a description of a resource, and goes on to identify the resource the statement is about (the subject of the statement) using the rdf:about attribute to specify the URIref of the subject resource.

Line 5: provides a property element, with the exterms: creation-date as its tag, to represent the predicate and object of the statement. The exterms: creation-date is chosen so that appending the local name creation-date to the URIref of the exterms: prefix (http://www.example.org/terms/) gives the statement's predicate URIref http://www.example.org/terms/creation-date.

Line 6: ends the definition of rdf: description tag.

Page 6: Chapter 4 WD 4th SEM CSE

Descriptive Markup

Line 7: ends the definition of rdf: RDF tag.

ASSIGNMENT

Q1. Write short notes on:

(i) HTML, (ii) XML, (iii) XHTML, (iv)W3C.