Skip to content

Commit

Permalink
Main update (#1612)
Browse files Browse the repository at this point in the history
* Render the example helpful tip properly. (#1586)

* Render the example helpful tip properly.

* Fix note syntax, again.

* Update rdf-mapping.md doc (#1585)

Co-authored-by: Eli Zoller <5439169+elizoller@users.noreply.github.com>
  • Loading branch information
2 people authored and dannylamb committed Sep 11, 2020
1 parent b8e6961 commit 4b50a90
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
15 changes: 13 additions & 2 deletions docs/contributing/docs_style_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,20 @@
- Use `-` instead of `*` for bulleted lists.
- Upload images to the 'assets' folder and reference them from there.
-- For file name, use underscores between words and prefix all file names with the page name, e.g. context_display_hints.jpg for the image showing how to set display hints in the context menu.
- Use `!!! note "Note title"` at the start of a paragraph to have it rendered as a note like this:
- Use the [Admonition syntax](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) to create notes like this (four-space indent required):

_Example:_

```
!!! note "Helpful Tip"
I am a helpful tip!
```

_Result:_

!!! note "Helpful Tip"
I am a helpful tip!

!!! note "Helpful Tip" I am a helpful tip!

## Don'ts

Expand Down
24 changes: 22 additions & 2 deletions docs/islandora/rdf-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4b50a90

Please sign in to comment.