A library providing dissemination services support on top of the acdh-oeaw/arche-lib

4.0.3 2024-03-25 16:03 UTC


Latest Stable Version Build status Coverage Status License

A library implementing dissemination services on top of the arche-lib


composer require acdh-oeaw/acdh-repo-acdh


API documentation:

Broader description of the dissemination services idea:

Dissemination service description schema

Dissemination service description is provided in RDF.

There are three classes of resources describing a service:

  • The service itself
    • required predicates:
      • RDF class
      • (URI) dissemination service identifier.
      • (string) dissemination service name.
      • (string, exactly one value) provides a redirection URL template.
        The template can contain parameter placeholders using the {name([@&]prefix)?(|trans)*} syntax, where:
        • name is one of RES_URI/RES_URL - the repository resource URL, RES_ID - the internal repository resource identifier (the number being the last part of the RES_URL), ID - resource identifier, custom parameter placeholder name as described below
        • &prefix (requested prefix) or @prefix (preferred prefix) allow to define value prefix. This can be useful if many values are expected, e.g. when name is RES_ID. The actual prefix comes from the YAML config ($.schema.namespaces.{id}). &prefix and @prefix behavior differs if no value matches a given prefix. In such a case &prefix returns empty value while @prefix returns any value.
        • |trans is optional chain of transformations like URL-encoding, extracting URI part, etc. You can check available transformations here. If a transformation takes additional parameters the syntax is |trans(p1,p2). Transformations can be chained, e.g. |trans1|trans2(p1). For real world examples see here.
      • (string, one or more values) describes the returned data format. Technically it can be any string but the value should be easy to guess by users (so e.g. return mime type can be a good idea).
  • Matching rules
    Rules describing how to find repository resources which can be processed by a given service.
    All required rules and, if defined, at least one optional rule must match for the dissemination service to match.
    In case of no rules being defined, all repository resources match a given dissemination service.
    • required predicates:
      • (URI) pointing to the service's value.
      • (URI) match rule identifier.
      • (string) match rule name.
      • (string, exactly one value) metadata predicate the rule is testing.
      • (bool, exactly one value) is this rule a required or an optional one?
    • optional predicates:
      • (string, no more than one value) value required for the rule to match. If not provided, any value is accepted. All values are casted to string before the comparison.
  • Redirection URL template placeholders
    Describe the way URL template placeholders are substituted with values.
    • required predicates:
      • RDF class
      • (URI) pointing to the service's value.
      • (URI) parameter placeholder identifier.
      • (string) parameter placeholder name (must match the name used in the redirection URL template!).
    • optional predicates:
      • (string, no more than one value) default value.
      • (string, no more than one value) RDF property from which the placeholder value will be taken.

Example definition can be found here.

See also