On 09.11.2016 14:18, tina sani wrote:
> Hello Lorenz, I know rules generate new tripls based on existed data, but I
> have to questions:
>
> (1) We have a model i-e model before Jena rules executes and then after
> inference/rules, our model will be inf, right? If we want to write a model,
> we will use inf.write()?
Yes.
>
> (2) My second query is, after rules, I will have several SPARQL queries run
> against the rules so what will be the order in which we write/run queries.
> It will be like queryString, execute query, then another queryString,
> execute query?
What means "query against rule"? That's totally unclear. You run the
SPARQL query on the inferred model.

And why should the order in which you run the SPARQL queries matter?
What would be the difference if you first run

SELECT * {?s a :cls}

and then

SELECT * {?s ?p ?o}

or vice versa?
>
> Regards
>
> On Wed, Nov 9, 2016 at 10:37 AM, Lorenz B. <
> [email protected]> wrote:
>
>>> Hello
>>> I have a text file, having more than twenty Jena rules. Usually we need
>>> SPARQL queries to execute and display the inference results.
>>>
>>> For my twenty rules, I need more or less ten queries, so what will be the
>>> sequence and proper way to use SPARQL queries?
>> What means "query for a rule"?
>> Rules are used to infer(generate) additional data based on existing data.
>>
>> 1) Load all rules into a the GenericRuleReasoner and apply it on the
>> original data -> you get a new model
>>
>> Reasoner reasoner = new GenericRuleReasoner(Rule.parseRules(rules));
>> InfModel inf = ModelFactory.createInfModel(reasoner, rawData);
>>
>>
>> 2) execute the SPARQL query against the new model which contains all the
>> data
>>
>> Lorenz
>>> I have some inverse property rules, symmetric, transitive and most are
>> Jena
>>> generic rules used in the text file.
>>>
>>> Thanks a lot.
>>>
>> --
>> Lorenz Bühmann
>> AKSW group, University of Leipzig
>> Group: http://aksw.org - semantic web research center
>>
>>

Reply via email to