HI Dave, Thanks for the additional comments.
Although I went back to using Fuseki(2) 3.10, I think I’ve just seen the transaction issue indeed. See B below for the trace. This happened when using the browser GUI browser as I ran a query in one dataset then ran it in another dataset after switching dataset in the GUI. I haven’t seen anything like this when I run queries from python. I’ve tried queries with randomly generated data with 5000 triples and I didn’t see the latency I had experienced with a couple dozens. So maybe that’s config related. (I didn’t check the issue with space in file IRIs though). In the end, I simplified the config per your previous suggestion. I’m copying it for the records – A below. It’s now just a GRR inf model over a TDB2 DB. What’s striking in comparison to my previous config with the two reasoners and the UnionModel is that, from what I’ve seen, I now get inference results immediately after loading data when in the previous config I would need to stop and restart fuseki after loading data to see inference results. Bit weird. I think that‘s problem solved and although I didn’t quite understand the whole doc on inference, I could recognise the solutions you pointed out --- I’ll stick with the @include for now, I think. Thank you very much for your kind and helpful comments. With many thanks and best regards, Pierre #### A: config @prefix : <http://base/#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix tdb2: <http://jena.apache.org/2016/tdb#> . @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix fuseki: <http://jena.apache.org/fuseki#> . :theService a fuseki:Service ; rdfs:label "Service with update and query to test minimal dataset with inference using an instance of generic rule reasoner including RDFS ruleset" ; fuseki:dataset :theDataset ; #:tdb_dataset_readwrite ; fuseki:name "eeetSimple" ; fuseki:serviceQuery "query" , "sparql" ; fuseki:serviceReadGraphStore "get" ; fuseki:serviceReadWriteGraphStore "data" ; fuseki:serviceUpdate "update" ; fuseki:serviceUpload "upload" . :theDataset a ja:RDFDataset ; ja:defaultGraph <#theModel_GRR> . <#theModel_GRR> a ja:InfModel ; ja:baseModel <#theGraph> ; ja:reasoner [ ja:reasonerURL <http://jena.hpl.hp.com/2003/GenericRuleReasoner> ; ja:rulesFrom <file:///C:/dev/apache-jena-fuseki-3.10.0/data/eeet/eeet-scale.rules> ] ; . <#theGraph> rdf:type tdb2:GraphTDB ; tdb2:dataset :theTDB2Dataset . :theTDB2Dataset a tdb2:DatasetTDB2 ; tdb2:location "C:\\dev\\apache-jena-fuseki-3.10.0\\run/databases/eeetSimple" ; tdb2:unionDefaultGraph true. #### B: Error message [2019-07-24 07:56:40] Fuseki WARN [7] RC = 500 : Iterator used inside a different transaction org.apache.jena.dboe.transaction.txn.TransactionException: Iterator used inside a different transaction at org.apache.jena.tdb2.store.IteratorTxnTracker.check(IteratorTxnTracker.java:53) at org.apache.jena.tdb2.store.IteratorTxnTracker.hasNext(IteratorTxnTracker.java:41) at org.apache.jena.atlas.iterator.Iter$2.hasNext(Iter.java:265) at org.apache.jena.atlas.iterator.Iter.hasNext(Iter.java:903) at org.apache.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90) at org.apache.jena.util.iterator.NiceIterator$1.hasNext(NiceIterator.java:105) at org.apache.jena.util.iterator.NiceIterator$1.hasNext(NiceIterator.java:105) at org.apache.jena.reasoner.rulesys.impl.TopLevelTripleMatchFrame.nextMatch(TopLevelTripleMatchFrame.java:55) at org.apache.jena.reasoner.rulesys.impl.LPInterpreter.run(LPInterpreter.java:328) at org.apache.jena.reasoner.rulesys.impl.LPInterpreter.next(LPInterpreter.java:190) at org.apache.jena.reasoner.rulesys.impl.Generator.pump(Generator.java:252) at org.apache.jena.reasoner.rulesys.impl.Generator.pump(Generator.java:239) at org.apache.jena.reasoner.rulesys.impl.LPBRuleEngine.pump(LPBRuleEngine.java:359) at org.apache.jena.reasoner.rulesys.impl.LPTopGoalIterator.moveForward(LPTopGoalIterator.java:107) at org.apache.jena.reasoner.rulesys.impl.LPTopGoalIterator.hasNext(LPTopGoalIterator.java:223) at org.apache.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90) at org.apache.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90) at org.apache.jena.util.iterator.FilterIterator.hasNext(FilterIterator.java:55) at org.apache.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90) at org.apache.jena.util.iterator.FilterIterator.hasNext(FilterIterator.java:55) at org.apache.jena.sparql.engine.iterator.QueryIterTriplePattern$TripleMapper.hasNextBinding(QueryIterTriplePattern.java:135) at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114) at org.apache.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding(QueryIterRepeatApply.java:74) at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114) at org.apache.jena.sparql.engine.iterator.QueryIterBlockTriples.hasNextBinding(QueryIterBlockTriples.java:63) at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114) at org.apache.jena.sparql.engine.iterator.QueryIterSlice.hasNextBinding(QueryIterSlice.java:76) at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114) at org.apache.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:39) at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114) at org.apache.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:39) at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114) at org.apache.jena.sparql.engine.ResultSetStream.hasNext(ResultSetStream.java:74) at org.apache.jena.sparql.engine.ResultSetCheckCondition.hasNext(ResultSetCheckCondition.java:55) at org.apache.jena.sparql.resultset.ResultSetApply.apply(ResultSetApply.java:38) at org.apache.jena.riot.resultset.rw.ResultSetWriterJSON.write(ResultSetWriterJSON.java:82) at org.apache.jena.riot.resultset.rw.ResultsWriter.write(ResultsWriter.java:127) at org.apache.jena.riot.resultset.rw.ResultsWriter.write(ResultsWriter.java:97) at org.apache.jena.fuseki.servlets.ResponseResultSet.lambda$generalOutput$1(ResponseResultSet.java:209) at org.apache.jena.fuseki.servlets.ResponseResultSet.output(ResponseResultSet.java:225) at org.apache.jena.fuseki.servlets.ResponseResultSet.generalOutput(ResponseResultSet.java:215) at org.apache.jena.fuseki.servlets.ResponseResultSet.doResponseResultSet$(ResponseResultSet.java:176) at org.apache.jena.fuseki.servlets.ResponseResultSet.doResponseResultSet(ResponseResultSet.java:85) at org.apache.jena.fuseki.servlets.SPARQL_Query.sendResults(SPARQL_Query.java:404) at org.apache.jena.fuseki.servlets.SPARQL_Query.execute(SPARQL_Query.java:286) at org.apache.jena.fuseki.servlets.SPARQL_Query.executeWithParameter(SPARQL_Query.java:238) at org.apache.jena.fuseki.servlets.SPARQL_Query.perform(SPARQL_Query.java:223) at org.apache.jena.fuseki.servlets.ActionService.executeLifecycle(ActionService.java:243) at org.apache.jena.fuseki.servlets.ActionService.execCommonWorker(ActionService.java:134) at org.apache.jena.fuseki.servlets.ActionBase.doCommon(ActionBase.java:74) at org.apache.jena.fuseki.servlets.FusekiFilter.doFilter(FusekiFilter.java:73) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642) at org.apache.jena.fuseki.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:285) at org.apache.jena.fuseki.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:248) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:690) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.Server.handle(Server.java:503) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) at java.lang.Thread.run(Unknown Source) [2019-07-24 07:56:40] Fuseki INFO [7] 500 Iterator used inside a different transaction (26 ms) THIS E-MAIL MAY CONTAIN CONFIDENTIAL AND/OR PRIVILEGED INFORMATION. IF YOU ARE NOT THE INTENDED RECIPIENT (OR HAVE RECEIVED THIS E-MAIL IN ERROR) PLEASE NOTIFY THE SENDER IMMEDIATELY AND DESTROY THIS E-MAIL. ANY UNAUTHORISED COPYING, DISCLOSURE OR DISTRIBUTION OF THE MATERIAL IN THIS E-MAIL IS STRICTLY FORBIDDEN. IN ACCORDANCE WITH MIFID II RULES ON INDUCEMENTS, THE FIRM'S EMPLOYEES MAY ATTEND CORPORATE ACCESS EVENTS (DEFINED IN THE FCA HANDBOOK AS "THE SERVICE OF ARRANGING OR BRINGING ABOUT CONTACT BETWEEN AN INVESTMENT MANAGER AND AN ISSUER OR POTENTIAL ISSUER"). DURING SUCH MEETINGS, THE FIRM'S EMPLOYEES MAY ON NO ACCOUNT BE IN RECEIPT OF INSIDE INFORMATION (AS DESCRIBED IN ARTICLE 7 OF THE MARKET ABUSE REGULATION (EU) NO 596/2014). (https://www.handbook.fca.org.uk/handbook/glossary/G3532m.html) COMPANIES WHO DISCLOSE INSIDE INFORMATION ARE IN BREACH OF REGULATION AND MUST IMMEDIATELY AND CLEARLY NOTIFY ALL ATTENDEES. FOR INFORMATION ON THE FIRM'S POLICY IN RELATION TO ITS PARTICIPATION IN MARKET SOUNDINGS, PLEASE SEE https://www.horizon-asset.co.uk/market-soundings/. HORIZON ASSET LLP IS AUTHORISED AND REGULATED BY THE FINANCIAL CONDUCT AUTHORITY. From: Dave Reynolds [mailto:[email protected]] Sent: 22 July 2019 20:11 To: [email protected] Subject: Re: Combining inferences from GRR and RDFS or OWL reasoner Hi Pierre, Good luck with tracking down the issues. It's certainly the case that the rule system can be slow even over memory based stores, so when running over a TDB store then performance can definitely be an issue and could make some queries look like they'll never finish. There was a recent report of a transaction error with the rule systems: https://issues.apache.org/jira/projects/JENA/issues/JENA-1719<https://issues.apache.org/jira/projects/JENA/issues/JENA-1719> That instance has been fixed for 3.13.0 so if you continue to run into those "in transaction" messages then try a nightly build. However, as it says in that Jira, the underlying issue runs fairly deep (due to the age of the rules systems which were build in an era of in memory stores and less clear transaction management) so there may be other manifestations of the problem with haven't been caught. Regards, Dave On 22/07/2019 17:55, Pierre Grenon wrote: > Hi Dave, > > Thanks so much for your detailed reply, it helped. > > I’ve looked into 1 so far (using @include) and I seem to have some good > results whether using <RDFS> or some file with the rule set. (In fact I tried > different variants of the rdfs rule set and it seemed to be doing about the > same.) Yes, indeed, it has to be all config based I’m afraid as java isn’t > the way to go in the context. > > However, I haven’t ironed out yet my config and I ran into a few crippling > inconveniences with Fuseki 3.12 (some apparently non terminating queries – > you need to hit ‘enter’ in the fuseki-server prompt to get a response, some > annoying white space issues in the file names -- %20 doesn’t help – and I had > some ‘in transaction’ message erratically at some point – no clue and I’m > sorry that I can’t reproduce this now.) > > I need to look more into > https://jena.apache.org/documentation/inference/#rules<https://jena.apache.org/documentation/inference/#rules> > I suppose as this is all a bit too much shooting in the dark. > > I’m trying again from scratch with a clean example, sticking with Fuseki > 3.10. I’ll post my config file if I manage. > > I have not looked at 2 yet. > > With many thanks and kind regards, > Pierre > > THIS E-MAIL MAY CONTAIN CONFIDENTIAL AND/OR PRIVILEGED INFORMATION. > IF YOU ARE NOT THE INTENDED RECIPIENT (OR HAVE RECEIVED THIS E-MAIL > IN ERROR) PLEASE NOTIFY THE SENDER IMMEDIATELY AND DESTROY THIS > E-MAIL. ANY UNAUTHORISED COPYING, DISCLOSURE OR DISTRIBUTION OF THE > MATERIAL IN THIS E-MAIL IS STRICTLY FORBIDDEN. > > IN ACCORDANCE WITH MIFID II RULES ON INDUCEMENTS, THE FIRM'S EMPLOYEES > MAY ATTEND CORPORATE ACCESS EVENTS (DEFINED IN THE FCA HANDBOOK AS > "THE SERVICE OF ARRANGING OR BRINGING ABOUT CONTACT BETWEEN AN INVESTMENT > MANAGER AND AN ISSUER OR POTENTIAL ISSUER"). DURING SUCH MEETINGS, THE > FIRM'S EMPLOYEES MAY ON NO ACCOUNT BE IN RECEIPT OF INSIDE INFORMATION > (AS DESCRIBED IN ARTICLE 7 OF THE MARKET ABUSE REGULATION (EU) NO 596/2014). > (https://www.handbook.fca.org.uk/handbook/glossary/G3532m.html<https://www.handbook.fca.org.uk/handbook/glossary/G3532m.html>) > COMPANIES WHO DISCLOSE INSIDE INFORMATION ARE IN BREACH OF REGULATION > AND MUST IMMEDIATELY AND CLEARLY NOTIFY ALL ATTENDEES. FOR INFORMATION > ON THE FIRM'S POLICY IN RELATION TO ITS PARTICIPATION IN MARKET SOUNDINGS, > PLEASE SEE > https://www.horizon-asset.co.uk/market-soundings/<https://www.horizon-asset.co.uk/market-soundings/>. > > HORIZON ASSET LLP IS AUTHORISED AND REGULATED > BY THE FINANCIAL CONDUCT AUTHORITY. > > > From: Dave Reynolds [mailto:[email protected]] > Sent: 21 July 2019 09:54 > To: [email protected] > Subject: Re: Combining inferences from GRR and RDFS or OWL reasoner > > Hi Pierre, > > You've two options for combining a GRR rule set and RDFS inference > either combine the rules into a single rule set and use a GRR > configuration or, as you say, layer the GRR reasoner over the top of an > RDFS reasoner. > > 1. To combine the rules then in your GRR rule set use the directive: > > @include <RDFS>. > > to include the rules for RDFS inference before your own rules. There are > some restrictions here though. Firstly, the default RDFS rules which are > included by this method need the transitive reasoner enabled. > Programmatically that's easy: > > reasoner.setTransitiveClosureCaching(true); > > However, I'm not sure if the assembler notation supports that. I'm not > really familiar with the assembler machinery but a quick glance through > the documentation and schema didn't turn up any obvious way to set this. > > If there really is no way to set this flag in assemblers, and if you are > restricted to using assemblers, then a workaround (other than option 2, > below) would be to use an RDFS rule set which doesn't need the > transitive reasoner. Jena includes such a rule set: > > https://github.com/apache/jena/blob/master/jena-core/src/main/resources/etc/rdfs-fb.rules<https://github.com/apache/jena/blob/master/jena-core/src/main/resources/etc/rdfs-fb.rules><https://github.com/apache/jena/blob/master/jena-core/src/main/resources/etc/rdfs-fb.rules<https://github.com/apache/jena/blob/master/jena-core/src/main/resources/etc/rdfs-fb.rules>> > > You could copy those somewhere visible to your application and @include > them from there. > > The other limitation of the single ruleset approach is that, because the > RDFS rules using a mix of forward and backward chaning, the rules you > add on top all[*] need to be written as backward chaining rules. > Otherwise they won't "see" the results of the RDFS backward chaining rules. > > 2. The alternative is, as you say, to configure an RDFS reasoner, then > configure a GRR instances whose base model is your RDFS reasoner. You > wouldn't then need a union as well - all the triples visible in the RDFS > InfGraph would be visible through the GRR InfGraph. > > Dave > > [*] Well, at least those that might be affected by the results of RDFS > inference. > > On 19/07/2019 22:36, Pierre Grenon wrote: >> apologies for piecemeal post -- didn't copy the whole file at first, so the >> RDFS reasoner, in particular, wasn't there. >> >> I'm wondering if I need to have an inf model with the GRR reasoner with an >> RDFS reasoner submodel and also the reverse and then union these... sounds a >> bit weird. >> >> With many thanks, >> Pierre >> >> *Rest of config file* >> >> THIS E-MAIL MAY CONTAIN CONFIDENTIAL AND/OR PRIVILEGED INFORMATION. >> IF YOU ARE NOT THE INTENDED RECIPIENT (OR HAVE RECEIVED THIS E-MAIL >> IN ERROR) PLEASE NOTIFY THE SENDER IMMEDIATELY AND DESTROY THIS >> E-MAIL. ANY UNAUTHORISED COPYING, DISCLOSURE OR DISTRIBUTION OF THE >> MATERIAL IN THIS E-MAIL IS STRICTLY FORBIDDEN. >> >> IN ACCORDANCE WITH MIFID II RULES ON INDUCEMENTS, THE FIRM'S EMPLOYEES >> MAY ATTEND CORPORATE ACCESS EVENTS (DEFINED IN THE FCA HANDBOOK AS >> "THE SERVICE OF ARRANGING OR BRINGING ABOUT CONTACT BETWEEN AN INVESTMENT >> MANAGER AND AN ISSUER OR POTENTIAL ISSUER"). DURING SUCH MEETINGS, THE >> FIRM'S EMPLOYEES MAY ON NO ACCOUNT BE IN RECEIPT OF INSIDE INFORMATION >> (AS DESCRIBED IN ARTICLE 7 OF THE MARKET ABUSE REGULATION (EU) NO 596/2014). >> (https://www.handbook.fca.org.uk/handbook/glossary/G3532m.html<https://www.handbook.fca.org.uk/handbook/glossary/G3532m.html><https://www.handbook.fca.org.uk/handbook/glossary/G3532m.html<https://www.handbook.fca.org.uk/handbook/glossary/G3532m.html>>) >> COMPANIES WHO DISCLOSE INSIDE INFORMATION ARE IN BREACH OF REGULATION >> AND MUST IMMEDIATELY AND CLEARLY NOTIFY ALL ATTENDEES. FOR INFORMATION >> ON THE FIRM'S POLICY IN RELATION TO ITS PARTICIPATION IN MARKET SOUNDINGS, >> PLEASE SEE >> https://www.horizon-asset.co.uk/market-soundings/<https://www.horizon-asset.co.uk/market-soundings/><https://www.horizon-asset.co.uk/market-soundings/<https://www.horizon-asset.co.uk/market-soundings/>>. >> >> HORIZON ASSET LLP IS AUTHORISED AND REGULATED >> BY THE FINANCIAL CONDUCT AUTHORITY. >> >> >> <#theModel_RDFS> a ja:InfModel ; >> ja:baseModel <#theGraph> ; >> ja:reasoner [ >> ja:reasonerURL >> <http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner<http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner><http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner<http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner>>> >> ] ; >> . >> >> <#theGraph> rdf:type tdb2:GraphTDB ; >> tdb2:dataset :theTDB2Dataset . >> >> :theTDB2Dataset >> a tdb2:DatasetTDB2 ; >> tdb2:location >> "C:\\dev\\apache-jena-fuseki-3.10.0\\run/databases/Conference1" ; >> tdb2:unionDefaultGraph true. >> >>> -----Original Message----- >>> From: Pierre Grenon >>> Sent: 19 July 2019 17:48 >>> To: '[email protected]' >>> Subject: Combining inferences from GRR and RDFS or OWL reasoner >>> >>> Hello, >>> >>> (I apologise for I am not sure if this has been addressed before and I have >>> not found the right thread or documentation.) >>> >>> The configuration file below seems to allow reasoning with either a GRR or >>> an out of the box reasoner on the same dataset. >>> >>> However, I don't think it allows combining inferences from both reasoners at >>> the same time. I am not sure how to achieve this through configuration. >>> >>> (Happy to provide an example of data and rule for the GRR. I've noticed this >>> when adding a rule to classify undeclared individuals, i.e., individuals >>> appearing in the subject position of a triple. The rule to the effect that >>> if >>> they do, they are instances of a class A. It is possible to derive the >>> instantiation. However, it is not possible to combine it with type >>> inheritance >>> from a reasoner. If class A is a subclass of class B, there is no inference >>> to the >>> effect that the individual is also an instance of class B.) >>> >>> With many thanks and kind regards, >>> Pierre >>> >>> >>> >>> >>> ----- >>> >>> >>> @prefix : <http://base/#> . >>> @prefix rdf: >>> <http://www.w3.org/1999/02/22-rdf-syntax-ns#<http://www.w3.org/1999/02/22-rdf-syntax-ns#><http://www.w3.org/1999/02/22-rdf-syntax-ns#<http://www.w3.org/1999/02/22-rdf-syntax-ns#>>> >>> . >>> @prefix tdb2: >>> <http://jena.apache.org/2016/tdb#<http://jena.apache.org/2016/tdb#><http://jena.apache.org/2016/tdb#<http://jena.apache.org/2016/tdb#>>> >>> . >>> @prefix ja: >>> <http://jena.hpl.hp.com/2005/11/Assembler#<http://jena.hpl.hp.com/2005/11/Assembler#><http://jena.hpl.hp.com/2005/11/Assembler#<http://jena.hpl.hp.com/2005/11/Assembler#>>> >>> . >>> @prefix rdfs: >>> <http://www.w3.org/2000/01/rdf-schema#<http://www.w3.org/2000/01/rdf-schema#><http://www.w3.org/2000/01/rdf-schema#<http://www.w3.org/2000/01/rdf-schema#>>> >>> . >>> @prefix fuseki: >>> <http://jena.apache.org/fuseki#<http://jena.apache.org/fuseki#><http://jena.apache.org/fuseki#<http://jena.apache.org/fuseki#>>> >>> . >>> >>> :theService a fuseki:Service ; >>> rdfs:label "Service with update and query to test minimal >>> dataset with inference using an instance of generic rule reasoner and >>> RDFSExptRuleReasoner" ; >>> fuseki:dataset :theDataset ; >>> #:tdb_dataset_readwrite ; >>> fuseki:name "Conference2" ; >>> fuseki:serviceQuery "query" , "sparql" ; >>> fuseki:serviceReadGraphStore "get" ; >>> fuseki:serviceReadWriteGraphStore >>> "data" ; >>> fuseki:serviceUpdate "update" ; >>> fuseki:serviceUpload "upload" . >>> >>> :theDataset a ja:RDFDataset ; >>> ja:defaultGraph <#theUnionModel> >>> . >>> >>> <#theUnionModel> a ja:UnionModel ; >>> ja:rootModel <#theRootModel> ; >>> ja:subModel <#theModel_GRR> , <#theModel_RDFS> . >>> >>> <#theRootModel> a ja:Model ; >>> ja:baseModel <#theGraph> ; >>> . >>> >>> >>> <#theModel_GRR> a ja:InfModel ; >>> ja:baseModel <#theGraph> ; >>> ja:reasoner [ >>> ja:reasonerURL >>> <http://jena.hpl.hp.com/2003/GenericRuleReasoner<http://jena.hpl.hp.com/2003/GenericRuleReasoner><http://jena.hpl.hp.com/2003/GenericRuleReasoner<http://jena.hpl.hp.com/2003/GenericRuleReasoner>>> >>> ; >>> ja:rulesFrom <file:///C:/dev/apache-jena-fuseki- >>> 3.10.0/data/conference/conference1.rules> >>> ] ; >>> . >>
