Get no result for specific query via Javascript

0 views
Skip to first unread message

sita...@gmail.com

unread,
Feb 27, 2013, 1:47:48 AM2/27/13
to sta...@clarkparsia.com
This works:

# ./stardog query -c "http://127.0.0.1:5822/schema;reasoning=RDFS" -q "SELECT *  { 'http://schema.org/Hospital' rdfs:subClassOf ?o }  LIMIT 50"

I get the transitive class hierarchy, as I expect.

However, from node.js I get a  [ ] when I do this:

         var query = "select ?s ?o { 'http://schema.org/Hospital' rdfs:subClassOf ?o }";
        console.log(query);
        conn.query("schema", query,
            null, null, 0, function(data) {
                console.log(data.results.bindings) }

Other queries (like '?s rdfs:subClassOf ?o') work fine for me via the node module.

Any hints?

Jason Woodward

unread,
Feb 27, 2013, 8:30:03 AM2/27/13
to sta...@clarkparsia.com
You probably didn't enable reasoning in your js example?

conn.setReasoning('RDFS');

--
-- --
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
 
 

sita...@gmail.com

unread,
Feb 27, 2013, 10:58:20 AM2/27/13
to sta...@clarkparsia.com
I removed the reasoning to make the test case more simple. Sorry I should have posted exactly equivalent examples to eliminate that.

With the CLI I get results either way (with inference and without it), and no results at all with the JS client. 

I wondered about setting reasoning in the JS client. Apparently it's something other than setReasoning.

conn.setReasoning('RDFS');
     ^
TypeError: Object [object Object] has no method 'setReasoning'



Jason Woodward

unread,
Feb 27, 2013, 11:01:06 AM2/27/13
to sta...@clarkparsia.com
Are you using the version of stardog.js from master on GitHub? I submitted a patch after 0.1 was released which added the ability to configure reasoning on the connection. 
--
Jason Woodward
http://www.woodwardjd.com
@woodwardjd
Collaborative Purchasing Made Easy for Education at http://www.RecoVend.com

Edgar Rodriguez

unread,
Feb 27, 2013, 11:29:29 AM2/27/13
to sta...@clarkparsia.com
As Jason points out, the master branch on GitHub is the most updated source.
I just updated stardog.js in NPM to make the reasoning changes available to everybody, so `npm install stardog` should now contain support for enabling reasoning.

Cheers,
Edgar

sita...@gmail.com

unread,
Mar 3, 2013, 8:26:26 PM3/3/13
to sta...@clarkparsia.com

Cool - I npm updated and this now functions as expected. Thanks!

Edgar


For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
 
 
Reply all
Reply to author
Forward
0 new messages