peterjohnlawrence / com.inova8.odata2sparql.v4

Part of the overall odata2sparql solution, this odata2sparql.v4 module containing the olingo4 dependencies. In other words specifically for odata v4
http://inova8.com/bg_inova8.com/offerings/odata2sparql/
Apache License 2.0
5 stars 5 forks source link

SPARQL query performance poor when COUNTS included #174

Closed peterjohnlawrence closed 4 years ago

peterjohnlawrence commented 4 years ago

Currently:

    #expandItemWhereCount
    UNION{ SELECT ?Order_s (COUNT(DISTINCT ?OrderhasOrderDetail_s) as ?OrderhasOrderDetail_count)

This seems to perfom much better:

    #expandItemWhereCount
    { SELECT ?Order_s (COUNT(DISTINCT ?OrderhasOrderDetail_s) as ?OrderhasOrderDetail_count)

    The UNION is not necessary as it is grouped with a select of properties of that which is being counted