simple search api (was Re: mimetype standardisation by testsets)

Jamie McCracken jamiemcc at blueyonder.co.uk
Mon Dec 18 01:33:08 EET 2006


Mikkel Kamstrup Erlandsen wrote:
> 2006/12/17, John Tapsell <johnflux at gmail.com <mailto:johnflux at gmail.com>>:
> 
>     At the risk of stating the obvious, but why not just use SQL?
> 
>     select files.filename from files,tags tag1, tags tag2 where files.id
>     <http://files.id> =
>     tag1.fileid and files.id <http://files.id> = tag2.fileid  and
>     tag1.key="artist" and
>     tag1.value="foobar" and tag2.key="group" and tag2.value="audio"
> 
> 
>     It seems that all the API is reinventing SQL.
>     Why not just use SQL in the first place? 
> 
> 
> I take it you are talking about the query language..?
> 
> I'm not really an expert on SQL so stop me if I'm rambling.
> 
> Is it possible to do proximity searches ("foo" appears within 6 words of 
> "bar"), fuzzy searches (search for words that looks like "foobar"), 
> weighted words.
> 
> Also a design goal is to have the language easily extensible, and I 
> don't really connect that with SQL (without ending up with something 
> that isn't SQL anyway).

The standardised RDF query language, SPARQL, is very close to SQL but is 
probably not easy to use for those not familiar with sql.

We use the XML based variant of RDF Query in tracker because its 
"obvious" what a query does and is much easier to learn if you are not 
an SQL programmer.

I would suggest using this as a base as firstly its a standard already 
and of course xml can easily be parsed in just about any language. It is 
extensible by nature so additional features can be added as the need arises.

A more compact form would be needed thats more suitable for input in an 
editbox widget though



-- 
Mr Jamie McCracken
http://jamiemcc.livejournal.com/




More information about the xdg mailing list