Cheshire3 Objects: Record

|  | ## Cheshire3 Objects: Record

Description

Records in the system are stored in an XML form. Attached to the record is various configurable metadata, such as the time it was inserted into the database and by which user. Records are stored in a RecordStore database and retrieved via a persistent and unique document identifier. The record data may be retrieved as a list of SAX events, as regularised XML or as a DOM tree.

Implementations

- MinidomRecord
  A DOM based record using the Python Minidom binding
- LxmlRecord
  A DOM based record using a Python binding to the libxml2 library
- SaxRecord
  A SAX based record
- MarcRecord
  A MARC (common library catalogue format) record.

API

Module: cheshire3.record
Classes:

- MinidomRecord
  A DOM based record using the Python Minidom binding
- LxmlRecord
  A DOM based record using a Python binding to the libxml2 library
- SaxRecord
  A SAX based record
- MarcRecord
  A MARC (common library catalogue format) record.

Methods:

Function | Parameters | Returns | Description
--- | --- | --- | ---
__init__ | data, ?xml, ?docid |  | The constructer takes the data which should be used to construct the record. This is implementation dependant, eg a DOM node or a list of SAX events.. It also optionally may take the raw XML which was parsed, and a document identifier.
get_xml | session | string | Return the raw XML for the record
get_dom | session | domNode | Return the dom document node for the record
get_sax | session | list of saxEvents | Return the sax events for the record (list of strings)
process_xpath | session, XPath | data | Given an XPath, process it and return the results. The XPath may be parsed ( tuple of object and internal format) or a string. Returned data type will depend on the XPath, but will commonly be a list of either DOM nodes or strings.

### Sub-Packages

Sub-package: graph
Module: cheshire3.graph.record

- GraphRecord
  RDF Graph based record.
- OreGraphRecord
  RDF Graph based record specifically for dealing with OAI-ORE aggregations.