You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by max <ma...@googlemail.com> on 2015/12/02 15:03:12 UTC

Reasoning in RDF

Hello dear all,

in a query I want to make the same query multiple times. I want to do
this because inside the data we have places (each is a RDF-Object) that
are linked together in a hierarchical way.  So place 1 is located is
inside place 2, place2 is inside place 3 and so on. I want to query all
places till one place has a specific name.

I thought I can do this by using reasoning in sparql.  But fuseki
version 2.0.0 seems to doesn't support it?

As a detail: I use fuseki 2.0.0 on an Ubuntu 12.04 server.


Hope someoneof you can help me.

kind regards,

Max
//

Re: Jena + Pellet Reasoner

Posted by Nicolas Paris <ni...@gmail.com>.
Hi,

I recently succeeded in making it working
Take a look at
https://groups.google.com/forum/#!topic/pellet-users/VpKDI0gFmjo

Hope this helps

2015-12-02 22:10 GMT+01:00 Chris Snyder <cs...@mind-tap.net>:

> I’m trying out some different reasoners in my test application. I wanted
> to try Pellet so I updated my Maven to grab:
> <dependency>
>                         <groupId>com.github.ansell.pellet</groupId>
>                         <artifactId>pellet-jena</artifactId>
>                         <version>2.3.6-ansell</version>
> </dependency>
>
> When I try to access the reasoner factory it is apparent from the error
> that the Pellet jar is using its own Jena version.
> java.lang.ClassCastException:
> org.mindswap.pellet.jena.PelletReasonerFactory cannot be cast to
> org.apache.jena.reasoner.ReasonerFactory
>
> And upon further inspection I see:
> package org.mindswap.pellet.jena;
>
> import com.hp.hpl.jena.ontology.OntModelSpec;
> import com.hp.hpl.jena.rdf.model.Model;
> import com.hp.hpl.jena.rdf.model.ModelFactory;
> import com.hp.hpl.jena.rdf.model.Resource;
> import com.hp.hpl.jena.reasoner.Reasoner;
> import com.hp.hpl.jena.reasoner.ReasonerFactory;
> import com.hp.hpl.jena.reasoner.ReasonerRegistry;
> import com.hp.hpl.jena.vocabulary.RDFS;
> import com.hp.hpl.jena.vocabulary.ReasonerVocabulary;
>
> /**
>  * @author Evren Sirin
>  *
>  */
> public class PelletReasonerFactory implements ReasonerFactory {
>
> and I can understand why there is a class cast error. Is there a version
> of the Pellet reasoner that I can plug in to an application already using
> the org.apache.jena.* ?
>
> Thanks,
> Chris
>
>

Jena + Pellet Reasoner

Posted by Chris Snyder <cs...@mind-tap.net>.
I’m trying out some different reasoners in my test application. I wanted to try Pellet so I updated my Maven to grab:
<dependency>
			<groupId>com.github.ansell.pellet</groupId>
			<artifactId>pellet-jena</artifactId>
			<version>2.3.6-ansell</version>
</dependency>

When I try to access the reasoner factory it is apparent from the error that the Pellet jar is using its own Jena version. 
java.lang.ClassCastException: org.mindswap.pellet.jena.PelletReasonerFactory cannot be cast to org.apache.jena.reasoner.ReasonerFactory

And upon further inspection I see:
package org.mindswap.pellet.jena;

import com.hp.hpl.jena.ontology.OntModelSpec;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.reasoner.Reasoner;
import com.hp.hpl.jena.reasoner.ReasonerFactory;
import com.hp.hpl.jena.reasoner.ReasonerRegistry;
import com.hp.hpl.jena.vocabulary.RDFS;
import com.hp.hpl.jena.vocabulary.ReasonerVocabulary;

/**
 * @author Evren Sirin
 *
 */
public class PelletReasonerFactory implements ReasonerFactory {

and I can understand why there is a class cast error. Is there a version of the Pellet reasoner that I can plug in to an application already using the org.apache.jena.* ?

Thanks,
Chris


Re: Reasoning in RDF

Posted by buehmann <bu...@informatik.uni-leipzig.de>.
Using inference with Fuseki should be possible, but indeed you have to 
enable it by using something like this:

|<#service1> rdf:type fuseki:Service ; fuseki:name "inf" ; # 
http://host/inf fuseki:serviceQuery "sparql" ; # SPARQL query service 
#fuseki:serviceUpdate "update" ; fuseki:serviceReadWriteGraphStore 
"data" ; # A separate read-only graph store endpoint: 
fuseki:serviceReadGraphStore "get" ; fuseki:dataset <#dataset> ; . 
<#dataset> rdf:type ja:RDFDataset ; ja:defaultGraph <#model_inf> ; . 
<#model_inf> a ja:InfModel ; ja:baseModel <#tdbGraph> ; ja:reasoner [ 
ja:reasonerURL <http://jena.hpl.hp.com/2003/OWLFBRuleReasoner> ] .|


Regards,
Lorenz

On 02.12.2015 15:24, A. Soroka wrote:
> Can you say a little more about the specific RDF you are trying to query and how the entities are modeled?
>
> You may be able to use SPARQL property paths [1] to do this. (Property paths can be understood as a simple form of reasoning.)
>
> ---
> A. Soroka
> The University of Virginia Library
>
> [1] http://www.w3.org/TR/sparql11-query/#propertypaths
>
>
>
>> On Dec 2, 2015, at 9:03 AM, max <ma...@googlemail.com> wrote:
>>
>> Hello dear all,
>>
>> in a query I want to make the same query multiple times. I want to do
>> this because inside the data we have places (each is a RDF-Object) that
>> are linked together in a hierarchical way.  So place 1 is located is
>> inside place 2, place2 is inside place 3 and so on. I want to query all
>> places till one place has a specific name.
>>
>> I thought I can do this by using reasoning in sparql.  But fuseki
>> version 2.0.0 seems to doesn't support it?
>>
>> As a detail: I use fuseki 2.0.0 on an Ubuntu 12.04 server.
>>
>>
>> Hope someoneof you can help me.
>>
>> kind regards,
>>
>> Max
>> //
>


Re: Reasoning in RDF

Posted by "A. Soroka" <aj...@virginia.edu>.
Can you say a little more about the specific RDF you are trying to query and how the entities are modeled?

You may be able to use SPARQL property paths [1] to do this. (Property paths can be understood as a simple form of reasoning.)

---
A. Soroka
The University of Virginia Library

[1] http://www.w3.org/TR/sparql11-query/#propertypaths



> On Dec 2, 2015, at 9:03 AM, max <ma...@googlemail.com> wrote:
> 
> Hello dear all,
> 
> in a query I want to make the same query multiple times. I want to do
> this because inside the data we have places (each is a RDF-Object) that
> are linked together in a hierarchical way.  So place 1 is located is
> inside place 2, place2 is inside place 3 and so on. I want to query all
> places till one place has a specific name.
> 
> I thought I can do this by using reasoning in sparql.  But fuseki
> version 2.0.0 seems to doesn't support it?
> 
> As a detail: I use fuseki 2.0.0 on an Ubuntu 12.04 server.
> 
> 
> Hope someoneof you can help me.
> 
> kind regards,
> 
> Max
> //