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
-
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(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.SerializationSource(**kwargs)[source]¶ Bases:
PyOpenWorm.data.RDFSourceReads from an RDF serialization or, if the configured database is more recent, then from that.
The database store is configured with:
"rdf.source" = "serialization" "rdf.store" = <your rdflib store name here> "rdf.serialization" = <your RDF serialization> "rdf.serialization_format" = <rdflib serialization format> "rdf.store_conf" = <your rdflib store configuration here>
-
class
PyOpenWorm.data.TrixSource(**kwargs)[source]¶ Bases:
PyOpenWorm.data.SerializationSourceA SerializationSource specialized for TriX
The database store is configured with:
"rdf.source" = "trix" "rdf.trix_location" = <location of the TriX file> "rdf.store" = <your rdflib store name here> "rdf.store_conf" = <your rdflib store configuration here>
-
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.