Skip to content

Commit 787a8ac

Browse files
committed
Update generated documentation for components.
Update the generated `docs/odk-workflows/components.md` file to: * remove the bits about having to manually update the -edit file and the catalog file, since this is now done automatically by the ODK; * remove the bit about having to create a custom rule to generate a component derived from a template, and explain instead how the ODK can be configured to generate such a rule automatically (`use_template` option); * also show how the ODK can be configured to derive components from mappings or to fetch a remote component. closes #1226
1 parent 70669d9 commit 787a8ac

1 file changed

Lines changed: 27 additions & 16 deletions

File tree

template/_dynamic_documentation.jinja2

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -704,38 +704,49 @@ components:
704704
- filename: your-component-name.owl
705705
```
706706

707-
3) Add the component to your catalog file (src/ontology/catalog-v001.xml)
707+
3) Refresh your repo by running `sh run update_repo`. This will automatically (1) create a new file in `src/ontology/components/`, (2) update the `-edit` file so that it imports `{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/components/your-component-name.owl` (the IRI of your new component), and (3) update the XML catalog file (`src/ontology/catalog-v001.xml`) to redirect that IRI to the file in the `src/ontology/components` directory, so that the new component can be found by tools such as Protégé or ROBOT, when they load the `-edit` file.
708+
709+
If your component is to be generated by some automated process, add a goal in your custom Makefile (`src/ontology/{{ project.id }}.Makefile`) and make it perform any task needed to generate the component:
708710

709711
```
710-
<uri name="{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/components/your-component-name.owl" uri="components/your-component-name.owl"/>
712+
$(COMPONENTSDIR)/your-component-name.owl: $(SRC)
713+
<Insert here the code to produce the component>
711714
```
712715

713-
4) Add the component to the edit file (src/ontology/{{ project.id }}-edit.obo)
714-
for .obo formats:
716+
If the component is to be generated from a ROBOT template, the ODK can generate the appropriate code for you. For that, when adding the component fo the ODK configuration file (step 2 above), explicitly indicate that the component should be derived from template(s) and list the source templates:
715717

716718
```
717-
import: {{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/components/your-component-name.owl
719+
components:
720+
products:
721+
- filename: your-component-name.owl
722+
use_template: true
723+
templates:
724+
- template1.tsv
725+
- template2.tsv
718726
```
719727

720-
for .owl formats:
728+
In this example, the component will be derived from the templates found in `src/templates/template1.tsv` and `src/templates/template2.tsv`. Initial empty templates will automatically be generated when the repository is refreshed (step 3).
729+
730+
Likewise, the ODK can generate the required code for the case where the component is to be derived from SSSOM mappings:
721731

722732
```
723-
Import(<{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/components/your-component-name.owl>)
733+
components:
734+
products:
735+
- filename: your-component-name.owl
736+
use_mappings: true
737+
mappings:
738+
- my-mappings.sssom.tsv
724739
```
725740

726-
5) Refresh your repo by running `sh run.sh make update_repo` - this should create a new file in src/ontology/components.
727-
6) In your custom makefile (src/ontology/{{ project.id }}.Makefile) add a goal for your custom make file. In this example, the goal is a ROBOT template.
741+
and for the case where the component is to be fetched from a remote resource:
728742

729743
```
730-
$(COMPONENTSDIR)/your-component-name.owl: $(SRC) ../templates/your-component-template.tsv
731-
$(ROBOT) template --template ../templates/your-component-template.tsv \
732-
annotate --ontology-iri $(ONTBASE)/$@ --output $(COMPONENTSDIR)/your-component-name.owl
744+
components:
745+
products:
746+
- filename: your-component-name.owl
747+
source: https://example.org/component-source.owl
733748
```
734749

735-
(If using a ROBOT template, do not forget to add your template tsv in src/templates/)
736-
737-
7) Make the file by running `sh run.sh make components/your-component-name.owl`
738-
739750
^^^ docs/odk-workflows/ManageDocumentation.md
740751
# Updating the Documentation
741752

0 commit comments

Comments
 (0)