Closed World Rule Reasoning

0 views
Skip to first unread message

Jon Tutcher

unread,
Jun 23, 2014, 2:15:12 PM6/23/14
to
Hi,

In my current application using Stardog, it'd be useful to have a rule that finds the most recent value of something, and returns it at query time, e.g.

If i have:

:Bob :mood [:value :BadMood ; :atTime "2014-06-22T18:00:00+01:00"^^xsd:dateTime] ;
:mood [:value :GoodMood ; :atTime "2014-06-23T18:00:00+01:00"^^xsd:dateTime] ;
.

I'd quite like to be able to have:

SELECT ?mood WHERE {:Bob :currentMood ?mood}

return the most recent value. I realise this is a bodge, and if necessary we can just write a query to return what we want - but it'd be a handy thing to be able to do. I assume also that allowing this could get messy and create lots of recursion - just thought I'd ask if it's possible!

Many thanks,
Jon

Kendall Clark

unread,
Jun 24, 2014, 12:17:04 PM6/24/14
to stardog
Jon,

A few things:


1. I don't think this has anything to do with ICV (although you could have constraints determining that some property have a value for some instances or classes of instances, etc).

2. it's not entirely clear to me what you do want...You'll have time values and you want the query & rule combo to implicitly select the most recent one? So in the example above :currentMood would get "bound" to :GoodMood because it's :atTime is later than the :BadMood value?

Cheers,
Kendall


--
-- --
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

Jonathan Tutcher

unread,
Jun 25, 2014, 7:04:09 AM6/25/14
to sta...@clarkparsia.com
Hi Kendall,

Many thanks for the reply -  I appreciate your time. Your second point is exactly what I want to do - using the example below, ideally I'd like to then be able to say that all people whose most recent mood is :GoodMood are a subclass of :HappyPeople (through an owl axiom maybe), but I think this quickly becomes very difficult / expensive in terms of reasoning if we're not careful?

Again, I know this is not really what RDF is designed for - I'm just asking in case there is something in Stardog that will do it!

Cheers,
Jon

Evren Sirin

unread,
Jun 25, 2014, 9:47:21 AM6/25/14
to Stardog
The issue here is not really the computational complexity of doing
something like this but getting the semantics right. What you are
asking for is a non-monotonic extension, a statement that is being
inferred ceases to be inferred after an addition of a new statement,
and there is no straight-forward mechanism to do this as part of
reasoning.

It is better to handle this at query time as you suggest. Note that
Stardog provides a mechanism to define magic properties so the query
you show would return the expected answers as is with such an
extension. We don't have examples of writing custom property functions
in the documentation right now but we'll be adding those very soon so
you can look into writing your property functions.

Best,
Evren

Jonathan Tutcher

unread,
Jun 25, 2014, 3:17:50 PM6/25/14
to sta...@clarkparsia.com
Hi Evren,

Thanks for your help - magic properties may be the way to go (for now I'll stick with queries on the application side).

The non-monotonic reasoning capability was probably what I was after when I first asked the question. I wondered whether the backward-chaining/query-rewriting nature of the Stardog reasoner may provide more of an ability to do this kind of thing since the query results are not materialized in the store (and thus could possibly be evaluated given the state of the graph at the time the query is fired), but there are probably many repercussions I have no idea about!

Regards,
Jon
Reply all
Reply to author
Forward
0 new messages