Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added components doc #577

Merged
merged 4 commits into from
Apr 7, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions template/_dynamic_files.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,55 @@ This requires quite a bit of memory on your local machine, so if you encounter a

Lastly, restart Protege, and the term should be imported in ready to be used.

^^^ docs/odk-workflows/components.md

# Adding components to an ODK repo

For details on what components are, please see component section of [repository file structure document](../odk-workflows/RepositoryFileStructure.md).

To add custom components to an ODK repo, please follow the following steps:
1. Locate your odk yaml file and open it with your favourite text editor (src/ontology/{{ project.id }}-odk.yaml)
2. Search if there is already a component section to the yaml file, if not add it accordingly, adding the name of your component:
```
components:
products:
- filename: your-component-name.owl
```
3. Add the component to your catalog file (src/ontology/catalog-v001.xml)
```
<uri name="http://purl.obolibrary.org/obo/{{ project.id }}/components/your-component-name.owl" uri="components/your-component-name.owl"/>
```
4. Add the component to the edit file (src/ontology/{{ project.id }}-edit.obo)
for .obo formats:
```
import: http://purl.obolibrary.org/obo/{{ project.id }}/components/your-component-name.owl
```
for .owl formats:
```
Import(<http://purl.obolibrary.org/obo/{{ project.id }}/components/your-component-name.owl>)
```
5. Refresh your repo by running `sh run.sh make update_repo` - this should create a new file in src/ontology/components.
6. In your custom makefile (src/ontology/{{ project.id }}.Makefile) add a goal for your custom make file as follows (for ROBOT template goals, please see section below):

```
YOUR_COMPONENT_NAME = {insert how your component is made, for example a url it is downloaded from}
$(COMPONENTSDIR)/your-component-name.owl: $(SRC)
$(ROBOT) annotate -I $(YOUR_COMPONENT_NAME) --ontology-iri $(ONTBASE)/$@ -o $@
matentzn marked this conversation as resolved.
Show resolved Hide resolved
```
7. Make the file by running `sh run.sh make components/your-component-name.owl`

### ROBOT Templates

Quick guide for adding a component that uses ROBOT template:

1. Add your template in src/templates/
2. Your custom makefile goal should look something like:
```
$(COMPONENTSDIR)/your-component-name.owl: $(SRC) ../templates/your-component-template.tsv
$(ROBOT) template --template ../templates/your-component-template.tsv \
annotate --ontology-iri $(ONTBASE)/$@ --output $(COMPONENTSDIR)/your-component-name.owl
```

^^^ docs/odk-workflows/ManageDocumentation.md
# Updating the Documentation

Expand Down Expand Up @@ -1421,6 +1470,7 @@ nav:
- Manage your ODK Repository: odk-workflows/RepoManagement.md
- Setting up Docker for ODK: odk-workflows/SettingUpDockerForODK.md
- Imports management: odk-workflows/UpdateImports.md
- Components management: odk-workflows/components.md
- Managing the documentation: odk-workflows/ManageDocumentation.md
- Continuous Integration: odk-workflows/ContinuousIntegration.md
- Your ODK Repository Overview: odk-workflows/RepositoryFileStructure.md
Expand Down