Internet Basics & History

The Semantic Web: The Idea That Machines Should Read Pages Too

Learn what the Semantic Web set out to do, how triples and shared vocabularies work and which parts you can put to use on your own site.

Key takeaways

  • Ordinary HTML tells software how content is structured on a page, but little about what the content refers to.
  • The Semantic Web describes facts as subject, predicate and object, using web identifiers for things and relationships.
  • Shared vocabularies let different publishers mean the same thing by the same term.
  • Adoption is uneven: structured data markup and knowledge graphs thrive, while a universal web of data does not exist.
  • Site owners can benefit today by adding accurate structured data that matches what visitors see.

The Semantic Web is the idea of publishing information on the web so that software can tell what it means, not only how it should look. A page for people might say "Doors open at 7". A machine-readable version states that this is an event, that 7 in the evening is its start time and that it takes place at a particular venue.

Tim Berners-Lee, who created the web, championed the idea, and the World Wide Web Consortium (W3C) published a family of standards for it. The grand vision of a single web of data has been realized only in part, but pieces of it are in everyday use.

The problem it addresses

A person reading a page effortlessly understands that "Jordan" in one place is a country and in another a person. Software working from text alone has to guess. HTML marks headings, paragraphs and links, but a heading tag does not say whether the words name a product, a recipe or a city.

If publishers stated these facts explicitly, programs could combine information from many sites: find concerts near you this weekend, check which have step-free access and add one to your calendar, without anyone writing a custom reader for every website. The web already links documents; the goal was to link data too.

Facts as triples

The core data model is RDF, the Resource Description Framework. It breaks knowledge into statements of three parts:

  • a subject, the thing being described;
  • a predicate, the property or relationship;
  • an object, the value or the other thing.
One fact written as a triple
ex:ada 1 schema:worksFor 2 ex:exampleLibrary 3 Subject The thing described, named with a web identifier. 1 Predicate The relationship, taken from a shared vocabulary. 2 Object Another identified thing, or a plain value such as text or a date. 3 ex:ada 1 schema:worksFor 2 ex:exampleLibrary 3 Subject The thing described, named with a web identifier. 1 Predicate The relationship, taken from a shared vocabulary. 2 Object Another identified thing, or a plain value such as text or a date. 3

Subjects and predicates are identified by IRIs, a generalization of web addresses, so two datasets can refer to the same thing unambiguously. Where an object is another identified thing, triples connect into a graph. Here is a small example in Turtle, one of the text formats for RDF:

@prefix schema: <https://schema.org/> .
@prefix ex:     <https://example.org/id/> .

ex:ada            a               schema:Person ;
                  schema:name     "Ada Example" ;
                  schema:worksFor ex:exampleLibrary .

ex:exampleLibrary a               schema:Organization ;
                  schema:name     "Example Town Library" .

The letter a is shorthand for "is a type of". The names and addresses are invented for illustration.

The supporting standards

The main building blocks
SPARQL A query language for asking questions of RDF data. OWL and RDF Schema Describe classes, properties and logical rules about them. Vocabularies Agreed terms such as Person, Event or author. RDF The triple model, written as Turtle, JSON-LD and other formats. IRIs Global identifiers for things and relationships. SPARQL A query language for asking questions of RDF data. OWL and RDF Schema Describe classes, properties and logical rules about them. Vocabularies Agreed terms such as Person, Event or author. RDF The triple model, written as Turtle, JSON-LD and other formats. IRIs Global identifiers for things and relationships.

Vocabularies are the dictionaries. Dublin Core covers basic description such as title and creator. FOAF describes people and connections. SKOS handles thesauri and category schemes. Schema.org, launched by major search engines, offers a broad vocabulary aimed at ordinary websites.

Ontologies, written in languages such as OWL, say more: that every novel is a book, or that if one place is part of a second, which is part of a third, then the first is part of the third. Software called a reasoner can draw such conclusions.

SPARQL queries the graph by describing a pattern. This asks for the names of people working for the example library:

PREFIX schema: <https://schema.org/>
SELECT ?name WHERE {
  ?person schema:worksFor <https://example.org/id/exampleLibrary> ;
          schema:name ?name .
}

A worked example: combining two sources

Suppose a hypothetical town library publishes its events as triples, and a transit agency publishes which stops are near which buildings. Each uses an identifier for the library building. If both use the same identifier, or one publishes a statement that its identifier and the other's refer to the same thing (OWL has a property for this, owl:sameAs), the two graphs join naturally.

A single query can then ask for events this week at places within reach of a particular bus stop. Neither publisher had to design a shared database or know the other's software. They only had to name things consistently and use terms the other side understands.

The hard part is in that "only". Deciding whether two records describe the same building, whether "venue" in one scheme matches "location" in another, and what to do when the sources disagree takes human judgment. Careless use of owl:sameAs can merge things that are merely similar, and a reasoner will then happily spread the error. RDF assumes an open world: the absence of a statement does not mean it is false. That suits a web where nobody knows everything, and it surprises people used to databases, where a missing row usually means no.

Three formats you may see

Format Where it appears Character
JSON-LD Script blocks in web pages, APIs Familiar to developers who know JSON
Turtle Data files and examples Compact and readable by hand
RDFa Attributes mixed into HTML Marks up the visible text itself

They are different ways of writing the same underlying statements, and tools can convert between them. Microdata is another HTML attribute syntax often used with schema.org, though it is not an RDF format as such.

Linked data

Berners-Lee set out simple principles often called linked data: use identifiers for things; make them web addresses that can be looked up; return useful information in a standard form; and include links to other things. Libraries, museums, scientific databases and government data portals have published material this way. Wikidata, a collaboratively edited knowledge base, offers a public SPARQL query service.

Why the full vision stalled

Several practical obstacles limited it.

  • Effort and incentive. Publishers had to add and maintain data, often for benefits that went to others.
  • Agreement. People model the world differently, and mapping one scheme onto another is slow work.
  • Trust. Anyone can assert anything. Markup can be wrong, stale or spam.
  • Complexity. Some of the formal machinery demands expertise that many web teams lacked.
  • Alternatives. Simple JSON interfaces were easier for most application developers.
  • Better text processing. Statistical methods and, later, large language models became far better at extracting meaning from ordinary prose.

That last point cuts both ways. Language models read messy text well, yet they can state things that are false. Curated, explicit facts remain valuable for grounding and checking. See retrieval-augmented generation in search, and semantic search and embeddings for a different, statistical route to matching meaning.

Where you meet it today

  • Rich results. Search engines can read structured data to show details such as event dates or product information. Eligibility rules differ and change, and markup does not guarantee any display.
  • Knowledge panels. Large knowledge graphs of entities and relationships sit behind many search features.
  • Social previews. Open Graph tags, which grew from related ideas, supply titles and images when links are shared.
  • Research and heritage. Catalogs and biomedical ontologies use these standards seriously.
  • Inside companies. Some build private knowledge graphs to join data from separate systems.

Adding structured data to your own page

For most sites the practical entry point is JSON-LD, a W3C format that puts the facts in a script block, apart from your visible layout.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Event",
  "name": "Example Reading Evening",
  "startDate": "2027-03-12T19:00:00+00:00",
  "location": {
    "@type": "Place",
    "name": "Example Town Library"
  }
}
</script>

A sensible procedure:

  1. Pick the type that truly describes the page.
  2. Check the current documentation of the search engine you care about for required properties.
  3. Include only facts that visitors can also see.
  4. Generate the data from the same source as the page, so they cannot drift apart.
  5. Validate it with a structured data testing tool, or at least confirm the JSON parses with a JSON formatter.
  6. Remove or update it when the facts change.

Marking up reviews you do not have or events that do not exist can lead to penalties and misleads people. Structured data and rich results covers the search side in more detail.

Mistakes to avoid

The most common problems are mundane. Markup describes a different page from the one it sits on, often because a template was copied. Dates lack a time zone and are read wrongly. A price or availability in the structured data lags behind the visible page. And several scripts from different plugins describe the same thing in conflicting ways. View your page source, read what is actually being published and keep one authoritative block for each thing.

Is it worth your time?

If you publish events, products, recipes, articles or details about an organization, adding basic structured data is usually a modest job with a plausible payoff. If you manage collections, research data or many systems that must agree on identifiers, learning RDF properly can pay off well. For a small personal page, clear writing, honest titles and well-formed HTML do most of what matters.

Note the naming trap too: "Web 3.0" has been used for the Semantic Web, while Web3 usually refers to blockchain-based services. They are different ideas.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in Internet Basics & History →

Latest news on this topic