Not getting back complete binding set from ICV violation (Stardog 4.2.1)

0 views
Skip to first unread message

Andrea Westerinen

unread,
Dec 15, 2016, 7:55:44 PM12/15/16
to Stardog
I have constraints defined with the following SPARQL format ...

SELECT ?entityUri
       ('Human-readable text explaining the violation, and it could be lengthy.' as ?violation)
       ('SomeShortLabel' as ?constraintId)
       ('true' as ?applicableToKindOfThing1)
       ('false' as ?applicableToKindOfThing2)
       ('true' as ?applicableToKindOfThing3)
             
WHERE {
        stuff to check regarding the ?entityUri
}

For some test data, I do (correctly) get back one binding set with 2 violations in it. BUT ... the violations ONLY have bindings for entityUri and the 3 applicableToKindOfThing variables. "constraintId" and "violation" are not included in the results. This used to work on Stardog 3.1.4. In my code, I get the error, "Error reading value for select variable: constraintId".

If I change my constraint to:

SELECT ?entityUri
       ?violation
       ?constraintId
       ('true' as ?applicableToKindOfThing1)
       ('false' as ?applicableToKindOfThing2)
       ('true' as ?applicableToKindOfThing3)
             
WHERE {
        bind('Human-readable text explaining the violation, and it could be lengthy.' as ?violation) .
        bind(''SomeShortLabel' as ?constraintId) .
        stuff to check regarding the ?entityUri
}

Then, everything works. 

This is quite odd, because I would expect ?applicableToKindOfThing to fail as violation and constraintId fail.  But, those bindings work fine.

The code fails in a method that is passed the entity that we care about (constraintEntityUri) and an enum value regarding what kind of thing we are worrying about (checkType).  The latter might be used to have different constraints for production, test or deprecated systems (for example).  The constraints are static and are pre-loaded into the db.

We are using the Spring infrastructure.

Andrea
Reply all
Reply to author
Forward
0 new messages