Difference between revisions of "Features/Plain Query Format"
Line 95: | Line 95: | ||
! Datastore field | ! Datastore field | ||
! Flags/Parameters | ! Flags/Parameters | ||
+ | ! Dublin Core | ||
! Notes | ! Notes | ||
+ | |- | ||
+ | | ''contributor'' | ||
+ | | | ||
+ | | [http://dublincore.org/documents/dces/#contributor contributor] | ||
+ | |- | ||
+ | | ''coverage'' | ||
+ | | | ||
+ | | [http://dublincore.org/documents/dces/#coverage coverage] | ||
|- | |- | ||
| ''creator'' | | ''creator'' | ||
− | | | + | | |
+ | | [http://dublincore.org/documents/dces/#creator creator] | ||
+ | |- | ||
+ | | ''date'' | ||
+ | | | ||
+ | | [http://dublincore.org/documents/dces/#date date] | ||
+ | |- | ||
+ | | ''language'' | ||
+ | | | ||
+ | | [http://dublincore.org/documents/dces/#language language] | ||
+ | |- | ||
+ | | ''publisher'' | ||
+ | | | ||
+ | | [http://dublincore.org/documents/dces/#publisher publisher] | ||
+ | |- | ||
+ | | ''relation'' | ||
+ | | | ||
+ | | [http://dublincore.org/documents/dces/#relation relation] | ||
+ | |- | ||
+ | | ''rights'' | ||
+ | | | ||
+ | | [http://dublincore.org/documents/dces/#rights rights] | ||
|- | |- | ||
− | | '' | + | | ''source'' |
− | | | + | | |
+ | | [http://dublincore.org/documents/dces/#source source] | ||
|- | |- | ||
− | | '' | + | | ''subject'' |
− | | | + | | |
− | | | + | | [http://dublincore.org/documents/dces/#subject subject] |
|- | |- | ||
− | | '' | + | | ''type'' |
− | | | + | | |
+ | | [http://dublincore.org/documents/dces/#type type] | ||
|- | |- | ||
− | | '' | + | | ''album'' |
| sorted | | sorted | ||
|- | |- | ||
| ''track_number'' | | ''track_number'' | ||
− | |||
− | |||
− | |||
| ranged sorted | | ranged sorted | ||
|- | |- | ||
| ''disc_number'' | | ''disc_number'' | ||
| ranged sorted | | ranged sorted | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|} | |} |
Revision as of 08:06, 24 July 2009
Summary
Provide simple string query format for Datastore find() method to cover all kinds of requests.
Owner
- Name: ?
- Email: ?
Current status
- Targeted release: ?
- Last updated: Fri Jul 17 06:34:13 UTC 2009
- Percentage of completion: stopped, highly depends on Version support for datastore/Proposal
Detailed Description
Instead of having dictionary query argument in org.laptop.sugar.DataStore::find() method, use plain string of full featured query request i.e. use all system query parameters(like timestamp, mime_type etc.) in query string.
All system, users predefined and some(its up to user) of users query terms
- use prefixes like mime_type:"text/plain", author:Strugatsky etc.
- could be ranged e.g. timestamp:<stamp1>..<stamp2>
- could be sorted
System terms
Sugar fills these terms on its own.
Datastore field | Flags/Parameters | Notes |
---|---|---|
tree_id | ||
version_id | ||
parent_id | ||
ctime | ranged sorted | |
bundle_id | ||
entry_type | ||
creator | ||
mime_type | ||
title | sorted | |
activity_id | ||
timestamp | ranged sorted | |
keep | ||
tags | ||
filesize | ranged sorted | TODO: propose adding this field to DS |
participant | sorted | TODO: propose adding this field to DS |
buddies_count | sorted | (?) |
Users predefined terms
The purpose of having predefined users terms:
- Shell or activities can fill these terms implicitly e.g. by parsing metedata of downloaded files(audio, video etc.)
- in some UI(for example books viewer) having some of these terms in separate columns in list view could make sense
- we can provide sorting and ranging options only for known(by Datasotre) terms
- provide Dublin Core set of metadata fields
Datastore field | Flags/Parameters | Dublin Core | Notes |
---|---|---|---|
contributor | contributor | ||
coverage | coverage | ||
creator | creator | ||
date | date | ||
language | language | ||
publisher | publisher | ||
relation | relation | ||
rights | rights | ||
source | source | ||
subject | subject | ||
type | type | ||
album | sorted | ||
track_number | ranged sorted | ||
disc_number | ranged sorted |
Another ways to differentiate DS objects
All metadata fields will be tracked as usual, so regular search(w/o prefixes) should work. There is only one addition - optional prefixes in tags field.
All substrings(tags) from tags field in format:
- <substring_w/o_separators>:<string_w/o_separators_after_:>
- <substring_w/o_separators>:"<string_w/o_separators_after_: but with separators inside string>"
Will be treated as tags with prefix, so user can type in search bar:
- books:favorite if tags has substring books:favorite
- books:brothers if tags has substring books:"The Strugatsky brothers"
Result set control parameters
New find() method still has optional dictionary argument to control final result set.
Dictionary key | Notes |
---|---|
offset | |
limit | |
order_by | |
lang | to setup stemming |
Benefit to Sugar
- simple(plain string in comparing with existed API with dictionary find()'s argument) query format for dbus find() method
- simple and new-feature-proof way to implement find method for example in CLI tools(because this tool needs only to pass plain string to Datastore service)
- let experienced users use system terms in Journal search bar
- existed implementation has hard-coded logic for example in case of having several mime_types in query(all mime_types will be ORed despite what user wants).
Scope
- implementation in Datastore
- provide new dbus method to search
- support existed find() and mark it deprecated
How To Test
Run unit tests.
User Experience
- In Journal search bar users can use system terms e.g. timestamp:<date1>..<date2> AND mime_type="text/plain" AND participant:me'
- use tags with prefixes to differentiate them from regular words e.g. having substring books:favorite in tags field, user can type books:favorite in search bar and differentiate word favorite with prefix books from other books words.
Dependencies
Just regular glucose dependencies.
Contingency Plan
None necessary, revert to previous release behaviour.
Documentation
Release Notes
The Sugar Release Notes inform end-users about what is new in the release. An Example is 0.84/Notes. The release notes also help users know how to deal with platform changes such as ABIs/APIs, configuration or data file formats, or upgrade concerns. If there are any such changes involved in this feature, indicate them here. You can also link to upstream documentation if it satisfies this need. This information forms the basis of the release notes edited by the release team and shipped with the release.