History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: SES-575
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Arjohn Kampman
Reporter: Enrico Minack
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Sesame

NativeStore potentially uses wrong triple index for statement patterns with specified object

Created: 30/Jun/08 03:15 PM   Updated: 26/Sep/08 11:31 AM
Component/s: Native Sail
Affects Version/s: 2.1.2, 2.1.1, 2.1, 2.0.1, 2.0
Fix Version/s: 2.1.3


 Description   
Given an index other than spoc, the computation of the score for a pattern with object != NativeValue.UNKNOWN_ID and context == NativeValue.UNKNOWN_ID is computed incorrectly.

In TripleStore$TripleIndex.getPatternScore(int s, int p, int o, int c), the case block for object ('o') is missing a break. When the 'o' field of the index specification string is reached, and if object is != NativeValue.UNKNOWN_ID, then the score is incremented and the context block is entered. If context is == NativeValue.UNKNOWN_ID, computation ends here, though a char other than 'c' might be the next one in the array. This is not what you would expect.

Simply add the break.

 All   Comments   Change History      Sort Order:
Comment by Arjohn Kampman [30/Jun/08 04:10 PM]
Updated issue title.

Comment by Arjohn Kampman [30/Jun/08 04:16 PM]
The algorithm fails whenever an object is specified and all the previous fields are matched by the index. This can even affect the score for the 'spoc' index.

Comment by Arjohn Kampman [30/Jun/08 04:17 PM]
Added the missing breaks, also added a default clause to catch invalid field characters.