gavo.base.typedmeta module

Typed metadata.

These are subclasses of base.MetaValue that deal with special sorts of metadata. Most of the time, they organise some extra (hidden or open) keys, or they do some special HTML rendering.

Use the meta.forKeys class decorator to teach meta.py where to use your new class.

class gavo.base.typedmeta.BibcodeMeta(content='', format='plain')[source]

Bases: MetaValue

A MetaValue that may contain bibcodes, which are rendered as links into ADS.

class gavo.base.typedmeta.DOIMeta(content, **kwargs)[source]

Bases: MetaValue

A MetaValue for a DOI.

This lets people construct DOI meta with or without a doi: prefix. It also creates landing page links in HTML.

class gavo.base.typedmeta.DatetimeMeta(content, *args, **kwargs)[source]

Bases: MetaValue

A meta value representing a timestamp.

Accessing it, you will get a formatted ISO/DALI string. You can construct them with both strings (that we’ll try to parse and bomb if that’s not possible) and datetime.datetime objects.

class gavo.base.typedmeta.ExampleMeta(content, format='rst', title=None)[source]

Bases: MetaValue

A MetaValue to keep VOSI examples in.

All of these must have a title, which is also used to generate references.

These also are in reStructuredText by default, and changing that probably makes no sense at all, as these will always need interpreted text roles for proper markup.

Thus, the usual pattern here is:

<meta name="_example" title="An example for _example">
        See docs_

        .. _docs: http://docs.g-vo.org
</meta>
class gavo.base.typedmeta.InfoItem(content, format='plain', infoName=None, infoValue=None, infoId=None)[source]

Bases: MetaValue

A meta value for info items in VOTables.

In addition to the content (which should be rendered as the info element’s text content), it contains an infoName and an infoValue.

They are only used internally in VOTable generation and might go away without notice.

class gavo.base.typedmeta.LogoMeta(content='', *args, **kwargs)[source]

Bases: MetaValue

A MetaValue corresponding to a small image.

These are rendered as little images in HTML. In XML meta, you can say:

<meta name="_somelogo" type="logo">http://foo.bar/quux.png</meta>
class gavo.base.typedmeta.MetaURL(url, format='plain', title=None)[source]

Bases: MetaValue

A meta value containing a link and optionally a title

In plain text, this would look like this:

_related:http://foo.bar
_related.title: The foo page

In XML, you can write:

<meta name="_related" title="The foo page"
        ivoId="ivo://bar.org/foo">http://foo.bar</meta>

or, if you prefer:

<meta name="_related">http://foo.bar
         <meta name="title">The foo page</meta></meta>

These values are used for _related (meaning “visible” links to other services).

For links within you data center, use the internallink macro, the argument of which the the “path” to a resource, i.e. RD path/service/renderer; we recommend to use the info renderer in such links as a rule. This would look like this:

<meta name="_related" title="Aspec SSAP"
        >\internallink{aspec/q/ssa/info}</meta>
class gavo.base.typedmeta.NewsMeta(content, format='plain', author=None, date=None, role=None)[source]

Bases: MetaValue

A meta value representing a “news” items.

The content is the body of the news. In addition, they have date, author, and role children. In plain text, you would write:

_news: Frobnicated the quux.
_news.author: MD
_news.date: 2009-03-06
_news.role: updated

In XML, you would usually write:

<meta name="_news" author="MD" date="2009-03-06">
  Frobnicated the quux.
</meta>

_news items become serialised into Registry records despite their leading underscores. role then becomes the date’s role.

discardChildrenInHTML = True
class gavo.base.typedmeta.NoteMeta(content, format='rst', tag=None)[source]

Bases: MetaValue

A meta value representing a “note” item.

This is like a footnote, typically on tables, and is rendered in table infos.

The content is the note body. In addition, you want a tag child that gives whatever the note is references as. We recommend numbers.

Contrary to other meta items, note content defaults to rstx format.

Typically, this works with a column’s note attribute.

In XML, you would usually write:

<meta name="note" tag="1">
  Better ignore this.
</meta>
class gavo.base.typedmeta.RelatedResourceMeta(title, format='plain', ivoId=None)[source]

Bases: MetaValue

A meta value containing an ivo-id and a name of a related resource.

The sort of relationsip is encoded in the meta name, where the terms are defined in the vocabuary http://www.g-vo.org/rdf/voresource/relationship_type (where there are minor lexical deviations from identifiers there to DaCHS’ meta names).

All relationship metas should look like this (using isSupplementTo as an example; while an ivoId is not mandatory, it rarely makes sense to declare a relationship without it):

isSupplementTo: GAVO TAP service
isSupplementTo.ivoId: ivo://org.gavo.dc

isServedBy and isServiceFor are somewhat special cases, as the service attribute of data publications automatically takes care of them; so, you shouldn’t usually need to bother with these two manually.

class gavo.base.typedmeta.VotLinkMeta(href, format='plain', linkname=None, contentType=None, role=None)[source]

Bases: MetaValue

A MetaValue serialized into VOTable links (or, ideally, analogous constructs).

This exposes the various attributes of VOTable LINKs as href linkname, contentType, and role. You cannot set ID here; if this ever needs referencing, we’ll need to think about it again. The href attribute is simply the content of our meta (since there’s no link without href), and there’s never any content in VOTable LINKs).

You could thus say:

votlink: http://docs.g-vo.org/DaCHS
votlink.role: doc
votlink.contentType: text/html
votlink.linkname: GAVO DaCHS documentation