# Semantic Web

## Summary


In the original web of the 1990s information was shared as webpages or documents that could be understood by humans. Via hyperlinks, these linked to other webpages or documents anywhere on the web. Servers and desktop computers processed or displayed all this information but didn't understand them. For example, a computer could tell that a particular text is a heading or another text is in italics. It didn't know that the heading is actually the title of a blog post or that the text in italics is the author's name. 

Semantic Web is an attempt to describe and link web content in a manner that's meaningful to machines. Semantic Web extends the original web. Semantic Web wants to transform the web from a "web of documents" into a "web of data".

## Discussion

### What's the motivation behind Semantic Web?

By enabling machines to understand data, we can benefit in many ways:

    + **Automation**: We can avoid doing mundane stuff such as booking tickets or rescheduling appointments. These can be efficiently handled by virtual assistants or agents.
    + **Personalization**: Content on the web is growing daily. It's impossible for us to follow everything. Agents can personalize or curate content for us.
    + **Information Retrieval**: Within enterprises or via web search engines, Semantic Web can give us more relevant answers.
    + **Data Reuse**: Because Semantic Web enables linking of data from a variety of sources, data can be reused. Data that was previously stored in isolated databases can now be shared in a standard manner.
    + **Knowledge Discovery**: By linking data across the web, new knowledge can be discovered. Semantic Web enables machines to apply logic on existing relationships and infer new ones. For example, this could be useful in discovering new drugs.

### With the progress of Machine Learning (ML), is Semantic Web relevant?

Semantic Web doesn't make machines intelligent in the sense of Artificial Intelligence or Machine Learning. Instead of asking machines to understand humans, we help machines to solve well-defined problems on well-defined data via well-defined operations. 

It therefore does appear that AI/ML has gone ahead and enabled machines to see, hear and speak. The mid-2010s have seen the arrival of voice assistants, chatbots, computer vision applications, and more. This has been possible because of the availability of data to train ML algorithms. Though some ML algorithms require labelled data for training, there's no need to add semantic metadata to all data.

However, Semantic Web complements and even overlaps with AI/ML. Semantic Web can help with explainable AI. Natural Language Processing (NLP) is an application area with chatbots and intelligent assistants using semantically linked data. Semantic Web can add background knowledge to AI/ML systems, particularly in areas where data is scarce. We're also seeing AI/ML being applied to conceptualize domain knowledge for the Semantic Web. AI can fill in missing data or clean noisy data in knowledge graphs. 


### What are the basic building blocks of Semantic Web?

Semantic Web builds upon the foundations of the original web. Data (old and new) must be described with metadata. This metadata will identify data, interlink data and relate data to concepts so that machines can understand them.

Data must be uniquely identified and this is done using **Uniform Resource Identifier (URI)** or **Internationalized Resource Identifier (IRI)**. **Resource Description Framework (RDF)** provides the data model. Meaning is added at a higher layer with what we call **ontologies**. In other words, RDF specifies the syntax while ontologies specify the semantics. 

Just as HTML was the building block of the original web, RDF is the building block of the Semantic Web. Web content can expose their semantics by embedding RDF statements within webpages. There are many ways to do this: RDFa, RDF-XML, RDF-JSON, JSON-LD, Microdata, etc. Semantic data already processed and stored in RDF format can be queried. Just as MySQL exists to query relational databases, **SPARQL** is a language to query **RDF stores**. Given the semantics, rules can help in applying logic and reasoning. 


### What is Resource Description Framework (RDF)?

As the name suggests, RDF helps us describe any resource so long as that resource has a unique identifier. In other words, RDF helps us define data about other data, that is, the metadata. 

RDF has three components: subject, predicate, object. It's a statement about the relationship between the subject and the object. Thus, the fact that Villa Nellcôte is located in France can be expressed as an **RDF Triple**. All three parts of the triple are expressed as URIs, literals or blank nodes. 

When we combine many such statements together, we get what is called an **RDF Graph**. Subjects and objects are nodes of the graph. Predicates form the connecting arcs. For example, we can state that France is in Europe, Paris is the capital of France, Paris has a population of 2.2 million... Each of these can be expressed as an RDF Triple. Collectively, they form an RDF Graph.


### How do we add meaning to data on the web?

RDF on its own doesn't give meaning to data. RDF is a data model, a method to express relationships. To give meaning, *vocabularies* and *ontologies* are defined. These are typically written in terms of classes, their properties and relationships to other classes. 

For example, an RDF triple can express that Paris is the capital of France but for a computer this still makes no sense. A vocabulary can define that capital is a type of city, city belongs to a country, and country is a political entity. This helps the computer to get a sense of the context though it can never truly understand the way humans do.

**RDF Schema (RDFS)** is a simple vocabulary while **Web Ontology Language (OWL)** is more powerful. 


### Could you explain the term ontology?

Ontology has a metaphysical meaning but in computer science it refers to a formal description of knowledge. Concepts and their relationships within a specific domain are described. Classes, attributes, and relations such as restrictions, rules and axioms are defined. These represent the knowledge of that domain. 

For example, in the domain of education, we can define that a course is taught by an academic staff member; academic staff member is a subclass of staff member; the union of staff member and student is all people at the university; academic staff member is equivalent to faculty; and so on. If we state that John Smith teaches Chemistry 101, using the ontology we can infer that John Smith is a staff member. 

Data coming from different sources can rely on ontologies for a common understanding. Ontologies can also help in finding logical inconsistencies, classes that cannot have instances, or different instances that share the same names. One important benefit is that logic and reasoning can be applied to discover new knowledge. 


### Could you describe some real-world applications of Semantic Web?

It was reported in 2007 that the oil and gas industry is using RDF/OWL to combine data from diverse sources, and standardize data exchange, sharing and integration across partners or applications. Collaborative knowledge management also became possible. 

In April 2010, Facebook launched *Open Graph* that web publishers can use to integrate their web pages into Facebook's social graph. This enables Facebook to understand what a user likes, give personalized recommendations, or connect users with similar interests. A simplified form of RDFa was adopted. 

During the FIFA World Cup of 2010, BBC website used semantic web technologies to dynamically display content. SPARQL queries and OWL 2 RL reasoning were employed. With the success of this project, in January 2013, BBC committed to the development of Linked Data Platform to enable dynamic semantic publishing. BBC's Music site from 2008 was also an early example of using the semantic web. 

Other examples include causality mining in pharma, semantic web mining, mining health records for insights, and fraud detection. You may also look up W3C's page titled Semantic Web Case Studies and Use Cases for more examples.

## Milestones

1997

W3C produces the first working draft of *RDF Model and Syntax*. This evolves to a 2004 W3C Recommendation titled *Resource Description Framework (RDF): Concepts and Abstract Syntax*. 

1998

A working draft of *RDF Schema (RDFS)* is published by W3C. Since RDF itself lacks means to define semantics, RDFS provides a basic type system for use in RDF models. *RDF Schema 1.1* is published in February 2014 as a W3C Recommendation. 

May  
2001

American science magazine Scientific American publishes an article by the inventor of the web, Tim Berners-Lee. Titled *The Semantic Web*, this article talks about web content that's meaningful to computers. The article narrates futuristic interactions enabled by the semantic web. It discusses knowledge representations, ontologies and agents. Though Berners-Lee had discussed some of these as early as 1994, it's only with this article that the vision of semantic web reaches a wide audience.

2004

W3C publishes **Web Ontology Language (OWL)**. OWL enables complex relationships that are not possible with RDFS. A revision of this (often called "OWL 2") is published in 2009. A second edition of OWL 2 is published in 2012. 

2006

Tim Berners-Lee points out that putting data out on the web isn't enough. Data has to be linked to other related data. He proposes what he calls *Linked Open Data (LOD)* and defines a 5-star system to grade how well people share data. He also states that,

> Linked Data is the Semantic Web done right.

Jan  
2007

*DBpedia* is created by using structured data available in Wikipedia and representing them as RDF triples. By using a query language such as SPARQL, DBpedia can be used to make semantic queries. As on April 2016, DBpedia contains 9.5 billion RDF triples. 

2010

This may be the year when many companies adopt semantic web technologies for commercial use. Examples include Best Buy, BBC World Cup site, Google, Facebook and Flipboard. 

Jun  
2011

Google, Microsoft, Yahoo and Yandex agree on **Schema.org**, a vocabulary for associating meaning to data on the web. The vocabulary is defined by a community process. Schema.org can be used with various encodings including RDFa, Microdata and JSON-LD. Google itself recommends the use of Schema.org along with JSON-LD. 

Oct  
2011

Apple integrates voice assistant *Siri* into some of its products. Within the next couple of years, competitive voice assistants *Microsoft Cortana*, *Google Now* and *Amazon Alexa* are released. These are largely powered by machine learning techniques but may also leverage the semantic web technologies. 

Sep  
2013

Google Search gets the Hummingbird update, which enables the search engine to figure out user's intent. This is beyond searching by keywords alone. This capability comes from semantics attached to data plus Google's Knowledge Graph. Knowledge Graph was announced in May 2012. 

2021

Given that 2001 is considered the birth year of Semantic Web (with the publication of the Scientific American article), Semantic Web celebrates its **20th anniversary**. In an article, Hitzler writes that the grand goal of data sharing, discovery, integration and reuse hasn't been achieved. Every sub-field of Semantic Web needs further progress. Given many varied approaches, some application-oriented consolidation is needed with good interworking of tools and well-documented processes.