Irc-Unix.net

Главная | Actual Topics | Обратная связь | Guest Book | В избранное | Сделать домашней
Категории
 System & Utilities
 Unix News
 OS Emulator
 Developing
 Learning/Education
 Games
 Humour
Каталог статей
Все статьи

Antispam
Статьи
Биллу Гейтсу тоже предлагают избавиться ...
Вымогательство в борьбе со спамом
Календарь

December, 2017
ПнВтСрЧтПтСбВс
123
45678910
11121314151617
18192021222324
25262728293031
Опросы
Какой из этих ОС Вы отдаете большее предпочтение?

QNX
FreeBSD
Linux(any)
Solaris
Mac OS
Windows XP
Windows 2003
Что такое ОС? :)


Результаты
Другие опросы

Всего голосов: 325
Комментарии: 0
Ссылки

Архив Новостей
 December 2017 (4)
 November 2017 (15)
 October 2017 (19)
 September 2017 (18)
 August 2017 (13)
 February 2017 (14)
 January 2017 (19)
 December 2016 (16)
 November 2016 (16)
 October 2016 (21)
 September 2016 (18)
 August 2016 (16)
 July 2016 (16)
 June 2016 (20)
 May 2016 (18)
 April 2016 (15)
 March 2016 (22)
 February 2016 (17)
 January 2016 (15)
 December 2015 (15)
 November 2015 (22)
 October 2015 (20)
 September 2015 (17)
 August 2015 (25)
 July 2015 (20)
 June 2015 (23)
 May 2015 (21)
 April 2015 (17)
 March 2015 (19)
 February 2015 (9)
 January 2015 (23)
 December 2014 (9)
 November 2014 (13)
 October 2014 (12)
 September 2014 (18)
 August 2014 (20)
 July 2014 (10)
 June 2014 (12)
 May 2014 (12)
 April 2014 (10)
 March 2014 (22)
 February 2014 (10)
 January 2014 (8)
 December 2013 (26)
 November 2013 (53)
 October 2013 (40)
 September 2013 (48)
 August 2013 (63)
 July 2013 (56)
 June 2013 (52)
 May 2013 (49)
 April 2013 (67)
 March 2013 (74)
 February 2013 (63)
 January 2013 (62)
 December 2012 (62)
 November 2012 (66)
 October 2012 (68)
 September 2012 (48)
 August 2012 (75)
 July 2012 (60)
 June 2012 (71)
 May 2012 (69)
 April 2012 (85)
 March 2012 (86)
 February 2012 (90)
 January 2012 (81)
 December 2011 (103)
 November 2011 (118)
 October 2011 (74)
 September 2011 (2)
 June 2011 (110)
 May 2011 (118)
 April 2011 (111)
 March 2011 (112)
 February 2011 (101)
 January 2011 (119)
 December 2010 (117)
 November 2010 (118)
 October 2010 (131)
 September 2010 (117)
 August 2010 (226)
 July 2010 (351)
 June 2010 (305)
 May 2010 (319)
 April 2010 (343)
 March 2010 (329)
 February 2010 (311)
 January 2010 (312)
 December 2009 (266)
 November 2009 (156)
 July 2009 (101)
 June 2009 (279)
 May 2009 (365)
 April 2009 (348)
 March 2009 (347)
 February 2009 (323)
 January 2009 (318)
 December 2008 (237)
 November 2008 (155)
 October 2008 (334)
 September 2008 (310)
 August 2008 (343)
 July 2008 (362)
 June 2008 (322)
 May 2008 (591)
 April 2008 (1276)
 March 2008 (1658)
 February 2008 (250)
 January 2008 (6)
 November 2007 (1)
 September 2007 (1)
 June 2007 (1)
 May 2007 (1)
 March 2007 (1)
 January 2007 (2)
 December 2006 (1)
 October 2006 (2)
 September 2006 (1)
 August 2006 (2)

Parsing Nested Queries

System & Utilities

At the beginning of this week, I have added two new features to my Nepomuk query parser.

The first one is logic operators. By default, terms or comparisons that are simply separated by spaces and ANDed. For instance “holidays size > 2M” matches documents containing “holidays” and having a size greater than 2 megabytes. Supported operators are AND, OR and NOT (that can also be written “!”). These operators can be enclosed into braces, to impose a specific grouping. Every operator has the same priority, and they are left-associative: “a AND b OR c” is parsed to “(a AND b) OR c”.

The second new feature is nested queries. Nested queries are used to match documents related to others, or contained in a specific archive, or sent as attachments to an email, etc. The pattern syntax for this is “related to … ,”, where “…” matches a list of terms, and the comma indicates that this list of matched terms ends when a comma or the end of the query is encountered. The parsing pass receives the list of the tokens matched by the “…”, and can build a subquery with them.

The query I used to test this feature is “files related to e-mails sent by Denis, size > 2M”. This query is parsed to this tree of terms:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<and>
<type uri="nfo#FileDataObject"/>
<comparison property="nie#relatedTo"
comparator=":"
inverted="false">
<and>
<type uri="nmo#Email"/>
<comparison property="nmo#messageFrom"
comparator=":"
inverted="false">
<literal datatype="XMLSchema#string">
Denis
</literal>
</comparison>
</and>
</comparison>
<comparison property="nfo#fileSize"
comparator="&gt;"
inverted="false">
<literal datatype="XMLSchema#long">
2097152
</literal>
</comparison>
</and>

You see that everything seems to work. “2M” is converted to an integer, and the subquery starts at line 6 (the and) and ends at line 15 (the end of the and).

The next steps are the following:

  • Parsing tags (using patterns like “tagged as %1”, “(has|have) tag %1” and “# %1”, the hashtag syntax)
  • Getting range information about properties. This will allow the parser to know that “fileSize” needs an integer (and not a string for instance). This feature will be especially useful for the auto-completion box, as it will allow the box to show drop-down lists for known property ranges. For instance, typing “has tag” will list you tags, “sent by” will display your contacts, and “modified on” could even show a calendar!
  • Parsing date-times. I want to see if my parser can handle all the parsing rules of the current KHumanDateTimeParser I have developed some weeks ago.

I hope to have most of that ready by the start of next week. This way, I will be on schedule and I will be able to start thinking about the syntax-highlighting and auto-completion.





  


Разместил: Planet KDE | Дата: 19.06.2013 | Прочитано: 396 | Раздел: System & Utilities   

Рейтинг статьи

Средняя оценка: 0.00/0Средняя оценка: 0Всего голосов:0

Отлично
Хорошо Нормально Пойдёт Плохо


Смотрите также связанные темы

28.02.2008 devel/hs-uulib - 0.9.5
Fast Parser Combinators and Pretty Printing Combinators libraries by the Utrecht University. author: maintainer: Arie Middelkoop <ariem@cs.uu.nl> license: LGPL-2.1 WWW: http://www.cs.uu.nl/wiki/HUT/AttributeGrammarSystem package-url: http://nix.cs.uu.nl/dist/hut/ exposed-modules: UU.Parsing.CharParser UU.Parsing.Derived UU.Parsing.Interface UU.Parsing.MachineInterface UU.Parsing.Merge UU.Parsing.Offside UU.Parsing.Perms UU.Parsing.StateParser UU.Parsing UU.DData.IntBag UU.DData.Map UU.DData.MultiSet UU.DData.Queue UU.DData.Scc UU.DData.Seq UU.DData.Set UU.PPrint UU.Pretty.Ext UU.Pretty...
17.03.2008 dns/p5-Net-DNS - 0.63
Update to version 0.63, which has a couple of bug fixes, including: Fix rt.cpan.org #30316 Security issue with Net::DNS Resolver. Net/DNS/RR/A.pm in Net::DNS 0.60 build 654 allows remote attackers to cause a denial of service (program "croak") via a crafted DNS response (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2007-6341). Packet parsing routines are now enclosed in eval blocks to trap exception and avoid premature termination of user program. Used ideas from: PR: ports/120702 Submitted by: Felippe de Meirelles Motta <lippemail@gmail.com>
06.04.2008 sysutils/deltup - 0.4.4_1
- remove what looks like a debug leftover printf() which offers no useful information but makes parsing the output hard. Approved by: novel@ (maintainer, implicit)
19.04.2008 A Ruby Plasma Data Engine based on DBPedia SPARQL queries
Submitted by richard dale on Thu, 04/17/2008 - 19:08. KDE General I've been playing with using KIO::get() to make queries on the DBPedia SPARQL endpoint, parse the XML result set and convert it to be used by a ...
13.03.2008 Статья о производительности xml-парсеров
Scott Sanders опубликовал статью с результатами сравнения различных xml-парсеров. Проверке подверглись как известные продукты, такие как RapidXml, DOM4J, libxml2sax, Java6, так и менее известные - Aalto, Javolution, Woodstox, StaX, phobos и Tango. По результатам сравнения видно, что с задачей обработки файлов одинакового объема быстрее всех справляется Tango pull parser. С небольшим отставанием идут Tango SAX, Tango DOM и RapidXml. >>> Why is D/Tango so fast at parsing XML?
16.10.2012 KBibTeX 0.4.1
KBibTeX is a BibTeX editor for KDE to edit bibliographies used with LaTeX. Features include comfortable input masks, starting Web queries , and exporting to PDF, PostScript, RTF, and XML/HTML. As KBibTeX is using KDE's KParts technology, it can be embedded into Kile or Konqueror.
07.03.2011 New Articles Published for week ending 3/5/11
New Articles Published for week ending 3/5/11 VMware Alive Enterprise Setting multiple FSDB locations in VMware Alive (1034899) Date Published: 3/1/2011 Connecting to the VMware Alive Enterprise SCOM adapter using Windows Authentication (1035184) Date Published: 3/3/2011 VMware Data Recovery More than 0 virtual machines were selected. A maximum of 0 virtual machines can be backed up by one Data Recovery appliance (1033813) Date Published: 2/28/2011 VMware Data Recovery File Level Restore: Installing FUSE on a Debian-based Linux 64bit OS (1035231) Date Published: 3/3/2011 VMware ESX vMotio...
02.05.2011 KBibTeX 0.3 beta 2
KBibTeX is a BibTeX editor for KDE to edit bibliographies used with LaTeX. Features include comfortable input masks, starting Web queries , and exporting to PDF, PostScript, RTF, and XML/HTML. As KBibTeX is using KDE's KParts technology, it can be embedded into Kile or Konqueror.
24.05.2011 New Articles Published for Week Ending 5/21/11
New Articles Published for Week Ending 5/21/11 Apache Tomcat Determining your version of Tomcat (1033932) Date Published: 5/19/2011 VMware Converter VMware Converter fails with the error: Unable to create a VSS snapshot of the source volume(s) (1039087) Date Published: 5/20/2011 VMware ESX Cursor fails to interact with any objects in the bottom 3 inches of the screen of a full screen virtual machine. (1000467) Date Published: 5/20/2011 Exporting system logs fail for ESX/ESXi host fails with the error: A general system error occurred: internal error (1000558) Date Published: 5/20/2011 Wi...
27.06.2011 New Articles Published for Week Ending 6/25/11
New Articles Published for Week Ending 6/25/11 Apache Tomcat 7 How can Tomcat redirect to a secure connection when behind a reverse proxy web server? (1037406) Date Published: 6/22/2011 Eclipse Virgo Enabling the YourKit Profiler with Eclipse Virgo (2000979) Date Published: 6/24/2011 VMware Converter Setting the minimum vCenter Server permissions required to perform VMware Converter operations (2000123) Date Published: 6/21/2011 VMware Data Recovery Backing up a virtual machine using VMware Data Recovery fails with the error: Trouble writing to destination store, -1115 ( disk full) (...
Нет комментариев. Почему бы Вам не оставить свой?
Вы не можете отправить комментарий анонимно, пожалуйста зарегистрируйтесь.
Google Search
Google

Web irc-unix.net

Топ Новостей
1: KDE Community announces fully open source Plasma Mobile
Hot NEWS!
Просмотров - 589


2: KWallet5 can be auto-unlocked during login again
Просмотров - 523

3: Interview with Laura
Просмотров - 508

4: Use ownCloud provided Packages, then VM, then Zip, no distro packages.
Просмотров - 495

5: Plasma Components on Android: Accelerating Subsurface Mobile Development
Просмотров - 483

6: VMware Workstation 11 and kwin - hangs and hiccups (solved?)
Просмотров - 461

7: Plasma 5 Powers KaOS Productivity
Просмотров - 453

8: KWrite on Mac – Application Bundle
Просмотров - 447

9: New Year Calligra Words Sprint
Просмотров - 427

10: FOSDEM Desktops DevRoom 2016 Call for Participation
Просмотров - 424

11: digiKam 5.0.0-beta2 is released
Просмотров - 417

12: Interview with Pierre Geier
Просмотров - 409

13: Kexi 3
Просмотров - 404

14: back in the habit
Просмотров - 402

15: Amarok is slowly catching up
Просмотров - 391

Google 120X240
Ссылки

Главная | Actual Topics | Статьи | Обратная связь | Guest Book
Генерация: 1.037 сек. и 13 запросов к базе данных за 0.964 сек.
Powered by SLAED CMS © 2005-2007 SLAED. All rights reserved.