A skim of the babel source code at
http://code.google.com/p/simile-widgets/source/browse/babel/trunk/engine/src/main/java/org/simileWidgets/babel/TranslatorServlet.java
Suggests that babel is able to take a "url" argument (http://babel?writer=jsonp&url=http://foo.com/my.rdf) that specifies the url of the data you want to convert.

On 12/19/2013 9:19 PM, Vicente Barreiro wrote:
It makes sense. I've been looking into Babel, and I can't find a way to pass the URL of my file. In the Babel home page the file is past as part of a Post and multipart request. I don't know how to do that with a single URL expression. *** sigh ***

On Thursday, December 19, 2013 8:36:37 AM UTC-6, David Karger wrote:

    I didn't read carefully enough.  In your number 2, you want to get
    rid of the script tag entirely, but take the src attribute of that
    tag and make it the href attribute of your link tag:

        <link rel="exhibit-data"
    
href="http://api.simile-widgets.org/exhibit/3.0.0rc1/exhibit-api.js?babel=http://service.simile-widgets.org/babel/translator?reader=rdf-xml%26writer=exhibit-jsonp%26mimetype=default/";
    
<http://api.simile-widgets.org/exhibit/3.0.0rc1/exhibit-api.js?babel=http://service.simile-widgets.org/babel/translator?reader=rdf-xml%26writer=exhibit-jsonp%26mimetype=default/>
    type="application/jsonp" >
    you also need to add an argument to babel telling it which (rdf)
    file to translate---the url of your celebTrunk.rdf file.

    explanation: the link tag is supposed to href something that
returns exhibit json. the babel url is one link that does so. putting a follow-on script tag doesn't change the fact that your
    href was returning a blob of rdf that exhibit doesn't understand.

    On 12/18/2013 11:29 PM, Vicente Barreiro wrote:
    No luck, it goes back to complaining about the formatting of the
    .rdf file (similar to number 2 below).


    On Wednesday, December 18, 2013 9:20:35 PM UTC-6, David Karger
    wrote:

        Not sure it will work, but try setting type to
        "application/jsonp"
        On 12/18/2013 10:02 PM, Vicente Barreiro wrote:
        I'm trying to create a basic example using Babel to
        translate RDF into Json, but I can't make it work. This is
        what I've tried:

        1. I was able to successfully reach Babel via a Web Service
        call. I used this command:

        curl --insecure --show-error --fail -F [email protected]
        -o mycelebs.js
        
'http://service.simile-widgets.org/babel/translator?reader=rdf-xml&writer=exhibit-json&mimetype=default
        
<http://service.simile-widgets.org/babel/translator?reader=rdf-xml&writer=exhibit-json&mimetype=default>'

        I was able to successfully get all my rdf tuples from the
        celebTrunc file converted to Json and stored in the js file.

        2. I was able to successfully reach Babel via a Web Service
        from the exhibit java script call in my HTML page. Here is
        the code snippet:

            <link rel="exhibit-data" href="celebTrunc.rdf"
        type="application/json" >
        <script
        
src="http://api.simile-widgets.org/exhibit/3.0.0rc1/exhibit-api.js?babel=http://service.simile-widgets.org/babel/translator?reader=rdf-xml%26writer=exhibit-jsonp%26mimetype=default/";
        
<http://api.simile-widgets.org/exhibit/3.0.0rc1/exhibit-api.js?babel=http://service.simile-widgets.org/babel/translator?reader=rdf-xml%26writer=exhibit-jsonp%26mimetype=default/>
        type="text/javascript"></script>
        I get an error message about celebTrunc.rdf file not being
        in json format (I expected as much), and then I get
        redirected to the Babel web service which returns an emty
        json item. So far, so good as I'm at least reaching Babel.

        3. I changed the type of the link file from
        "application/json" to "application/rdf+xml"

        This time, I get the "Working"  pop-up that would indicate
        that exhibit is loading data, but if I look into the
        javascript console, I see the error:

        Uncaught TypeError: Object [object global] has no method
        '_loadJSONP'

        And the page get stuck there, without showing the data is
        supposed to.

        And I'm stuck here trying to troubleshoot. Don't know enough
        javascript to attempt to debug. Any suggestions or tips?

        Thanks.
-- You received this message because you are subscribed to the
        Google Groups "SIMILE Widgets" group.
        To unsubscribe from this group and stop receiving emails
        from it, send an email to [email protected].
        To post to this group, send email to
        [email protected].
        Visit this group at
        http://groups.google.com/group/simile-widgets
        <http://groups.google.com/group/simile-widgets>.
        For more options, visit
        https://groups.google.com/groups/opt_out
        <https://groups.google.com/groups/opt_out>.

-- You received this message because you are subscribed to the
    Google Groups "SIMILE Widgets" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected] <javascript:>.
    To post to this group, send email to [email protected]
    <javascript:>.
    Visit this group at http://groups.google.com/group/simile-widgets
    <http://groups.google.com/group/simile-widgets>.
    For more options, visit https://groups.google.com/groups/opt_out
    <https://groups.google.com/groups/opt_out>.

--
You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/simile-widgets.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "SIMILE 
Widgets" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/simile-widgets.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to