This package allows store such data in Perst database and efficiently search/retrieve this data. Now most of commercial databases provides special XML extensions, modules or utilities allowing to deal with XML data which becomes more and more popular. Perst is able to manipulate with XML data more efficiently than relational database systems, since it can directly handle references, nested and recursive data structures.
Generally underlying data model is based on graph where vertices corresponds to objects and their field values and edges - field names (see attached file). So each object (XML element) is represented as set of properties. Property can be of string, datetime, numeric, BLOB or reference type. For each type of property separate index exists. So it was not intention to precisely store XML document model (attributes, elements, values, comments, ...) - for example attributes and subelements are treated by database in the same way.
This package doesn't allow to modify stored data. Each time you have to update an object, new version of the object is created. So the system maintains linear version history for each object
<book><author><name>Plato*</name></author></book>
)
pipeline of index searches is used: first using string index we look for "name" which
value starts with "Plato" prefix, for each located object we perform
search in reference index to locate "author" property referencing this
object...and so on, up to the top object.
<book> <price>[8,10]</price> </book>using index search/ Index search is not possible in case of chain of
<vr:rectangle%gt;
and <vr:point%gt;
elements. Perst SpatialIndex
container is used to locate overlapped rectangles.
<keyword>
element it is possible to specify list of words which should be
present in document. Keyword search is case insensitive.
<vr:store>
, either <vr:find>
.
First one allows to store one or more objects, and second one - specify one of more search patterns
(result is produced independently for each pattern). Result of find request
is document containing <vr:result>
root element which siblings are RDF objects
matching search patterns. Pattern XML element can have the following optional attributes:
Attribute | Type of value | Description | Default value |
---|---|---|---|
rdf:about | Object URI | Specify search pattern for object URI | None |
vr:before | Timestamp | Only the latest versions before the specified timestamp will be inspected | Latest version search kind is used |
vr:after | Timestamp | Only the oldest versions after the specified timestamp will be inspected | Latest version search kind is used |
vr:all | Boolean | If value of this attribute is "true", then search will be performed in all versions, otherwise only in the latest version in version histories | Latest version search kind is used |
vr:depth | Integer | Specifies depth of dumping object structure. The system will expand in XML dump all objects which are part of the containing object (URI starts with the URI of the containing object) or object which depth from the root object doesn't exceed specified | 0 |
Please look at the example of storing and
searching RDF data.
To start example, please use "run.bat" script in rdf/samples
directory.