diff --git a/docs/islandora/rdf-mapping.md b/docs/islandora/rdf-mapping.md index ef064feac..124178e41 100644 --- a/docs/islandora/rdf-mapping.md +++ b/docs/islandora/rdf-mapping.md @@ -63,8 +63,28 @@ Below is an example of an RDF mapping as a .yml (YAML) file. It is the current v - The top level key `types` specifies the `rdf:type` of the resource or content model. `field_model`, a required field of Islandora objects, also gets mapped to `rdf:type` through an arcane back-end process. - The top level key `fieldMappings` specifies fields attached to that bundle and their RDF property mappings. One field can be mapped to more than one RDF property. It is a simple flat list. -- `datatype_callback` : [needs documentation] -- `mapping_type: rel` : [needs documentation] + +#### Mapping Types +`mapping_type:`: There are several mapping types which are provided out of the box. +- `rel` - standing for relationship, expresses a relationship between two resources +- `property` - the default, or if a relationship is not provided, expresses the relationship between a resource and some literal text. + +#### Datatype Callbacks +`datatype_callback`: This is a custom function that transforms the output of the field. There are some provided to us by Drupal and some added by Islandora, such as: +- `Drupal\controlled_access_terms\EDTFConverter::dateIso8601Value` which converts dates to Iso format +- `Drupal\jsonld\EntityReferenceConverter::linkFieldPassthrough` which converts a referenced entity to the URI on the entity (which is configurable with the `link_field` argument +An example usage of the `Drupal\jsonld\EntityReferenceConverter::linkFieldPassthrough` is as follows: +```yml +field_subject: + properties: + - 'dcterms:subject' + datatype_callback: + callable: 'Drupal\jsonld\EntityReferenceConverter::linkFieldPassthrough' + arguments: + link_field: 'field_authority_link' +``` +Which would convert a reference to the subject's taxonomy term entity to a reference to the URI provided in `field_authority_link` of that subject's taxonomy term entity. + ## Sample RDF Mapping ```yml