3

I'm trying to encode in JSON-LD the semantic information related to a website using Schema.org. The web site is very basic: it contains the home page, a gallery page with a list of images and the image detail page.

Reading the different examples from the Schema.org website, and having a look also at the "get started" section, it is not so easy to understand which information have to be provided in each page.

To clarify the question, I can provide a snippet of code that I'm trying to create, by deducing the needed information after reading the Schema.org documentation.

Below the list of specific questions:

  • Does the information provided in the home page need to be repeated in all of the other pages? In this case, how the additional information shall be encoded (how to state that the page is a ImageGallery or ImageObject)?
  • How to match (in the image detail page) the image with a URI to semantically link the thing in the image to a real world thing (using for example a dbpedia.org/resource/URI)?

Example

HOME PAGE

{ "@context":"http://schema.org",

   "@type":"WebSite",
   "name":"Site name abc",
   "alternateName":"ABC",
   "description":"description",
   "keywords":"keywords",
   "inLanguage":"en",
   "url":"http://www.thewebsiteurl.com",
   "potentialAction":{
     "@type":"SearchAction",
     "target":"http://www.thewebsiteurl.com/find/{search_term_string}",
     "query-input":"required name=search_term_string"
   }
}

GALLERY PAGE

{  "@context":"http://schema.org",
   "@type":"ImageGallery",
   "description":"description",
   "keywords":"keywords",
   "associatedMedia":[
   {
       "@type":"ImageObject",
       "contentUrl": "http://...../image1URL.jpg",
   },
   {
           "@type":"ImageObject",
       "contentUrl": "http://...../image2URL.jpg",    
   },
   .....
   ]
}

IMAGE DETAIL PAGE

{
  "@context": "http://schema.org",
  "@type": "ImageObject",
  "author":{
    "@type": "Person",
    "name":"abc"
  },
  "contentLocation":{ 
      "@type": "Place",
      "geo": {
        "@type": "GeoCoordinates",
        "latitude": "[latitude]",
        "longitude": "[longitude]"
      },
      "name": "Place name"
  },
  "copyrightHolder":{
      "@type": "Organization",
      "email": "info@example.mail",
      "url" : "http://www.thewebsiteurl.com"
  },
  "contentUrl": "http://...../image1URL.jpg",
  "datePublished": "[date]",
  "description": "description",
  "keywords":"keywords",
  "name": "Image name",
  "exifData":[
  {
    "@type": "PropertyValue",
    "name": "Exposure Time",
    "value": "1/10 sec."
  },
  .....
  ]   
}
unor
  • 92,415
  • 26
  • 211
  • 360
user9370976
  • 157
  • 1
  • 2
  • 13

1 Answers1

2

Does the information provided in the home page need to be repeated in all of the other pages?

With the syntaxes Microdata and RDFa, you would typically mark up what is available on a page. While the syntax JSON-LD is different from them (because it’s not marking up, i.e., it’s decoupled from the existing markup), there is no reason to handle it differently.

If you have content about a certain image on the homepage, the gallery page, and the detail page, you may (and, in my opinion, should) provide structured data about it on each of these pages.

One reason for this is that consumers don’t necessarily parse your whole site:

  • A consumer might find a single page, look for structured data, and is gone again without looking for another page of your website.
  • A consumer might find a single page, look for structured data, is interested in more data and follows links specified in your structured data (e.g., URIs given as property values).

So ideally provide structured data (or reference structured data which is provided elsewhere on your site) wherever it’s relevant.

In this case, how the additional information shall be encoded (how to state that the page is a ImageGallery or ImageObject)?

It can make sense to differentiate between the type for the document (in the case of web page, WebPage or one of its subtypes) and the type(s) for the thing(s) described in this document.

So ImageGallery (which is a subtype of WebPage) represents the page, and ImageObject represents an image that could be part of this page.

If possible (but it often isn’t), you should provide properties that put all provided nodes in relation. For example with hasPart/isPartOf, mainEntity/mainEntityOfPage, or of course properties like author etc.

How to match (in the image detail page) the image with a URI to semantically link the thing in the image to a real world thing (using for example a dbpedia.org/resource/URI)?

Schema.org’s sameAs property could be used for this purpose. But you could of course also use properties from other vocabularies, like owl:sameAs.

unor
  • 92,415
  • 26
  • 211
  • 360
  • Thank you for your answer. So basically i can use the types as follow: "WebPage" for the homepage, ImageGallery per the page containing the list of images and ImageObject for the page that contains the detail fof a specific image? - Regarding the semantic link to an external resource like DBpedia: sameAs could be an option. What about the property "mainEntityOfPage"? – user9370976 Mar 22 '16 at 07:56
  • 1
    @user3535189: If you want to provide a type for the page and a type for the "content" entities: you [could use `ItemPage` for the image detail page](http://webmasters.stackexchange.com/a/91260/17633) and `ImageObject` for the image, and use `mainEntity`/`mainEntityOfPage` to relate these two entities. Same with the gallery: `ImageGallery` for the page and several `ImageObject` (or for example a `ItemList` with several `ImageObject`) for the actual content. – unor Mar 22 '16 at 13:05