You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Ullah, Izhar" <i....@lancaster.ac.uk> on 2017/07/28 19:23:52 UTC

Generic Rule Reasoning over Six Data Files Simultaneously

Hi all,

I am using a very simple code (given below) which invokes a generic rule reasoner to reason over a data files using Jena rules given in a separate txt file. The code given below deals with only one data file at the moment.


 Model dataFile1 = ModelFactory.createDefaultModel();



     dataFile1.read ("/Users/Desktop/myFolder/dataFile1.jsonld", "TURTLE");



    Reasoner reasoner = new

                    GenericRuleReasoner(Rule.rulesFromURL("/Users/Desktop/JenaRules/rules_iot.txt"));



  reasoner.setDerivationLogging(true);



  InfModel inf = ModelFactory.createInfModel(reasoner, dataFile1);


My question is, using the above code, how can we change/modify the code to read six (6) data files simultaneously and pass them to the reasoner for reasoning? Because my data belongs to different aspects of the same domain and one rule has several predicates, at least one from each data file so that the rule could fire only if all the predicates from corresponding data files could match.


If you require any further information please let me know.


Many thanks in advance.


Best regards,


Izhar

RE: Generic Rule Reasoning over Six Data Files Simultaneously

Posted by "Ullah, Izhar" <i....@lancaster.ac.uk>.
Fantastic, much appreciated.

Best regards,

Izhar


________________________________________
From: Dave Reynolds [dave.e.reynolds@gmail.com]
Sent: 29 July 2017 08:47
To: users@jena.apache.org
Subject: Re: Generic Rule Reasoning over Six Data Files Simultaneously

On 28/07/17 20:23, Ullah, Izhar wrote:
> Hi all,
>
> I am using a very simple code (given below) which invokes a generic rule reasoner to reason over a data files using Jena rules given in a separate txt file. The code given below deals with only one data file at the moment.
>
>
>   Model dataFile1 = ModelFactory.createDefaultModel();
>
>
>
>       dataFile1.read ("/Users/Desktop/myFolder/dataFile1.jsonld", "TURTLE");
>
>
>
>      Reasoner reasoner = new
>
>                      GenericRuleReasoner(Rule.rulesFromURL("/Users/Desktop/JenaRules/rules_iot.txt"));
>
>
>
>    reasoner.setDerivationLogging(true);
>
>
>
>    InfModel inf = ModelFactory.createInfModel(reasoner, dataFile1);
>
>
> My question is, using the above code, how can we change/modify the code to read six (6) data files simultaneously and pass them to the reasoner for reasoning? Because my data belongs to different aspects of the same domain and one rule has several predicates, at least one from each data file so that the rule could fire only if all the predicates from corresponding data files could match.

Just read all the files into the same model then reason over that.

Dave

Re: Generic Rule Reasoning over Six Data Files Simultaneously

Posted by Dave Reynolds <da...@gmail.com>.
On 28/07/17 20:23, Ullah, Izhar wrote:
> Hi all,
> 
> I am using a very simple code (given below) which invokes a generic rule reasoner to reason over a data files using Jena rules given in a separate txt file. The code given below deals with only one data file at the moment.
> 
> 
>   Model dataFile1 = ModelFactory.createDefaultModel();
> 
> 
> 
>       dataFile1.read ("/Users/Desktop/myFolder/dataFile1.jsonld", "TURTLE");
> 
> 
> 
>      Reasoner reasoner = new
> 
>                      GenericRuleReasoner(Rule.rulesFromURL("/Users/Desktop/JenaRules/rules_iot.txt"));
> 
> 
> 
>    reasoner.setDerivationLogging(true);
> 
> 
> 
>    InfModel inf = ModelFactory.createInfModel(reasoner, dataFile1);
> 
> 
> My question is, using the above code, how can we change/modify the code to read six (6) data files simultaneously and pass them to the reasoner for reasoning? Because my data belongs to different aspects of the same domain and one rule has several predicates, at least one from each data file so that the rule could fire only if all the predicates from corresponding data files could match.

Just read all the files into the same model then reason over that.

Dave