openlink / structured-data-sniffer

The Openlink Structured Data Sniffer (OSDS) is a plugin for the Chrome, Firefox and Opera browsers that detects and shows structured data embedded in web pages in either JSON-LD, Microdata, RDFa or Turtle format.
http://osds.openlinksw.com/
GNU General Public License v2.0
122 stars 22 forks source link

Cannot Parse Genre that's not a URL #13

Open mark-making opened 6 years ago

mark-making commented 6 years ago

This passes the SDTT, but not in the Chrome plugin.

{
  "@context": "http://schema.org",
  "@type": "CreativeWork",
  "isFamilyFriendly" : "true",
  "dateCreated" : "2017-10-12T16:46:27+00:00",
  "dateModified" : "2017-10-18T15:30:43+00:00",
  "headline": "Headline",
  "genre": "Technology and Innovation",
  "description": "Some description"                
}

Does not parse. It tries to put the site URL before it.

JSON-LD discovered, but fails syntax checking by parser: Error: Syntax error: unexpected "<http://site.url/Technology%20and" on line 6.

Is this an error with the plugin or related to: https://github.com/schemaorg/schemaorg/issues/51

TallTed commented 6 years ago

I'd say the issue here is not in OSDS, as the JSON-LD 1.0 Playground and 1.1 Dev Playground produce the same.

It does seem related to the schema.org context file, as discussed in their issue 51.

Note that as suggested there, you can address this in the JSON-LD (if that's under your control), by changing --

"genre": "Technology and Innovation",

-- to --

"genre": { "@value": "Technology and Innovation" },

Of course, as noted in schema.org issue 51, SDTT doesn't like that, which all appear to agree is a bug in SDTT.

@smalinin - Any other thoughts?