Export with reasoning is incomplete

0 views
Skip to first unread message

Håvard Ottestad

unread,
Jan 6, 2017, 5:27:04 AM1/6/17
to Stardog
Hi,

I want to use Stardog to forward-chain my ontology. I've added the ontology to stardog, in a graph, and set the graphname in the schema config.

I have tried various ways of extracting the data, I tried the .export() method. But this didn't work with reasoning. Then I tried the .get() method, this seemed to work, but there is missing data. So I tried it through a repository with .statements(null, null, null, true), and then with a construct query. Same story, incomplete data. 

The construct query I'm using:

construct{?a ?b ?c} where {graph arkiv:ontologyGraph{?a ?b ?c}}


With reasoning disabled, I get my ontology back. But when I enable reasoning, all the rdfs:subClassOf statements are missing. There might be more missing data, that I haven't discovered yet.

I know this kind of query is slow, but my ontology is small and I cache the result so it should only run when the system starts.

I checked that there are rdfs:subClassOf statements in the ontology with the following query:

construct{?a rdfs:subClassOf ?c} where {graph arkiv:ontologyGraph{?a rdfs:subClassOf ?c.}}

There are 13 statements in the ontology, which expands to 174 with reasoning enabled.

I'm on Stardog 4.2.1, and I've also tested 4.2.2 embedded.

Cheers,
Håvard M. Ottestad

Zachary Whitley

unread,
Jan 6, 2017, 7:14:12 AM1/6/17
to sta...@clarkparsia.com
I don't believe the export command supports reasoning so that's expected. Using a construct query should do what you're looking for.  Are you getting no inferences or are you seeing some but not all? What value do you have the reasoning.schema.graphs option set to? Is there anything notable in Stardog.log? You might want to double check to make sure there isn't a typo in the rdfs prefix. I believe there can be issues with reasoning and unconstrained queries like the one you posted. If that's the case there should be something in the logs. You can search the forum history for previous discussion on that subject. 
--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.

Håvard Ottestad

unread,
Jan 6, 2017, 7:31:44 AM1/6/17
to Stardog
Export command not supporting reasoning is ok, would be nice if there was a warning or something though. 

I'm getting some inferences with the construct query, but not all, and also there is some original data missing. I've set the reasoning level to SL. The logs were showing messages when running the query from the web interface, something about a subquery still running, but that was because of the limit 50 that the web gui adds. Other than that there was nothing in the logs :(

Zachary Whitley

unread,
Jan 6, 2017, 9:31:49 AM1/6/17
to Stardog
Here's  a link to the previous discussion on the issue. If the link doesn't work you can just search the forum for the thread titled "Export all data inferred".



On Fri, Jan 6, 2017 at 7:31 AM, Håvard Ottestad <hmott...@gmail.com> wrote:
Export command not supporting reasoning is ok, would be nice if there was a warning or something though. 

I'm getting some inferences with the construct query, but not all, and also there is some original data missing. I've set the reasoning level to SL. The logs were showing messages when running the query from the web interface, something about a subquery still running, but that was because of the limit 50 that the web gui adds. Other than that there was nothing in the logs :(

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+unsubscribe@clarkparsia.com.

Zachary Whitley

unread,
Jan 6, 2017, 9:45:31 AM1/6/17
to Stardog
After looking over the previous conversation it looks like the query should be supported but may not be efficient so I guess this might possibly be a bug.


Evren Sirin

unread,
Jan 6, 2017, 10:57:54 AM1/6/17
to Stardog
Stardog follows the SPARQL direct semantics entailment regime [1]
where triple patterns of the form `?s ?p ?o` are not allowed without
additional typing information [2]. Stardog reasoning queries [3] relax
this restriction a little and allows triple patterns like `?s ?p ?o`
and `?s rdf:type ?o` but execute such patterns only over instance
data. So it is expected that such a query will not return any schema
assertions or inferences right now. We might change this behavior in
the future but right now you'll need to execute separate queries to
retrieve schema inferences.

Best,
Evren

[1] https://www.w3.org/TR/2013/REC-sparql11-entailment-20130321/#OWLDSEnRegime
[2] https://www.w3.org/TR/2013/REC-sparql11-entailment-20130321/#VarTyping
[3] http://docs.stardog.com/#_queries

On Fri, Jan 6, 2017 at 9:45 AM, Zachary Whitley
>>> stardog+u...@clarkparsia.com
>>> For more options, visit this group at
>>> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google Groups
>>> "Stardog" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to stardog+u...@clarkparsia.com.
>>
>>
>
> --
> -- --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com

Zachary Whitley

unread,
Jan 6, 2017, 1:16:22 PM1/6/17
to Stardog
Went to add it to the docs and submit a PR but looks like it was already there [1]. Sorry to make you repeat it but it's confirmation that the docs are comprehensive. One thing to note though, shouldn't he have seen a warning in the logs about the ambiguity?


[1] http://docs.stardog.com/#_not_seeing_expected_results


>>> For more options, visit this group at
>>> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google Groups
>>> "Stardog" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an

>>
>>
>
> --
> -- --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to

> For more options, visit this group at
> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+unsubscribe@clarkparsia.com.


Håvard Ottestad

unread,
Jan 9, 2017, 3:14:37 PM1/9/17
to Stardog
I've found what I think might be an actual bug now.

Limit doesn't work as expected on queries with reasoning and ?s ?p ?o parts. I set a limit of 100 in the web ui, and got back 20 or so on a query, changed the limit to 200 and I got back 35 instead.

I've noticed this other places too. I had some queries with nested optionals, causing stardog to do a join a lot of data. Adding a limit, say 10000 to that query made it run much faster, but it would be incomplete; returning 35 instead of 38 for instance.

Is this a know bug or should I try to make a reproducible test case?

Evren Sirin

unread,
Jan 10, 2017, 10:40:27 PM1/10/17
to Stardog
That FAQ entry is out-dated and not very accurate anymore. We do not
require the explicit type triples anymore and do not print warnings
but simply assume you are asking for instance data when the query is
?s ?p ?o or ?s rdf:type ?o. Extra type triples can still be used in
the latter case to retrieve types of properties as shown in that
example.

Best,
Evren
>> >>> stardog+u...@clarkparsia.com
>> >>> For more options, visit this group at
>> >>> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
>> >>> ---
>> >>> You received this message because you are subscribed to the Google
>> >>> Groups
>> >>> "Stardog" group.
>> >>> To unsubscribe from this group and stop receiving emails from it, send
>> >>> an
>> >>> email to stardog+u...@clarkparsia.com.
>> >>
>> >>
>> >
>> > --
>> > -- --
>> > You received this message because you are subscribed to the C&P
>> > "Stardog"
>> > group.
>> > To post to this group, send email to sta...@clarkparsia.com
>> > To unsubscribe from this group, send email to
>> > stardog+u...@clarkparsia.com
>> > For more options, visit this group at
>> > http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
>>
>> --
>> -- --
>> You received this message because you are subscribed to the C&P "Stardog"
>> group.
>> To post to this group, send email to sta...@clarkparsia.com
>> To unsubscribe from this group, send email to
>> stardog+u...@clarkparsia.com
>> For more options, visit this group at
>> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Stardog" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to stardog+u...@clarkparsia.com.
>>
>
> --
> -- --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com

Evren Sirin

unread,
Jan 10, 2017, 10:54:35 PM1/10/17
to Stardog
We are not aware of this bug. Reproducible test case would be great.

Best,
Evren
> --
> -- --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com
Reply all
Reply to author
Forward
0 new messages