Skip to content

Sources and attribution

tilttek/rpg-systems

Provenances

A Provenance says where a record comes from:

FieldWhat it holds
titleThe title of the source, required
licenceIts Licence, required
attributionThe statement a work that shows the material displays: required when the licence asks for attribution
authorWho holds the source
urlWhere it is published: an absolute http or https address, read by phil/url

Every record carries one, and two equal provenances share an identity(), so that each source is shown once. The attribution is the text the source asks for, given by whoever states the provenance: the library does not write it.

Licences

The list of licences is closed; material under any other licence is refused when it is read.

LicenceIdentifierAsks for attributionReciprocal
CcBy40CC-BY-4.0YesNo
CcBy30CC-BY-3.0YesNo
CcBySa40CC-BY-SA-4.0YesYes
Cc0CC0-1.0NoNo
OrcORCYesYes
OwnedownedNoNo

title() and url() give the licence's name and the page of its text; Owned, the application's own material, has no page. isReciprocal() says whether a work that adapts the material passes the material on under the same licence.

The notices of a page

AttributionRenderer gives the notices a page displays: one for each source whose licence asks for attribution, each once, in the order the sources first appear.

$renderer = new AttributionRenderer();

$renderer->text($system);               // one line per source
$renderer->html($system, 'es');         // an HTML list, with the Spanish translation's source
$renderer->sources($system);            // the provenances themselves

A page that shows a few records rather than a whole system gives their provenances: $renderer->html([$term->provenance, $attribute->provenance]). The locale chooses the translations whose sources are shown — those of the locale and of its language —; without one, every translation's source is. all: true lists the sources that ask for no attribution too.

A line holds the attribution, or the title of a source without one — followed by its address when it has one —, then the licence's name and the page of its text:

This work includes material from the System Reference Document 5.2 … (Creative Commons Attribution 4.0 International: https://creativecommons.org/licenses/by/4.0/)

The HTML list is <ul class="attribution">, every text escaped, the licence's name linked to its page with rel="license"; it is an empty string when no source asks for attribution, so that a page prints nothing.