You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Anuj Kumar <an...@gmail.com> on 2011/03/26 18:18:30 UTC

ARQ Vs Jena Inference support for RDF

Hello Everyone,

I am trying some basic inferencing with Jena 2 Inference support and
following the tutorial given here: http://jena.sourceforge.net/inference/

There are some basic inferencing regarding the property of a resource and
its sub property in my TDB instance. I have loaded a set of triples into TDB
and I am creating a model from the TDBFactory using the TDB database
location. The basic inferencing is taking longer time as compared to SPARQL
queries. I have limited RAM of 2GB and just trying to compare the two
approaches.

What exactly is a better approach to do such inferencing? Also if you have
your own custom rules, is it better to go with SPARQL queries or Jena
Inference mechanism?

Any thoughts/suggestion will be of great help.

Also, if this is the right place; there is a small typo in 3rd line of
http://jena.sourceforge.net/inference/#RDFSintro -> or manually via *
ReasonerRegistery*.getRDFSReasoner() should be *ResonerRegistry*. Same
change is required in first line of
http://jena.sourceforge.net/inference/#OWLconfiguration

Thanks,
Anuj

Re: ARQ Vs Jena Inference support for RDF

Posted by Anuj Kumar <an...@gmail.com>.
Thanks Andy.

I tried creating a model using the TDBFactory from the parsed triples that
were present in TDB and initialized the InferenceSetupRDFS with the same.
Although I am getting OutOfMemory due to memory constraints and larger model
(~ 14GB) on my machine but I am able to follow. I will give it a try with a
smaller model to understand the inference further.

Thanks,
Anuj

On Wed, Mar 30, 2011 at 12:09 AM, Andy Seaborne <
andy.seaborne@epimorphics.com> wrote:

>
>
> On 29/03/11 19:34, Anuj Kumar wrote:
>
>> Thanks Andy. That was helpful and makes sense to do it once and store it
>> for
>> future references. On the same lines, I was looking into
>> InferenceExpanderRDFS class. I am using Jena 2.6.4, but I couldn't locate
>> this class.
>>
>> Is that the right one?
>>
>
> See
> org.openjena.riot.pipeline.inf.InferenceSetupRDFS
> in ARQ
>
>
>
>> - Anuj
>>
>> On Tue, Mar 29, 2011 at 7:29 PM, Andy Seaborne<
>> andy.seaborne@epimorphics.com>  wrote:
>>
>>
>>>
>>> On 27/03/11 16:37, Anuj Kumar wrote:
>>>
>>>  Thanks Bob. Will take a look at it.
>>>>
>>>> - Anuj
>>>>
>>>> On Sun, Mar 27, 2011 at 7:14 PM, Bob DuCharme<bo...@snee.com>   wrote:
>>>>
>>>>  is it better to go with SPARQL queries or Jena Inference mechanism?
>>>>
>>>>>
>>>>>>
>>>>> You might want to look into SPIN, which provides a way to implement
>>>>> rules
>>>>> using SPARQL CONSTRUCT and ASK queries: http://www.spinrdf.org/
>>>>>
>>>>> Bob
>>>>>
>>>>>
>>>>> On 3/26/2011 1:18 PM, Anuj Kumar wrote:
>>>>>
>>>>>  Hello Everyone,
>>>>>
>>>>>>
>>>>>> I am trying some basic inferencing with Jena 2 Inference support and
>>>>>> following the tutorial given here:
>>>>>> http://jena.sourceforge.net/inference/
>>>>>>
>>>>>> There are some basic inferencing regarding the property of a resource
>>>>>> and
>>>>>> its sub property in my TDB instance. I have loaded a set of triples
>>>>>> into
>>>>>> TDB
>>>>>> and I am creating a model from the TDBFactory using the TDB database
>>>>>> location. The basic inferencing is taking longer time as compared to
>>>>>> SPARQL
>>>>>> queries. I have limited RAM of 2GB and just trying to compare the two
>>>>>> approaches.
>>>>>>
>>>>>>
>>>>>  Inferencing does take memory and time but it can be done once and the
>>> results stored, so query is done without recalculating.
>>>
>>>
>>>
>>>  What exactly is a better approach to do such inferencing? Also if you
>>>>>> have
>>>>>> your own custom rules, is it better to go with SPARQL queries or Jena
>>>>>> Inference mechanism?
>>>>>>
>>>>>>
>>>>>  If you just have some RDFS, then riot.infer will, in a streaming
>>> fashion,
>>> expand the data once and for all.  You can feed the output into the bulk
>>> loader.
>>>
>>>        Andy
>>>
>>>
>>

Re: ARQ Vs Jena Inference support for RDF

Posted by Andy Seaborne <an...@epimorphics.com>.

On 29/03/11 19:34, Anuj Kumar wrote:
> Thanks Andy. That was helpful and makes sense to do it once and store it for
> future references. On the same lines, I was looking into
> InferenceExpanderRDFS class. I am using Jena 2.6.4, but I couldn't locate
> this class.
>
> Is that the right one?

See
org.openjena.riot.pipeline.inf.InferenceSetupRDFS
in ARQ

>
> - Anuj
>
> On Tue, Mar 29, 2011 at 7:29 PM, Andy Seaborne<
> andy.seaborne@epimorphics.com>  wrote:
>
>>
>>
>> On 27/03/11 16:37, Anuj Kumar wrote:
>>
>>> Thanks Bob. Will take a look at it.
>>>
>>> - Anuj
>>>
>>> On Sun, Mar 27, 2011 at 7:14 PM, Bob DuCharme<bo...@snee.com>   wrote:
>>>
>>>   is it better to go with SPARQL queries or Jena Inference mechanism?
>>>>>
>>>>
>>>> You might want to look into SPIN, which provides a way to implement rules
>>>> using SPARQL CONSTRUCT and ASK queries: http://www.spinrdf.org/
>>>>
>>>> Bob
>>>>
>>>>
>>>> On 3/26/2011 1:18 PM, Anuj Kumar wrote:
>>>>
>>>>   Hello Everyone,
>>>>>
>>>>> I am trying some basic inferencing with Jena 2 Inference support and
>>>>> following the tutorial given here:
>>>>> http://jena.sourceforge.net/inference/
>>>>>
>>>>> There are some basic inferencing regarding the property of a resource
>>>>> and
>>>>> its sub property in my TDB instance. I have loaded a set of triples into
>>>>> TDB
>>>>> and I am creating a model from the TDBFactory using the TDB database
>>>>> location. The basic inferencing is taking longer time as compared to
>>>>> SPARQL
>>>>> queries. I have limited RAM of 2GB and just trying to compare the two
>>>>> approaches.
>>>>>
>>>>
>> Inferencing does take memory and time but it can be done once and the
>> results stored, so query is done without recalculating.
>>
>>
>>
>>>>> What exactly is a better approach to do such inferencing? Also if you
>>>>> have
>>>>> your own custom rules, is it better to go with SPARQL queries or Jena
>>>>> Inference mechanism?
>>>>>
>>>>
>> If you just have some RDFS, then riot.infer will, in a streaming fashion,
>> expand the data once and for all.  You can feed the output into the bulk
>> loader.
>>
>>         Andy
>>
>

Re: ARQ Vs Jena Inference support for RDF

Posted by Anuj Kumar <an...@gmail.com>.
Thanks Andy. That was helpful and makes sense to do it once and store it for
future references. On the same lines, I was looking into
InferenceExpanderRDFS class. I am using Jena 2.6.4, but I couldn't locate
this class.

Is that the right one?

- Anuj

On Tue, Mar 29, 2011 at 7:29 PM, Andy Seaborne <
andy.seaborne@epimorphics.com> wrote:

>
>
> On 27/03/11 16:37, Anuj Kumar wrote:
>
>> Thanks Bob. Will take a look at it.
>>
>> - Anuj
>>
>> On Sun, Mar 27, 2011 at 7:14 PM, Bob DuCharme<bo...@snee.com>  wrote:
>>
>>  is it better to go with SPARQL queries or Jena Inference mechanism?
>>>>
>>>
>>> You might want to look into SPIN, which provides a way to implement rules
>>> using SPARQL CONSTRUCT and ASK queries: http://www.spinrdf.org/
>>>
>>> Bob
>>>
>>>
>>> On 3/26/2011 1:18 PM, Anuj Kumar wrote:
>>>
>>>  Hello Everyone,
>>>>
>>>> I am trying some basic inferencing with Jena 2 Inference support and
>>>> following the tutorial given here:
>>>> http://jena.sourceforge.net/inference/
>>>>
>>>> There are some basic inferencing regarding the property of a resource
>>>> and
>>>> its sub property in my TDB instance. I have loaded a set of triples into
>>>> TDB
>>>> and I am creating a model from the TDBFactory using the TDB database
>>>> location. The basic inferencing is taking longer time as compared to
>>>> SPARQL
>>>> queries. I have limited RAM of 2GB and just trying to compare the two
>>>> approaches.
>>>>
>>>
> Inferencing does take memory and time but it can be done once and the
> results stored, so query is done without recalculating.
>
>
>
>>>> What exactly is a better approach to do such inferencing? Also if you
>>>> have
>>>> your own custom rules, is it better to go with SPARQL queries or Jena
>>>> Inference mechanism?
>>>>
>>>
> If you just have some RDFS, then riot.infer will, in a streaming fashion,
> expand the data once and for all.  You can feed the output into the bulk
> loader.
>
>        Andy
>

Re: ARQ Vs Jena Inference support for RDF

Posted by Andy Seaborne <an...@epimorphics.com>.

On 27/03/11 16:37, Anuj Kumar wrote:
> Thanks Bob. Will take a look at it.
>
> - Anuj
>
> On Sun, Mar 27, 2011 at 7:14 PM, Bob DuCharme<bo...@snee.com>  wrote:
>
>>> is it better to go with SPARQL queries or Jena Inference mechanism?
>>
>> You might want to look into SPIN, which provides a way to implement rules
>> using SPARQL CONSTRUCT and ASK queries: http://www.spinrdf.org/
>>
>> Bob
>>
>>
>> On 3/26/2011 1:18 PM, Anuj Kumar wrote:
>>
>>> Hello Everyone,
>>>
>>> I am trying some basic inferencing with Jena 2 Inference support and
>>> following the tutorial given here: http://jena.sourceforge.net/inference/
>>>
>>> There are some basic inferencing regarding the property of a resource and
>>> its sub property in my TDB instance. I have loaded a set of triples into
>>> TDB
>>> and I am creating a model from the TDBFactory using the TDB database
>>> location. The basic inferencing is taking longer time as compared to
>>> SPARQL
>>> queries. I have limited RAM of 2GB and just trying to compare the two
>>> approaches.

Inferencing does take memory and time but it can be done once and the 
results stored, so query is done without recalculating.

>>>
>>> What exactly is a better approach to do such inferencing? Also if you have
>>> your own custom rules, is it better to go with SPARQL queries or Jena
>>> Inference mechanism?

If you just have some RDFS, then riot.infer will, in a streaming 
fashion, expand the data once and for all.  You can feed the output into 
the bulk loader.

	Andy

Re: ARQ Vs Jena Inference support for RDF

Posted by Anuj Kumar <an...@gmail.com>.
Thanks Bob. Will take a look at it.

- Anuj

On Sun, Mar 27, 2011 at 7:14 PM, Bob DuCharme <bo...@snee.com> wrote:

> >is it better to go with SPARQL queries or Jena Inference mechanism?
>
> You might want to look into SPIN, which provides a way to implement rules
> using SPARQL CONSTRUCT and ASK queries: http://www.spinrdf.org/
>
> Bob
>
>
> On 3/26/2011 1:18 PM, Anuj Kumar wrote:
>
>> Hello Everyone,
>>
>> I am trying some basic inferencing with Jena 2 Inference support and
>> following the tutorial given here: http://jena.sourceforge.net/inference/
>>
>> There are some basic inferencing regarding the property of a resource and
>> its sub property in my TDB instance. I have loaded a set of triples into
>> TDB
>> and I am creating a model from the TDBFactory using the TDB database
>> location. The basic inferencing is taking longer time as compared to
>> SPARQL
>> queries. I have limited RAM of 2GB and just trying to compare the two
>> approaches.
>>
>> What exactly is a better approach to do such inferencing? Also if you have
>> your own custom rules, is it better to go with SPARQL queries or Jena
>> Inference mechanism?
>>
>> Any thoughts/suggestion will be of great help.
>>
>> Also, if this is the right place; there is a small typo in 3rd line of
>> http://jena.sourceforge.net/inference/#RDFSintro ->  or manually via *
>> ReasonerRegistery*.getRDFSReasoner() should be *ResonerRegistry*. Same
>> change is required in first line of
>> http://jena.sourceforge.net/inference/#OWLconfiguration
>>
>> Thanks,
>> Anuj
>>
>>

Re: ARQ Vs Jena Inference support for RDF

Posted by Bob DuCharme <bo...@snee.com>.
 >is it better to go with SPARQL queries or Jena Inference mechanism?

You might want to look into SPIN, which provides a way to implement 
rules using SPARQL CONSTRUCT and ASK queries: http://www.spinrdf.org/

Bob

On 3/26/2011 1:18 PM, Anuj Kumar wrote:
> Hello Everyone,
>
> I am trying some basic inferencing with Jena 2 Inference support and
> following the tutorial given here: http://jena.sourceforge.net/inference/
>
> There are some basic inferencing regarding the property of a resource and
> its sub property in my TDB instance. I have loaded a set of triples into TDB
> and I am creating a model from the TDBFactory using the TDB database
> location. The basic inferencing is taking longer time as compared to SPARQL
> queries. I have limited RAM of 2GB and just trying to compare the two
> approaches.
>
> What exactly is a better approach to do such inferencing? Also if you have
> your own custom rules, is it better to go with SPARQL queries or Jena
> Inference mechanism?
>
> Any thoughts/suggestion will be of great help.
>
> Also, if this is the right place; there is a small typo in 3rd line of
> http://jena.sourceforge.net/inference/#RDFSintro ->  or manually via *
> ReasonerRegistery*.getRDFSReasoner() should be *ResonerRegistry*. Same
> change is required in first line of
> http://jena.sourceforge.net/inference/#OWLconfiguration
>
> Thanks,
> Anuj
>