help with TypeError: _ is undefined in stardogjs execution

5 views
Skip to first unread message

Sabino Pariente Juarez

unread,
Mar 13, 2015, 8:20:14 PM3/13/15
to sta...@clarkparsia.com
Hi everybody

I'm trying to use stardog.js from browser to execute  a sparql query,
however I can't get a connection with server or I don't know if I forgot something
this is the code that I implemented
I only import stardogjs library

<script src="js/stardog.js" type="text/javascript"></script>
<script type="text/javascript">
    var conn = new Stardog.Connection();
    conn.setEndpoint("http://localhost:5820/");
    conn.setReasoning("QL");
    conn.setCredentials("admin", "admin");
    conn.query({
        database: "prueba",
        query: "select distinct ?s where { ?s ?p ?o }", 
        limit: 10,
        offset: 0
    },
    function (data) {
        console.log(data.results.bindings);
    });
</script>

this code throws the next exception



best regards...

Sabino Pariente Juarez

unread,
Mar 13, 2015, 8:24:54 PM3/13/15
to sta...@clarkparsia.com
I forgot to mention that the code in based on https://github.com/clarkparsia/stardog.js and the stardog js version is 0.1.6 thanks

Edgar Rodriguez

unread,
Mar 16, 2015, 9:51:02 AM3/16/15
to sta...@clarkparsia.com
It seems like the stardog.js dependencies are missing, underscore and jquery.
If you're using bower[1], these dependencies must be in your `bower_components` directory, you just need to include the JS files with the script tags in your code.

As a reference, you can check out the stardog.js dependencies in the bower.json[2] file.

Best,
Edgar


--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Sabino Pariente Juarez

unread,
Mar 18, 2015, 11:24:10 AM3/18/15
to sta...@clarkparsia.com
thank you Edgar 
your answer was very useful, now I have achieved to get reply from server.


MC. Sabino Pariente Juárez
Cel: 7771347513


To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.

Reply all
Reply to author
Forward
0 new messages