concept html in category data

appears as: HTML, n HTML, HTML, html, The HTML
Data Science Bookcamp: Five Python Projects

This is an excerpt from Manning's book Data Science Bookcamp: Five Python Projects.

The Internet is a great resource for text data. Millions of web pages offer limitless text content, in the form of news articles, encyclopedia pages, scientific papers, restaurant reviews, political discussions, patents, corporate financial statements, job postings, etc. All these pages can be analyzed, if we download their HTML files. HTML stands for Hypertext Markup Language. A markup language is a system for annotating documents, which distinguishes the annotations from the document text. In the case of HTML, these annotations are instructions on how to visualize a web page.

Figure 16.8. A rendered HTML document. The document has edited. Two of the three original paragraphs have been removed. Also, a new paragraph has been inserted into the HTML.
fig16 8
Listing 17.2. Parsing HTML files
from bs4 import BeautifulSoup as bs

soup_objects = []
for html in html_contents:
    soup = bs(html)
    assert soup.title is not None
    assert soup.body is not None
    soup_objects.append(soup)
Linked Data: Structured data on the Web

This is an excerpt from Manning's book Linked Data: Structured data on the Web.

In this chapter, assuming that you have a basic familiarity with fundamental web technologies such as HTML, URIs, and HTTP, we introduce you to Linked Data, place it in context, outline its principles, and show you how to use it by walking you through your first Linked Data application.

RDF provides a mechanism for expressing data and relationships. RDF in Attributes (RDFa) is a language that allows you to express RDF data within an HTML document. This enables your website to be both machine- and human-readable. HTML is a means of describing the desired visual appearance of your content. HTML doesn’t differentiate between a book title and a job title. It can only differentiate the font displayed according to the author’s direction. The human reader needs to interpret the information based on the context of the page and identify a book title as opposed to a job title. RDFa enables the author to embed structured data that will identify this differentiation. Authors can mark up human-consumable information for interpretation by browsers, search engines, and other programs. The RDFa-specific attributes don’t affect the visual display of the HTML content and are ignored by the browser as it would any other attribute not recognizable as HTML.

We’ll begin our application with a traditional basic HTML document about Anakin Skywalker, shown in listing 6.1. We’ll mark up the HTML by embedding RDFa and explain what we’re doing as we proceed. As an HTML page without RDFa, the browser interprets the content without regard to its semantic meaning. The page as displayed could contain any content, and the HTML elements affect its visual appearance. Hence, the content is simply as illustrated in Document A of figure 6.1.

<!DOCTYPE HTML>
<html version="HTML+RDFa 1.1" lang="en" >