Re: Empty derivation files
On 30/07/12 23:09, Alejandro Rodríguez González wrote: Just another question: It is possible to see a more detailed debug of the derivations? For example, I want to know why some rules are not being fired, something that will help me to know what I'm doing wrong. Sorry no. There are sophisticated rule systems that can tell you why a rule wasn't fired but there's no support for that in JenaRules. Dave
Re: Basic federation in Jena
Oops, the webpage I mentionned had wrong code. The correct code to run my query is: QueryExeuction exec = QueryExecutionFactory.create(QueryFactory.create(yourfederatedquery, Syntax.syntaxARQ), new DatasetImpl(ModelFactory.createDefaultModel())); exec.execSelect(); Forcing the syntax to Syntax.syntaxARQ is mandatory because client-side federation is a ARQ-specific feature. On Tue, Jul 31, 2012 at 9:40 AM, Olivier Rossel olivier.ros...@gmail.com wrote: Hi all. I would like to try Jena basic federation. I tried this query: SELECT DISTINCT ?thCenturyClassicalComposers0 WHERE { SERVICE http://api.talis.com/stores/bbc-backstage/services/sparql { ?thCenturyClassicalComposers0 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://dbpedia.org/class/yago/20thCenturyClassicalComposers . }} LIMIT 300 with the code provided here: cf http://tech.groups.yahoo.com/group/jena-dev/message/48130 I get some results. Now I try this query: SELECT DISTINCT ?thCenturyClassicalComposers0 ?comment WHERE { SERVICE http://api.talis.com/stores/bbc-backstage/services/sparql {?thCenturyClassicalComposers0 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://dbpedia.org/class/yago/20thCenturyClassicalComposers . } SERVICE http://dbpedia.org/sparql {?thCenturyClassicalComposers0 http://www.w3.org/2000/01/rdf-schema#comment ?comment} } LIMIT 300 I get no result. But when checking data on each endpoint, I should get some results. Is there something wrong in my SPARQL SERVICE syntax? BTW, being able to limit/offset/orderBy and OPTIONALize each SERVICE block would be uber nice ! ! ! Is it possible already?
Re: Basic federation in Jena
On 31/07/12 08:52, Olivier Rossel wrote: Oops, the webpage I mentionned had wrong code. The correct code to run my query is: QueryExeuction exec = QueryExecutionFactory.create(QueryFactory.create(yourfederatedquery, Syntax.syntaxARQ), new DatasetImpl(ModelFactory.createDefaultModel())); exec.execSelect(); Forcing the syntax to Syntax.syntaxARQ is mandatory because client-side federation is a ARQ-specific feature. Only in very old versions of ARQ - SERVICE is part of SPARQL 1.1 On Tue, Jul 31, 2012 at 9:40 AM, Olivier Rossel olivier.ros...@gmail.com wrote: Hi all. I would like to try Jena basic federation. I tried this query: SELECT DISTINCT ?thCenturyClassicalComposers0 WHERE { SERVICE http://api.talis.com/stores/bbc-backstage/services/sparql { ?thCenturyClassicalComposers0 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://dbpedia.org/class/yago/20thCenturyClassicalComposers . }} LIMIT 300 with the code provided here: cf http://tech.groups.yahoo.com/group/jena-dev/message/48130 I get some results. Now I try this query: SELECT DISTINCT ?thCenturyClassicalComposers0 ?comment WHERE { SERVICE http://api.talis.com/stores/bbc-backstage/services/sparql {?thCenturyClassicalComposers0 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://dbpedia.org/class/yago/20thCenturyClassicalComposers . } SERVICE http://dbpedia.org/sparql {?thCenturyClassicalComposers0 http://www.w3.org/2000/01/rdf-schema#comment ?comment} } LIMIT 300 I get no result. But when checking data on each endpoint, I should get some results. Is there something wrong in my SPARQL SERVICE syntax? BTW, being able to limit/offset/orderBy and OPTIONALize each SERVICE block would be uber nice ! ! ! Is it possible already?
Re: Basic federation in Jena
(same question as yesterday) A few problems: 1/ Talis are turning off their online service so http://api.talis.com/... will stop working sometime. If this is a paid-for store, that wil be in several months; if hosted for free, it'll happen in the next few days. 2/ The services have a 30s timeout - if that goes off, you get no results from the SERVICE. 3/ DBpedia has 4/ You can use a subselect to restrict the remote query part: SERVICE ... { SELECT * { ... } LIMIT 300 } 4/ Execution is bottom up: The second block: SERVICE http://dbpedia.org/sparql { ?thCenturyClassicalComposers0 rdf:comments ?comment } may be executed repeatedly due to the execution strategty of ARQ but when I try: PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema# SELECT * { ?thCenturyClassicalComposers0 rdfs:comments ?comment } at the DBpedia sparql endpoint I get: Error HTTP/1.1 509 Bandwidth Limit Exceeded Andy On 31/07/12 08:40, Olivier Rossel wrote: Hi all. I would like to try Jena basic federation. I tried this query: SELECT DISTINCT ?thCenturyClassicalComposers0 WHERE { SERVICE http://api.talis.com/stores/bbc-backstage/services/sparql { ?thCenturyClassicalComposers0 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://dbpedia.org/class/yago/20thCenturyClassicalComposers . }} LIMIT 300 with the code provided here: cf http://tech.groups.yahoo.com/group/jena-dev/message/48130 I get some results. Now I try this query: SELECT DISTINCT ?thCenturyClassicalComposers0 ?comment WHERE { SERVICE http://api.talis.com/stores/bbc-backstage/services/sparql {?thCenturyClassicalComposers0 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://dbpedia.org/class/yago/20thCenturyClassicalComposers . } SERVICE http://dbpedia.org/sparql {?thCenturyClassicalComposers0 http://www.w3.org/2000/01/rdf-schema#comment ?comment} } LIMIT 300 I get no result. But when checking data on each endpoint, I should get some results. Is there something wrong in my SPARQL SERVICE syntax? BTW, being able to limit/offset/orderBy and OPTIONALize each SERVICE block would be uber nice ! ! ! Is it possible already?
Re: Empty derivation files
Hi Dave, Thanks, this makes my task harder :-) Let me then ask you a question about the rules that I have. Maybe you can help me with this. Based on the same example that we were talking I want to create a rules that are executed when I have sign A, B (compulsory) and one of the following: C, D, E). For this, I already have a solution creating several combinations such as A,B,C; A,B,D; etc.. but I want other design. I've then some rules where, first of all, I close the world using noValue and specifying only A,B,C,D, and E as valid signs. Then, I've created a rule that should be fired (with diagnosis result) only if I have A, B (compulsory) and a counter with a value greater or equal to 1. Then, I've developed also three more rules (one per remaining sign: C,D,E), that increases this counter. However it seems to not be working. Here are the rules: http://pastebin.com/LeWY7Ndq PD: The counter doesn't exist in my current ontology. It is created in the same way than hasNegSign. Thanks! ___ Sorry no. There are sophisticated rule systems that can tell you why a rule wasn't fired but there's no support for that in JenaRules. Dave
Re: Basic federation in Jena
Forcing the syntax to Syntax.syntaxARQ is mandatory because client-side federation is a ARQ-specific feature. Only in very old versions of ARQ - SERVICE is part of SPARQL 1.1 As far as I understand, SERVICE in SPARQL 1.1 is server-side federation. And you have no way to federate with local data. Whereas Syntax.syntaxARQ forces Jena-ARQ to be the federation query planner. And each SPARQL endpoint receives a part of the query with variables correctly pre-bound and no SERVICE keyword. Is that right?
Re: Empty derivation files
On 31/07/12 09:41, Alejandro Rodríguez González wrote: Hi Dave, Thanks, this makes my task harder :-) Let me then ask you a question about the rules that I have. Maybe you can help me with this. Based on the same example that we were talking I want to create a rules that are executed when I have sign A, B (compulsory) and one of the following: C, D, E). For this, I already have a solution creating several combinations such as A,B,C; A,B,D; etc.. but I want other design. Why? The correct, standard way to do disjunctions in rule systems is to have multiple rules. Stick with that approach. I've then some rules where, first of all, I close the world using noValue and specifying only A,B,C,D, and E as valid signs. Then, I've created a rule that should be fired (with diagnosis result) only if I have A, B (compulsory) and a counter with a value greater or equal to 1. Counting in JenaRules is a pain because it is non-monotonic, you have to go round deleting values and using noValue checks. It is really outside the design centre for JenaRules (deductive closures for RDFS++). If you find you have to do that sort of thing a lot then JenaRules may not be the right technology for your problem. Then, I've developed also three more rules (one per remaining sign: C,D,E), that increases this counter. However it seems to not be working. Here are the rules: http://pastebin.com/LeWY7Ndq The only rule that that initializes the counter is: rule_dX_NOT_REST_SIGNS which (a) only fires if there is a finding other than sA to sE and (b) asserts your ont:dX_NOT_SIGNS flag. So the only situation in which there is a zero counter to get the counting started is one where you have some other finding and even then those counting rules will never fire because they are guarded by: noValue(?i, ont:hasNegSign ont:dX_NOT_SIGNS) If they did fire than be aware that the counting rules you have do not remove the older counts (the painful bit of counting in JenaRules) so you'll end up with all the count values not a single total value. Dave