Hi

Is there a workaround for the same origin policy limitation that prevents an HTML page to load a URI outside of the origin domain of the webpage ? Basically what I would like to do is : 1/ parse RDFa from the page content and gather resource URIs 2/ fetch these URIs, get some data 3/ print info in popups or infobox on the page. All of that in the browser.

I know rdfquery and rdfstore-js, I know I can query SPARQL endpoints such as DBpedia returning JSONP, but I am really looking for a way to dereference the URI from the webpage. I think Talis did some RDF-to-JSONP converter (morph.talis.com or something like that), not running anymore, that would return RDF content of a URI in JSONP. That would be perfect for me, does this kind of service still exists somewhere ?

Thanks

asked 22 Feb '13, 03:57

ThomasFrancart's gravatar image

ThomasFrancart
89229
accept rate: 30%

edited 22 Feb '13, 03:58


Are you looking to load the URI simply to show the data or to parse it?

If you simply want to show the data, you could use an <iframe> such as <iframe src="http://ex.com/onto#term"></iframe> and position it somewhere on your page.

If, however, you want to parse it, that's a little more complicated using only the browser. You would need a server-side component (such as the Tails app you mentioned) to load the URI, and then parse it depending on its content: URI's response may contain HTML, RDF/XML, Turtle, or one of the many other formats... you would need to make sense of the format involved, and then return proper JSONP, so that it can be consumed by your browser app.

I'm not aware of a server-side component that does this job, however, you could possibly easily create one yourself using the popular Google Apps Script platform (it's free), or any other server-side language you wish.

Hope this helps.

EDIT

I decided to actually implement this using Apps Script myself, here you can find the simple code: https://gist.github.com/lmatteis/5013182 and also instructions on how to use it!

link

answered 22 Feb '13, 06:35

Luca%20Matteis's gravatar image

Luca Matteis
1.5k39
accept rate: 11%

edited 22 Feb '13, 07:49

I was talking about URIs from linked data sources, so basically Turtle or RDF/XML. I don't want to simply display the content, but parse the data and make something intelligent with it in the page like "fetch lat/long properties and display on a map". Thanks for pointer to google App Script, wasn't aware of that, will look into it.

(22 Feb '13, 07:04) ThomasFrancart ThomasFrancart's gravatar image

I added an apps script showing you how it could work.

(22 Feb '13, 07:53) Luca Matteis Luca%20Matteis's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×78
×23
×20
×16
×10

Asked: 22 Feb '13, 03:57

Seen: 735 times

Last updated: 22 Feb '13, 07:53