Representation of an odML document. Depending on the used back-end an odML document can either be attached to a certain data source (e.g. a data base) or it can be detached. Attached documents persist changes immediately to the respective data source while detached documents write data only when save() is called.
| Parameters: |
|
|---|
The name of the documents author. Is None if not specified otherwise.
| Type: | str |
|---|
The back-end used by a document.
NOTICE: This is mostly for internal use.
| Type: | odml2.api.base.BaseDocument |
|---|
Create an empty root section. If the document already contains sections the whole content of the document will be replaces with the new root.
NOTICE: This method is primarily for internal use (see root as alternative)
| Parameters: | |
|---|---|
| Returns: |
The creation date of the document.
| Type: | datetime.date |
|---|
Find a Section within the document and associated documents.
| Parameters: | |
|---|---|
| Returns: | The found section or None |
Find a Section and its namespace within the document and associated documents.
| Parameters: | |
|---|---|
| Returns: | The section with its namespace or None |
Whether or not the back-end used by the odML document is attached to a data source. This is a read only property.
| Type: | bool |
|---|
Whether or not the the document is writable. This is a read only property.
| Type: | bool |
|---|
Load data to the document from a certain source.
| Parameters: |
|
|---|
An uri or path to the location of the document. Is None for newly created documents. This is a read only property.
| Type: | str |
|---|
A dictionary like access to all name spaces of the document. Name spaces can be used to include other documents under a certain prefix.
| Type: | NameSpaceMap |
|---|
Dictionary like access to all property definitions. Property definitions are terms that provide descriptions for properties which may occur in sections of the document.
| Type: | PropertyDefMap |
|---|
The root section of the document. Is always None for newly created documents. If the document already contains sections the whole content of the document will be replaces with the new root.
| Type: | Section | SB |
|---|
Save a document to a given destination.
| Parameters: | destination (str | io.FileIO | io.StringIO) – Where to store the content of the document. |
|---|
The terminology strategy defines how section types and property names are handled with respect to a given terminology.
Dictionary like access to all type definitions. Type definitions are terms that provide descriptions for section types which may occur in a document.
| Type: | TypeDefMap |
|---|
The version of the document. Is 1 unless specified otherwise.
| Type: | int |
|---|
The terminology strategy defines how section types and property names are handled with respect to a given terminology.
Terminology violations such as undefined type or property names are always ignored. This is the default strategy.
Property and type definitions without prefix are created and updated on the fly. This strategy can be used in order to define your custom terminology.
Each property and type must be defined and used correctly. This strategy can be used to ensure that a document adheres to a terminology.
Provides a dictionary like access to all name spaces of a document.
Provides a dictionary like access to all type definitions which are part of the terminology of a document.
Provides a dictionary like access to all property definitions which are part of the terminology of a document.