inference rule set and data in different graphs

0 views
Skip to first unread message

gangf...@gmail.com

unread,
Mar 3, 2015, 9:49:39 AM3/3/15
to sta...@clarkparsia.com
Hi,

I want to load the RDFS rule set in a named graph, and load the data in a separate named graph different from rule set.

Then I want to run query with inference turned on:
bin/stardog query "nary;reasoning=RDFS" test.sparql

I found the inference cannot work in this way. The only I can make inference work is that I need to load both rule set and data into the default graph....
Am I wrong? Is there anything I missed?

Thank you very much!

Best,
Gang

Mike Grove

unread,
Mar 3, 2015, 9:54:45 AM3/3/15
to stardog
Yes.  If you going to put your tbox in a graph other than the default, you have to tell Stardog where you've put it [1]; by default, it will only look in the default graph.

Cheers,

Mike 



Thank you very much!

Best,
Gang

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

Gang Fu

unread,
Mar 3, 2015, 11:23:01 AM3/3/15
to sta...@clarkparsia.com
Hi Mike,

Thank you for your reply. Here is what I have done:
1) create db can point the reasoning schema to both default graph and a named graph called 'http://tbox':
bin/stardog-admin db create -o reasoning.schema.graphs=default,http://tbox -n testDB

2) load the rule set to both default graph and the 'http://tbox'
bin/stardog data add -g http://tbox testDB <my rule set file>

3) load the data into another named graph called 'http:abox':
bin/stardog data add -g http://abox testDB  <my data file>

Then I try a query with inference required to run, and I got nothing back:
either:
bin/stardog query execute --reasoning RDFS testDB <my query file>
bin/stardog query "testDB;reasoning=RDFS"  <my query file>

However, if I load data into default graph (now both rule set and data are in default graph), when I run the same query, I can get some results.

Best,
Gang

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

Héctor Pérez-Urbina

unread,
Mar 5, 2015, 1:56:45 PM3/5/15
to stardog
Are you specifying the named graph containing the ABox in the query?
Best,
Héctor

Gang Fu

unread,
Mar 10, 2015, 7:44:55 AM3/10/15
to sta...@clarkparsia.com
Hi Hector,

I just provided the db name, here is how I did query:
bin/stardog query "testDB;reasoning=RDFS"  <my query file>

testDB is the db having both Abox and Tbox...how can I provide the named graph in query?


Best,
Gang

Evren Sirin

unread,
Mar 10, 2015, 9:25:26 AM3/10/15
to Stardog
You can use FROM or GRAPH clauses in your query. See the SPARQL spec
[1] for details. Also see this FAQ entry [2] querying named graphs.

Best,
Evren

[1] http://www.w3.org/TR/sparql11-query/#specifyingDataset
[2] http://docs.stardog.com/#_why_don_t_my_queries_work

Gang Fu

unread,
Mar 10, 2015, 9:53:22 AM3/10/15
to sta...@clarkparsia.com
If you mean in the query, yes, definitely, I have 'from' clause in my query, I though you were talking about stardog specific graph parameter....

Gang Fu

unread,
Mar 12, 2015, 6:32:13 PM3/12/15
to sta...@clarkparsia.com
By the way,here is the log file:
WARNING: There was a problem determining the types of the query variables. Reasoning will not be performed.
Mar 12, 2015 2:40:57 PM com.complexible.stardog.reasoning.blackout.PlanRewriter$Rewriter transform

Kendall Clark

unread,
Mar 12, 2015, 7:28:07 PM3/12/15
to stardog
Please read the fine manual; it covers this issue explicitly.

Cheers,
Kendall Clark
Reply all
Reply to author
Forward
0 new messages