gavo.registry.publication module

“Publishing” service records – grammar-type stuff and UI.

This module basically turns “publishable things” – services, resource records, data items – into row dictionaries that can be entered into the database.

This is one half of getting them into the registry. The other half is done in identifiers and builders; these take the stuff from the database, rebuilds actual objects and creates registry records from them. So, the content of the service table is not actually used to build resource records.

class gavo.registry.publication.RDRscRecGrammar(parent, **kwargs)[source]

Bases: Grammar

A grammar for “parsing” raw resource records from RDs.

attrSeq = [<gavo.base.attrdef.UnicodeAttribute object>, <gavo.base.parsecontext.IdAttribute object>, <gavo.base.complexattrs.StructAttribute object>, <gavo.base.parsecontext.OriginalAttribute object>, <gavo.base.complexattrs.PropertyAttribute object>, <gavo.rscdef.common.RDAttribute object>, <gavo.base.complexattrs.StructListAttribute object>, <gavo.base.complexattrs.StructAttribute object>]
completedCallbacks = []
getProperty(name, default=<Undefined>)
isDispatching = True
keepTimestamp = False
managedAttrs = {'enc': <gavo.base.attrdef.UnicodeAttribute object>, 'id': <gavo.base.parsecontext.IdAttribute object>, 'ignoreOn': <gavo.base.complexattrs.StructAttribute object>, 'original': <gavo.base.parsecontext.OriginalAttribute object>, 'properties': <gavo.base.complexattrs.PropertyAttribute object>, 'property': <gavo.base.complexattrs.PropertyAttribute object>, 'rd': <gavo.rscdef.common.RDAttribute object>, 'rowfilter': <gavo.base.complexattrs.StructListAttribute object>, 'rowfilters': <gavo.base.complexattrs.StructListAttribute object>, 'sourceFields': <gavo.base.complexattrs.StructAttribute object>}
property rd

alias of RDRscRecIterator

setProperty(name, value)
unpublish = False
class gavo.registry.publication.RDRscRecIterator(grammar, sourceToken, sourceRow=None)[source]

Bases: RowIterator

A RowIterator yielding resource records for inclusion into the service list for the services defined in the source token RD.

notify = False

returns ids of all RDs (inputs and built-in) known to the system.


returns the ids of all RDs which have been published before.

gavo.registry.publication.getDeletedIdentifiersUpdater(conn, rd)[source]

returns a function to be called after records have been updated to mark new deleted identifiers as changed.

The problem solved here is that we mark all resource metadata belonging to and RD as deleted before feeding the new stuff in. We don’t want to change resources.rectimestamp there; this would, for instance, bump old deleted records.

What we can do is see if there’s new deleted records after and rd is through and update their rectimestamp. We don’t need to like it.


returns a (cached) set of authorities our main registry manages.


returns a list of RDs from a list of RD ids or paths.

gavo.registry.publication.iterAuthorsAndSubjects(resource, sourceRD, resId)[source]

yields rows for the subjects and authors tables.

resource is the meta-carrier for the resource to be described, sourceRD and resId are its keys in the resources table.

gavo.registry.publication.iterDataRecs(res, keepTimestamp=False)[source]

as iterSvcRecs, just for DataDescriptors rather than Services.

gavo.registry.publication.iterResRecs(res, keepTimestamp=False)[source]

as iterSvcRecs, just for ResRecs rather than Services.

gavo.registry.publication.iterSvcRecs(service, keepTimestamp=False)[source]

iterates over records suitable for importing into the service list for service.


handles the user interaction for gavo publish.

gavo.registry.publication.makeBaseRecord(res, keepTimestamp=False)[source]

returns a dictionary giving the metadata common to resource records.

gavo.registry.publication.makeDeletedRecord(ivoid, conn)[source]

enters records into the internal service tables to mark ivoid as deleted.

gavo.registry.publication.updateServiceList(rds, metaToo=False, connection=None, onlyWarn=True, keepTimestamp=False, unpublish=False)[source]

updates the services defined in rds in the services table in the database.

This is what actually does the publication.