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
121 stars 22 forks source link

JSON-LD link open the extension in a new tab #9

Open Manu1400 opened 7 years ago

Manu1400 commented 7 years ago

Hi,

I used the extension "OpenLink Structured Data Sniffer" (in version 2.15.2) on Google Chrome.

1/ Open the webpage https://psh.techlib.cz/skos/PSH13814 in Google Chrome 2/ Click on the link "Heslo ve formátu JSON-LD" (with your mouse) in left column 3/ A new tab is opened (and have focus) : chrome-extension://egdaiaihbdoiibopledjahjaihbmjhdj/page_panel.html?url=https%3A%2F%2Fpsh.techlib.cz%2Fapi%2Fconcepts%2FPSH13814%3Fformat%3Denriched&type=jsonld&ext= 4/ On the other browser tab, the json-ld in displayed but the extension don't work.

Settings of the extension : defaults settings

Expectation: -

Reality: The new tab is opened with a "JSON-LD" empty tab.

Thanks for this greatfull extension.

Manu1400 commented 7 years ago

More quickly step(s): 1/ In a new tab, open https://psh.techlib.cz/api/concepts/PSH13814?format=enriched

Reality: an other tab is displayed.

The GET request https://psh.techlib.cz/api/concepts/PSH13814?format=enriched have in respond : Content-Type:application/ld+json

BigBlueHat commented 5 years ago

@Manu1400 the context file referenced from those data document is invalid. The http://psh.techlib.cz/api/context.json file should be rewritten to be an object with a @context key with the context information as it's value--i.e. it should not be a "bare" JSON object.

The response for the @context right now looks like (trimmed for length):

{
  "@base": "http://psh.techlib.cz/skos/",
  "@vocab": "http://www.w3.org/2004/02/skos/core#",
  "alephSysno": null,
  "altLabel": {
    "@container": "@language"
  }
}

It should instead be:

{
  "@context": {
    "@base": "http://psh.techlib.cz/skos/",
    "@vocab": "http://www.w3.org/2004/02/skos/core#",
    "alephSysno": null,
    "altLabel": {
      "@container": "@language"
    }
  }
}

I'll reach out to those developers also in hopes that they can fix it.

Hope that helps! 🎩