I'm trying to implement a SPIN rule that will find the last event in a
set of events:
CONSTRUCT {
?this events:hasLastEvent ?lastEvent .
}
WHERE {
SELECT ?lastEvent
WHERE {
?lastEvent a events:InteractionEvent .
?lastEvent events:generatedBy ?this .
?lastEvent events:inXSDDateTime ?last .
}
ORDER BY DESC (?last)
LIMIT 1
}
It seems that the SELECT sub-query is evaluated once for ?this, and
then used for all other instances of ?this, that results in for
example
events:lamp1 events:hasLastEvent events:event1234
events:lamp2 events:hasLastEvent events:event1234
while events:event1234 is not even related to events:lamp2. The reason
why I think this is caused by the ?this keyword in the sub-query, is
that executing this query in SPARQL View provides the correct result.
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en