Thank you Dave, I have a class "Expert", which have sub classes Researcher
and Teacher.
I have Jena rule like: If an Expert ResearchPapers more than 10, assign the
individual to Researcher sub class otherwise to Teacher subclass.
After writing the appropriate Jena rule, apart from SPARQL query
Select * Where{ ?ind rdf:type ont:Researcher . ?ind rdf:type ont:Teacher}
What is the alternate way to parse/execute the rule and the result
transfers to our infmodel. ?
On Sat, Dec 3, 2016 at 8:06 PM, Dave Reynolds <[email protected]>
wrote:
> On 03/12/16 16:05, javed khan wrote:
>
>> My question is what are the possible ways to implement the Jena rules?
>> Is it necessary that we should always execute the SPARQL query to
>> implement
>> the rules? If not, what are the alternatives?
>>
>> What if we just write rules in our Java code and do nothing other than:
>>
>> Reasoner myreasoner = new GenericRuleReasoner(Rule.parseRules(rule));
>> InfModel infmodel = ModelFactory.createInfModel(myreasoner, model);
>>
>
> Sorry, don't follow the question.
>
> Jena rules are the syntax for the built in Jena generic rules engine which
> can be run as you show above.
>
> You don't "implement the rules" by executing sparql queries you just run
> the rules engine. You could compute the same results through using a
> sequence of SPARQL queries and updates or through java code but that's not
> the same thing as implementing the rules unless you have some sort of
> jena-rules to "sequence of sparql updates" converter.
>
> If you are talking about getting results out after running the rules then
> your choices are SPARQL or the RDF API.
>
> Dave
>
>
>