As far as I know it is not possible to use sparql inference("?link") with 4store.

But somebody told me that it is possible to modify queries slightly if it is not possible to integrate inference.

How is it possible to avoid using inference by modifying the queries?

asked 23 Jun '12, 09:12

BenBach's gravatar image

accept rate: 0%

Have you tried 4sreasoner which is a branch of 4store that supports limited RDFS reasoning?

permanent link

answered 23 Jun '12, 15:36

Rob%20Vesse's gravatar image

Rob Vesse ♦
accept rate: 29%

Indeed, most consequences of simple (RDFS) inference you can also get by doing an expanded query. For example, to get all instances of a class, in store that supports (RDFS) inferencing, you would do this:

SELECT ?inst WHERE { ?inst a ex:SomeClass }

However, if your store does not support inferencing, the above query will only give you all the instances that are directly an instance of ex:SomeClass, not any of the instances that belong to a subclass of it.

But you can get the same result by expanding your query and using a property path:

SELECT ?inst WHERE { ?inst a ?c . ?c rdfs:subClassOf* ex:SomeClass }

This will return all inherited instances as well. So this is an example of an expanded query replacing inference.

However, there are several things that may not be as easy or straightforward to query (though within RDFS inference, I don't think there is anything that really can't be replaced by a query at all). Of course, the more complex your starting query becomes, the more inconvenient it becomes to expand it manually to include 'inferred' results.

permanent link

answered 24 Jun '12, 08:11

Jeen%20Broekstra's gravatar image

Jeen Broekstra ♦
accept rate: 37%


4store doesn't support SPARQL 1.1, so your property path example won't work.

(24 Jun '12, 11:21) Gerrit V Gerrit%20V's gravatar image

@Gerrit V, hmmm... I remember reading that 4store supports SPARQL 1.1 at least partially. But I couldn't find anything that tells me what is and is not supported (my google-fu is weak today it seems).

(24 Jun '12, 18:54) Jeen Broekstra ♦ Jeen%20Broekstra's gravatar image

(non-4store answer)

What sort of inference are you looking for?

Jeen shows subclass

?inst rdf:type/rdfs:subClassOf* ex:SomeClass

and there is

?inst ?p ?x .
?p rdfs:subPropertyOf* :property .

also domain:

?x ?p ?v .
?p rdfs:domain :C
?x rdf:type/rdfs:subClass* :C .

and range:

?v ?p ?x .
?p rdfs:range :C
?x rdf:type/rdfs:subClass* :C .

You can expand the data during loading and then query rewrite isn't needed - at the expense of database size and assumign you are also controlling the data.

permanent link

answered 25 Jun '12, 17:12

AndyS's gravatar image

AndyS ♦
accept rate: 33%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 23 Jun '12, 09:12

question was seen: 2,066 times

last updated: 25 Jun '12, 17:12