DISTINCT and ORDER BY bug

15 views
Skip to first unread message

Yves Raimond

unread,
Aug 29, 2012, 12:53:29 PM8/29/12
to 4store-...@googlegroups.com
Hello!

We just noticed the following weird behavior, when combining DISTINCT with ORDER BY.

Load the following Turtle document in 4store:

  @prefix : <http://example.com/> .
  :thing1 :property1 [ :weight 0.7 ; :property2 :thing2 ] .
  :thing1 :property1 [ :weight 0.8 ; :property2 :thing2 ] .
  :thing2 :property3 :thing3 .
  :thing2 :property3 :thing4 .

Execute the following SPARQL query:

select distinct ?d where {?b <http://example.com/weight> ?weight . ?b <http://example.com/property2> ?c . ?c <http://example.com/property3> ?d} order by desc(?weight)

Expected results (one row per distinct bindings for ?d, and the order is actually undefined, as both bindings have the same ordering):
- http://example.com/thing4
- http://example.com/thing3

Actual results:
- http://example.com/thing4
- http://example.com/thing3
- http://example.com/thing4
- http://example.com/thing3

Cheers,
Yves

Steve Harris

unread,
Aug 31, 2012, 6:48:30 AM8/31/12
to 4store-...@googlegroups.com
Interesting - thanks for the bug report Yves, I've recreated it with Git HEAD and I'll create a ticket for it.

- Steve

--
You received this message because you are subscribed to the Google Groups "4store-support" group.
To view this discussion on the web visit https://groups.google.com/d/msg/4store-support/-/5_e-DvMfGcEJ.
To post to this group, send email to 4store-...@googlegroups.com.
To unsubscribe from this group, send email to 4store-suppor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/4store-support?hl=en.

-- 
Steve Harris, CTO
Garlik, a part of Experian
Registered in England and Wales 653331 VAT # 887 1335 93
Registered office: Landmark House, Experian Way, Nottingham, Notts, NG80 1ZZ

Reply all
Reply to author
Forward
0 new messages