473,397 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Design of a URL encoded language to specify sets of files on aWebDAV server

Gentlemen,
I'm currently in the process of designing a language which will be used
to specify sets of files on a WebDAV server, encoded in a URL. The aims
of the language are to (in no particular order):
* Be concise, aesthetic and easy to type
* Be as similar as possible to existing query languages
* Allow for (nested) boolean operations
* Be cross-platform (so don't include any characters which can't be
used in filenames on *NIX or Win32)

There is a project Wiki which I will release once I've got it into a
semi-stable state.

This is part of a wider project (in Python, of course) which I'm
developing for my degree but which may have more uses. I'd like to draw
on all the experience here and ask some questions so that I can better
shape the implementation to suit the people who may choose to use it.

I would very much appreciate it if anyone could spare the time to have a
look through the specification and documentation below and let me know
about the following:

* Whether you think the language is up to the job (and if not, why not)
* Any additions which you think should be made that will increase
functionality and/or decrease ambiguity
* Any common pitfalls which you think I might fall into
* Any bugs in my specification

There will be a more verbose query language (probably SQLXML) also
implemented in the project but one key feature is that users should be
able to search by simply typing something into the 'Goto' box...

Well, that's about all. Please see the specification below and I hope to
be hearing your feedback in the near future.

Regards,
Andrew

MetaFS Path Query Language
==========================

Background
One way of specifying search criteria in MetaFS is by using a dynamic
URL, making it trivial to work with MetaFS from the command line. This
document explains the characteristics and formatting of these queries
and offers some examples to be expanded upon.
Diving In
The query language used by MetaFS is closely related to XPath/LaTeX,
with a few restrictions around reserved characters in filenames. The
basic format of a query is:

{BASE}/fs/catA/catB/catC[criteria]

An example of a simple query based on this format would be:

{BASE}/fs/photos/america/beach[type=jpeg,author='Andrew James']

This query is equivalent to searching for files which are in the
photos,america and beach categories (the intersection), have a jpeg mime
type and whose author is Andrew James.

This type of query should be enough to perform most sorts of simple
searches, but MetaFS also includes some advanced features that can be
accessed with more complicated queries.
Advanced Features
Boolean Logic Engine
MetaFS includes a complete boolean logic engine which allows for both
grouping of terms and the boolean operators and, or and not.

Reserved Operator Characters

/
Boolean AND (categories only)
^
Boolean OR (categories only)
~
Boolean NOT (categories only)
()
Term Grouping (categories only)
-
Less than (criteria only)
+
More than (criteria only)
=
Logical EQUALS (criteria only)
!
Logical NOT (criteria only)
~
Logical CONTAINS (criteria only)
,
Boolean AND (criteria only)

This allows us to create much more complex queries, such as

{BASE}/fs/photos/~(america^france)

or even

{BASE}/fs/music/mp3[artist~'Jackson',artist!~'Micheal']
Operator Order of Precedence
The operator order of precedence for filesystem queries is as follows:

Categories
(), ~, ^, /
Criteria
',', !, (=, -, +, ~)
Namespaces
Metadata criteria can not only include the default metadata attributes
which MetaFS assigns to files but also namespaces. These are simply
defined by prefixing the name with a namespace and colon, as in XML. For
example, one could specify criteria like:

[owner=drew,moddate>10/10/2004,ns:bitrate='128']
== Query Language Grammar ==
Below is the initial (and buggy, no doubt) specification for the MetaFS
query language in the TPG form of BNF.
Language Specification
# Tokens
separator space '\s+';
token Num '\d+(.\d+)?';
token Ident '[a-zA-Z]\w*';
token CharList '\'.*\'';
token CatUnOp '~';
token CatOp '[/\^]';
token MetaOp '[=\+\-!]';
token Date '\d\d-\d\d-\d\d\d\d';
token FileID '(\w+\.\w+)';
token EmptyLine '^$';

# Rules
START -> CatExpr ('\[' MetaExpr '\]')?
| FileID
| EmptyLine
;
CatExpr -> CatUnOp CatName
| CatName (CatOp CatExpr)*
;
CatName -> Ident
| '\(' CatExpr '\)'
;
MetaExpr -> MetaCrit (',' MetaCrit)*
;
MetaCrit -> Ident MetaOp Value
;
Value -> CharList | Num | Date
;

Test Queries
The following test queries have been run through the parser to check
whether they are parsed correctly. The version of the language grammar
above does this without errors. As you can see, the grammar allows for
term nesting, unary operators and arbitrarily complex boolean
expressions. In addition to this, file metadata querying is available
for extra filtering.

parseTests = (
"simple",
"this/is/a/simple/test",
"a/test/with/metadata[author='drew',date=10]",
"music/mp3/~jackson/michael",
"docs/latex/~(computer^science)",
"media/video/((comedy/action)^thriller)"
)
--
Andrew James <dr**@gremlinhosting.com>

Jul 18 '05 #1
1 1507
Andrew James <dr**@gremlinhosting.com> writes on Thu, 18 Nov 2004 23:10:14 +0000:
...
{BASE}/fs/photos/america/beach[type=jpeg,author='Andrew James']

This query is equivalent to searching for files which are in the
photos,america and beach categories (the intersection), have a jpeg mime
type and whose author is Andrew James.
Why are you using path syntax when in fact you mean intersection?

Note that genuine "path"s, too, have an idependent meaning in a WebDAV
repository.
...
Reserved Operator Characters

/
Boolean AND (categories only)
^
Boolean OR (categories only)
There are more familiar symbols for "and" and "or"...
...
-
Less than (criteria only)
+
More than (criteria only)
"+" and "-" usually mean something different.
=
Logical EQUALS (criteria only)
What does that mean?

You want a more general "EQUALS" relation (not only on boolean values).
~
Logical CONTAINS (criteria only)
What does that mean?
,
Boolean AND (criteria only)
Why are your "and" operators for categories and criteria different?
This allows us to create much more complex queries, such as

{BASE}/fs/photos/~(america^france)


Above, I had the impression that criteria were enclosed in "[...]".
Seems not to be the case.
I stop here: I would not like your query language:

It uses unfamiliar symbols for well known operators (rather
than the standard ones).

It uses different symbols for the same operator in different
contexts.

It appears to be defined via examples (and not formally).
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Al Davis | last post by:
Note: I tried cross-posting this message to several newsgoups, including comp.lang.perl.misc, c.l.p.moderated, comp.infosystems.www.authoring.cgi, comp.lang.javascript and comp.lang.php. Nothing...
43
by: grz02 | last post by:
Hi, Im an experienced database+software designer and developer, but, unfortunately, anything to do with web-programming and web-systems designs is still a pretty new area to me... (been working...
36
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
36
by: toedipper | last post by:
Hello, I am designing a table of vehicle types, nothing special, just a list of unique vehicle types such as truck, lorry, bike, motor bike, plane, tractor etc etc For the table design I am...
3
by: Fredrik Kronander | last post by:
Hi, I have an application that let's the user enter text into a textbox and this data is collected on the server and stored in a database. The page is multilingual and sets Response.Charset to...
0
by: Nigel Greenwood | last post by:
I recently discovered that the web server I use has started to specify Latin-1 as the default charset, with the result that my Greek, Russian, Persian, etc pages failed to display properly. I had...
5
by: Mike Murray | last post by:
Hi I have the following issue. I have a character that is return by a SQL Server database "É" to be precise, the issue is that when I store character in a .net string variable my understanding...
5
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each...
3
by: nflacco | last post by:
Is there a convient way to do a supertype/subtype heirarchy in mysql and do queries on the supertype to return sets of subtypes? For example, suppose I have a table with several types of military...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.