Hi Manuel, yes. You should use JSON-P aka. JSON w/ callback.

DBpedia/Virtuoso's JSON output module supports ?callback=foobar query
string parameter, eg.

<script type="text/javascript"
src="http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&should-sponge=&query=SELECT+DISTINCT+%3Fs+WHERE+%7B%0D%0A%3Fs+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23type%3E+%3Chttp%3A%2F%2Fdbpedia.org%2Fclass%2Fyago%2FXbox360Games%3E+.%0D%0A%7D&format=application%2Fsparql-results%2Bjson&debug=on&timeout=&callback=foobar";></script>

In the Javascript code on your domain, define foobar(data){} to handle
the query results.

Best wishes,
--
Joe Presbrey

2010/6/24 Manuel Schölling <manuel.schoell...@gmx.de>:
> Hi,
>
> is there any possibility to access dbpedia from another domian?
>
> This code snippet does not work, because the dbpedia server does not
> support Access-Control-Allow-Origin in the response header:
>
>    var req = new XMLHttpRequest();
>    req.open("GET", "http://dbpedia.org/sparql";);
>    req.send();
>
> If you know any possibility to make this work (beside implementing a
> severside proxy script) I'd be very pleased to hear.
>
> Cheers,
> Manuel
>
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Dbpedia-discussion mailing list
> Dbpedia-discussion@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion
>

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to