Semantics of relative URLs in schema.org Breadcrumbs in JSON-LD

google breadcrumbs json-ld
breadcrumb schema
schema org parser
breadcrumb errors
id breadcrumb
fix breadcrumbs markup
data vocabulary breadcrumb
breadcrumb issue google

The schema.org website gives an example of a breadcrumb represented in JSON-LD

<script type="application/ld+json">
{
 "@context": "http://schema.org",
 "@type": "BreadcrumbList",
 "itemListElement":
 [
  {
   "@type": "ListItem",
   "position": 1,
   "item":
   {
    "@id": "https://example.com/dresses",
    "name": "Dresses"
    }
  },
  {
   "@type": "ListItem",
  "position": 2,
  "item":
   {
     "@id": "https://example.com/dresses/real",
     "name": "Real Dresses"
   }
  }
 ]
}
</script>

Most of it is clear to me but I'm not absolutely certain about the semantics of the links provided in this example.

What I find confusing are the @id properties. Their values are URLs and it looks like these should lead to actual web pages linked to by the breadcrumb items. However, the name of the property suggests that the URLs might actually point to concept identifiers in some ontology. Which is it?

The Without Markup tab contains an unannotated piece of HTML suggesting that my first guess is correct and the URLs actually lead to web pages.

<ol>
  <li>
    <a href="https://example.com/dresses">Dresses</a>
  </li>
  <li>
    <a href="https://example.com/dresses/real">Real Dresses</a>
  </li>
</ol>

Is this the case and is it okay to use relative URLs in this context?

<script type="application/ld+json">
{
 "@context": "http://schema.org",
 "@type": "BreadcrumbList",
 "itemListElement":
 [
  {
   "@type": "ListItem",
   "position": 1,
   "item":
   {
    "@id": "https://dresses.com/dresses",
    "name": "Dresses"
    }
  },
  {
   "@type": "ListItem",
  "position": 2,
  "item":
   {
     "@id": "/dresses/cocktail",
     "name": "Cocktail Dresses"
   }
  }
 ]
}
</script>

I had the same question and end up doing research which I documented on https://webuniverse.io/relative-urls-in-structured-data/. Key part is this:

If you paste markup directly into google validator and there is a relative path - validator doesn't know which domain it belongs to and just appends its own domain (https://search.google.com). Once you deploy changes and test with real url you'll see that validator will append correct domain, so you can definitely use relative urls in structured data.

Relative urls in structured data, The schema.org website gives an example of a breadcrumb represented in JSON-LD <script type="application/ld+json"> { "#context": "http://schema.org",  Structured data markups - Will Relative URLs Work Fine? Using Absolute vs. Relative URLs in Schema images; Semantics of relative URLs in schema.org Breadcrumbs in JSON-LD; Absolute or relative local URL in Schema.org JSON-LD? There are people who are like me and are not certain about whether relative urls can be used.

In my opinion it should be ok.

Check: https://search.google.com/structured-data/testing-tool

Example test data with relative urls:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [{
    "@type": "ListItem",
    "position": 1,
    "item": {
      "@id": "http://www.example.com/",
      "name": "Home"
    }
  },{
    "@type": "ListItem",
    "position": 2,
    "item": {
      "@id": "/furniture/",
      "name": "Furniture"
    }
  },{
    "@type": "ListItem",
    "position": 3,
    "item": {
      "@id": "/furniture/kitchen/",
      "name": "Kitchen"
    }
  }]
}
</script>

Update Just checked once more: Oh google add domain http://www.example.com/ for items without absolute url in the output of structure data testing tool. So discard my message, I am not sure if the relative paths are supported, use absolute instead.

BreadcrumbList, Small research around using relative urls in structured data. Semantics of relative URLs in schema.org Breadcrumbs in JSON-LD · Absolute  BreadcrumbList using JSON-LD. A BreadcrumbList is an ItemList consisting of a chain of linked Web pages, typically described using at least their URL and their name, and typically ending with the current page. The position property is used to reconstruct the order of the items in a BreadcrumbList The convention is

All URLs should be absolute. You can use the official testing tool https://search.google.com/structured-data/testing-tool/u/0/ that is going to give an error in relative URLs.

schema.org - Breadcrumb with non-linked level, described using at least their URL and their name, and typically ending with the current page of the items in a BreadcrumbList The convention is that a breadcrumb list has an itemListOrder of Without Markup Microdata RDFa JSON​-LD. Schema.org Property: breadcrumb - A set of links that can help a user understand and navigate a website hierarchy.

Highest Voted 'json-ld' Questions, The point of breadcrumbs is to see the current page in the hierarchy, and to navigate to its parent pages. Page-less entries shouldn't appear there, because they  Ignored by JSON-LD. clickHandler function (Default: null) Listen for when a ListItem’s <a> tag is clicked. ListItem Props. url string (Required) The page to link to. type string (Default: Thing) Uses schema.org types. clickHandler function (Default: null) Listen for when the <a> tag is clicked. Takes precedence over BreadcrumbList’s clickHandler prop.

SCHEMA.ORG – Basic Markup, Any way to validate Schema.org JSON-LD before publishing? Google Structured Data Testing Tool Repeat Error: "The URL could not be rendered. schema.org json-ld semantic-web Google SERP's not displaying target/current page in breadcrumbs Absolute or relative local URL in Schema.org JSON-LD? JSON-LD: Use @id to specify the URL. Microdata: You can use href or itemid to specify the URL. RDFa: You can use about, href, or resource to specify the URL. If the breadcrumb is the last item in the breadcrumb trail, item is not required.

The Search Marketer's Guide to ItemRef & ItemID, individual elements of a web site and give them semantic meaning in a Microdata and JSON-LD. However, if the attribute is a URL, then the value of the tagged item <nav id = "div_header_menu" class = "menu_wrapper relative It is also worth noting the mark http://schema.org/breadcrumb, which  JSON-LD is compatible with schema.org, which allows the site owner to use this system’s semantics. The world’s largest search engine Google has evaluated the capabilities of JSON-LD. In mid-2014, the search engine recommended using this format for marking up data on musical band concert dates.

Comments
  • Not sure what you mean about the first link being required to be absolute. The tool returns no errors or warnings when all URLs are relative.
  • Ignore my message about first link
  • @rzasap: It’s no problem that Google displays the example domain for relative URLs; it’s a common practice in tools like that (I guess they do it to convey to their users that the value does get interpreted as URL, not just as text string).
  • @rzasap I ended up externalising all the URLs anyway as I had to rewrite the paths. I still think relative ones are fine as the validator does not consider this an error and I'd expect the domain that the JSON-LD document is served from will be assumed as the host.
  • That was not the case when I posted the question. Thanks for your answer, I'll have a look at it when I have a moment.
  • At the moment of writing this comment google structured data tool was not giving an error for relative urls. However it appends search.google.com domain in front of them.
  • In addition to my previous comment I can see that structured markup tool shows errors for images that have relative urls for article type. This is so confusing.