PyOpenWorm.data module¶
-
class
PyOpenWorm.data.Data(conf=None, **kwargs)[source]¶ Bases:
PyOpenWorm.configure.ConfigureProvides configuration for access to the database.
Usually doesn’t need to be accessed directly
-
classmethod
load(file_name)[source]¶ Load a file into a new Data instance storing configuration in a JSON format
-
classmethod
-
class
PyOpenWorm.data.DataUser(*args, **kwargs)[source]¶ Bases:
PyOpenWorm.configure.ConfigureableA convenience wrapper for users of the database
Classes which use the database should inherit from DataUser.
-
add_reference(self, g, reference_iri)[source]¶ Add a citation to a set of statements in the database
Parameters: triples – A set of triples to annotate
-
-
class
PyOpenWorm.data.RDFSource(**kwargs)[source]¶ Bases:
PyOpenWorm.configure.Configureable,PyOpenWorm.configure.ConfigValueBase class for data sources.
Alternative sources should dervie from this class
-
class
PyOpenWorm.data.SPARQLSource(**kwargs)[source]¶ Bases:
PyOpenWorm.data.RDFSourceReads from and queries against a remote data store
"rdf.source" = "sparql_endpoint"
-
class
PyOpenWorm.data.SleepyCatSource(**kwargs)[source]¶ Bases:
PyOpenWorm.data.RDFSourceReads from and queries against a local Sleepycat database
The database can be configured like:
"rdf.source" = "Sleepycat" "rdf.store_conf" = <your database location here>
-
class
PyOpenWorm.data.DefaultSource(**kwargs)[source]¶ Bases:
PyOpenWorm.data.RDFSourceReads from and queries against a configured database.
The default configuration.
The database store is configured with:
"rdf.source" = "default" "rdf.store" = <your rdflib store name here> "rdf.store_conf" = <your rdflib store configuration here>
Leaving unconfigured simply gives an in-memory data store.
-
class
PyOpenWorm.data.ZODBSource(*args, **kwargs)[source]¶ Bases:
PyOpenWorm.data.RDFSourceReads from and queries against a configured Zope Object Database.
If the configured database does not exist, it is created.
The database store is configured with:
"rdf.source" = "ZODB" "rdf.store_conf" = <location of your ZODB database>
Leaving unconfigured simply gives an in-memory data store.