Relation

A relation is a property that has an entity as a value. A relation connects two entities1 in a knowledge graph2.

The Role of Relations in KGO

All relations of an entity are vital properties. The give a role of another entity in the context of this entity. For example, in an "Article" schema type[^schema_type] the "Author" relates to a "Person" (or an "Organization").

Connecting the Schema Markup

In order to build a valid graph, you must provide complete relations with a matching identifier.

Example

Providing a name as text is valid schema markup

{
    "@type": "Article",
    "author": "John Doe"
}

This form requires the knowledge graph engine to guess what thing "John Doe" is.

Providing a full entity as "author" provides more certainty to build a knowledge graph.

{
    "@type": "Article",
    "author": {
        "@type": "Person",
        "@id": "http://example.com/author/john_doe/#person/09876",
        "name": "John Doe"
    }
}

This form specifies that "John Doe" is a person and that this person may be described somewhere else with the same "@id" and different properties.

On-Page vs. Off-Page Relations

The above example describes an on-page relation. The World Wide Web produces a sea of documents with different authors a global identifier for a person may exist, but it is unlikely. There fore the "@id" attribute is usually only interpreted within the same document or web page.

Off-page relations are described in schema markup by properties such as:

While "@id" values are often URLs, there is no law that they have to be URLs. Specifically, they don't need to resolve to a resource. Technically they are URIs or better IRIs.

Yet a "url" property should be a valid "url" and describe the entity in question.

Typically, "sameAs" and mainEntityOfPage" use URLs as values.

A knowledge graph engine will interpret these properties as relations to these external resources. If it can extract structured data from these resources, it will build relations in the knowledge graph.

Off-page relations are also extracted from the links on a webpage. This includes anchor elements on the page as well as images. This corresponds with the concept of off-page factors in search engine optimization.

Footnotes

  1. An entity is a "thing" that is well-defined and has an identity. For example, a person, a location, a concept, or an event can be entities in a knowledge graph.

  2. A knowledge graph is a graph that expresses knowledge in its simplest form.