Run xpath queries against sqlite

This project was awarded to sarfyvw for $212.5 USD.

Get free quotes for a project like this
Employer working
Awarded to:
Project Budget
$100 - $500 USD
Total Bids
Project Description

We have an sqlite database that stores the records in xml format. The schema is (simplified)

uuid CHAR(32) NOT NULL,

Where the content is an XML data.

This project has two phases mainly for you to understand what we need
Phase#1 (extremely slow version)
For each row in the msg table
run xpath against the msg.content.
Merge the results

The problem with this is that each row must be visited to get the results. If the table is large this wont scale at all.

In the second phase, which is what we actually need, we need you to use FTS2 (<[url removed, login to view]>) to preselect the rows to avoid running the query against all rows. We need you to update the algorithm as follows
sqlite> select uuid from msg where contents match '<terms-in-xpath>';
for each row in the returned set
run xpath against the msg.content.
Merge the results

For example,
If the xpath query is "author[last-name = "Bob"]", then FTS2 query should be
sqlite> select uuid from msg where contents match 'author last-name Bob';

This will reduce the results to a managable size and then individual xpath queries can run against the result set.

The major complications are:
1. Detect the "OR" and "NOT" expressions (e.g., author[last-name = "Bob" or first-name = "Alice"])
2. Eliminate predefined XPATH functions (e.g., author[last()] where the term 'last' should not be part of the query)

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).

## Platform

PHP 5.x

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online