directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: [ApacheDS] Range queries for version numbers (major.minor.micro)
Date Tue, 04 Mar 2014 14:16:33 GMT
Le 3/4/14 1:51 PM, Marcel Bruch a écrit :
> Hi directory-users,
>
> another question regarding the use of Apache DS as knowledge base data store. 
>
> One of our needs is to allow range queries over (Maven or OSGI like) software versions.
We might have entities with DNs like these:
>
> groupId=commons, artifactId=lang, version=2.0.1
> groupId=commons, artifactId=lang, version=2.1.1
> groupId=commons, artifactId=lang, version=2.2.2
> groupId=commons, artifactId=lang, version=3.0.0
>
> Queries we want to answer are:
>
> Give me the entry with the minimum version in the range [2.0.5,3.0.0) which should return
2.1.1.

In LDAP, this is not possible. You can only select the entries within an
interval using a filter like :

(& (version>=2.0.5) (version<=2.0.0))

but you will get 2.1.1, 2.2.2 and 3.0.0 as a result of such a request,
and you will have to select your version.

> Same with a maximum range: When querying for max of [2.0.5,*)  it should return 3.0.0.
Same answer, the filter is just simpler :

(version >= 2.0.5)
>
> Can the support for such queries be built-in into Apache DS or would have to implement
this in our application logic?
Right now, it has to be implemented in your application logic.

However, and this is a funny coincidence, we were discussing this
morning with a fellow developper who want to implements such lookup
using FCAs and I suggested to extend the filters to add something like :

(best A B C)

It would be interesting to have a filter like :

(min (& (version>=2.0.5) (version<=2.0.0)) )

which select the minimum value our of the selected ones...

Clearly a extension to LDAP.


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Mime
View raw message