Skip to content

Reword schema.org integration method #1

@jonoalderson

Description

@jonoalderson

The following JSON-LD (derived from a truncated Yoast SEO example; see https://developer.yoast.com/features/schema/specification/) is an example of an alternative implementation of wordproof into an existing schema.org graph structure.

It uses the following approach:

  • It makes the encodedTimestamp a (custom) property of the main entity of the page (in this case, an Article), which contains the various wordproof properties.
  • It adds a numeric version property to the main entity.
  • It adds a (custom) revision property to the main entity, which contains an array of references-by-ID to previous versions of the main entity, each of which in turn has a version and encodedTimestamp property.

I recommend this approach specifically, because:

  • The revisions are the explicit property of the main entity of the page (which may vary by context, e.g., a WebPage vs a NewsArticle)
  • The relevant information about an entity can be inherited from a parent (e.g., it can be assumed that if a newer version doesn't declare an author property, that that property hasn't changed).
  • If/when these standards are more broadly adopted, the syntax can be easily adjusted to deprecate the additionalProperty mechanism.
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "https://www.example.com/blog/example-article/",
      "@type": "WebPage",
      "isPartOf": {
        "@id": "https://www.example.com/#/schema/website/abc123"
      },
      "name": "Example page name",
      "url": "https://www.example.com/blog/example-article/"
    },
    {
      "@id": "https://www.example.com/#/schema/website/abc123",
      "@type": "WebSite",
      "name": "Example website",
      "publisher": {
        "@id": "https://www.example.com/#/schema/organization/abc123"
      },
      "url": "https://www.example.com"
    },
    {
      "@id": "https://www.example.com/#/schema/person/abc123",
      "@type": "Person",
      "name": "Example person name"
    },
    {
      "@id": "https://www.example.com/#/schema/image/abc123",
      "@type": "ImageObject",
      "caption": "Example caption",
      "height": 250,
      "url": "https://www.example.com/uploads/example-image.jpg",
      "width": 250
    },
    {
      "@id": "https://www.example.com/#/schema/organization/abc123",
      "@type": "Organization",
      "logo": {
        "@id": "https://www.example.com/#/schema/image/abc123"
      },
      "name": "Example organization name",
      "url": "https://www.example.com/#/schema/organization/"
    },
    {
      "@id": "https://www.example.com/blog/example-article/#/schema/article/abc123",
      "@type": "Article",
      "additionalProperty": [
        {
          "@type": "PropertyValue",
          "name": "encodedTimestamp",
          "value": [
            {
              "@type": "PropertyValue",
              "name": "blockchain",
              "value": "eos"
            },
            {
              "@type": "PropertyValue",
              "name": "transactionId",
              "value": "77ac208d9a01d0cf40345786da28accd2795f5a6a6cf3692168a2a71ca165708"
            },
            {
              "@type": "PropertyValue",
              "name": "hash",
              "value": "8A258E516081C36B866812E49495628CBDC1DD4126DB321A28AE95EE55B83BAB"
            }
          ]
        },
        {
          "@type": "PropertyValue",
          "name": "revision",
          "value": [
            {
              "@id": "https://www.example.com/blog/example-article/#/schema/article/abc123|version=17"
            }
          ]
        }
      ],
      "articleSection": "Cats,Dogs,Recipes",
      "author": {
        "@id": "https://www.example.com/#/schema/person/abc123"
      },
      "commentCount": 6,
      "dateModified": "2019-07-10T08:43:03+00:00",
      "datePublished": "2019-07-10T08:08:40+00:00",
      "description": "Example article description",
      "headline": "Example article headline",
      "image": [
        {
          "@id": "https://www.example.com/#/schema/image/abc123"
        }
      ],
      "inLanguage": "en-US",
      "isPartOf": {
        "@id": "https://www.example.com/blog/example-article/"
      },
      "mainEntityOfPage": {
        "@id": "https://www.example.com/blog/example-article/"
      },
      "publisher": {
        "@id": "https://www.example.com/#/schema/organization/abc123"
      },
      "version": "18"
    },
    {
      "@id": "https://www.example.com/blog/example-article/#/schema/article/abc123|version=17",
      "@type": "Article",
      "additionalProperty": [
        {
          "@type": "PropertyValue",
          "name": "encodedTimestamp",
          "value": [
            {
              "@type": "PropertyValue",
              "name": "blockchain",
              "value": "eos"
            },
            {
              "@type": "PropertyValue",
              "name": "transactionId",
              "value": "a4ce94cc4c0adda8075ac133b4de884a282e3de4ee1734d808a2e9737e06f5a1"
            },
            {
              "@type": "PropertyValue",
              "name": "hash",
              "value": "2DAD3812C721EF4A21541CCF1DB7C54BA1643294162B038ACDE8CF1CE7DA511B"
            }
          ]
        }
      ],
      "author": {
        "@id": "https://www.example.com/#/schema/person/abc123"
      },
      "dateModified": "2019-05-10T08:08:40+00:00",
      "datePublished": "2019-05-10T08:08:40+00:00",
      "headline": "Previous title from version 17",
      "image": {
        "@id": "https://www.example.com/#/schema/image/abc123"
      },
      "mainEntityOfPage": {
        "@id": "https://www.example.com/blog/example-article/"
      },
      "publisher": {
        "@id": "https://www.example.com/#/schema/organization/abc123"
      },
      "url": "https://www.example.com/blog/example-article/?version=17",
      "version": "17"
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions