owmeta.document module¶
- class owmeta.document.BaseDocument(*args, no_type_decl=False, **kwargs)[source]¶
Bases:
DataObject
- class_context = owmeta_core.context.ClassContext(ident="http://schema.openworm.org/2020/07/sci")¶
- class owmeta.document.Document(*args, no_type_decl=False, **kwargs)[source]¶
Bases:
BaseDocument
A representation of some document.
Possible keys include:
pmid, pubmed: a pubmed id or url (e.g., 24098140) wbid, wormbase: a wormbase id or url (e.g., WBPaper00044287) doi: a Digitial Object id or url (e.g., s00454-010-9273-0) uri: a URI specific to the document, preferably usable for accessing the document
- Parameters
- bibtex
str
A string containing a single BibTeX entry. Parsed during initialization, but not saved thereafter. optional
- doi
str
A Digital Object Identifier (DOI). optional
- pubmed
str
A PubMed ID (PMID) or URL that points to a paper. Ignored if ‘pmid’ is provided. optional
- wormbase
str
An ID or URL from WormBase that points to a record. Ignored if
wbid
orwormbaseid
are provided. optional
- bibtex
- defined_augment()[source]¶
This fuction must return False if
identifier_augment()
would raise anIdentifierMissingException
. Override it when defining a non-standard identifier for subclasses of DataObjects.
- identifier_augment()[source]¶
Override this method to define an identifier in lieu of one explicity set.
One must also override
defined_augment()
to return True whenever this method could return a valid identifier.IdentifierMissingException
should be raised if an identifier cannot be generated by this method.- Raises
IdentifierMissingException
- update_from_pubmed(read_size=65536, **kwargs)[source]¶
Update the document attributes from NCBI Entrez API using the pubmed attribute
- Parameters
- chunk_size
int
The number of bytes to pass to
requests.Response.iter_content
. This may reduce runtime memory requirements for the request.- **kwargs
Passed on as arguments to
requests.Session.get
- chunk_size
- update_from_wormbase(replace_existing=False, **kwargs)[source]¶
Queries WormBase.org for additional data to fill in the
Document
.If replace_existing is set to
True
, then existing values will be cleared.- Parameters
- replace_existingbool
Whether to replace values that are already set for a given property
- **kwargs
Passed on as arguments to
requests.Session.get
- property author¶
An author of the document
- class_context = owmeta_core.context.ClassContext(ident="http://schema.openworm.org/2020/07/sci")¶
- property date¶
Alias to year
- property doi¶
A Digital Object Identifier (DOI), optional
- property pmid¶
A PubMed ID (PMID) that points to a paper
- property title¶
The title of the document
- property uri¶
A non-standard URI for the document
- property wbid¶
An ID from WormBase.org that points to a record, optional
- property year¶
The year (e.g., publication year) of the document
- class owmeta.document.SourcedFrom(*args, **kwargs)[source]¶
Bases:
ObjectProperty
Indicates which document provided the source for an object
- owner_type¶
alias of
BaseDataObject
- value_type¶
alias of
BaseDocument
- lazy = True¶
If
True
, then the property is not attached to an instance until the property is set or queried.
- multiple = False¶
If
True
, then the property will only maintain a single staged value at a time. No effort is made to check how many values are stored in the RDF graph.
- rdf_type_class = None¶