Skip to content
Open
Changes from all 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
91 changes: 75 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,87 @@
# OntoLex Morphology Module
# OntoLex Module for Morphology

The Morphology Module for the OntoLex Model
The Morphology Module (*morph*) extends the [OntoLex-Lemon](https://ontolex.github.io/ontolex/) model to represent
the morphology of lexical entries in RDF. It covers the segmentation of words into morphs (stems, roots and affixes),
the grammatical meaning these morphs carry, and the rules that relate lexical entries and forms to each other: word
formation rules (derivation and compounding) and inflection rules, including the generation of inflected forms from
inflection classes and paradigms.

For more details see the Wiki: https://www.w3.org/community/ontolex/wiki/Morphology
The module is developed by the [W3C Ontology-Lexica Community Group](https://www.w3.org/community/ontolex/). Its
namespace is `http://www.w3.org/ns/lemon/morph#` (prefix `morph:`).

## Draft spec
The live version of the draft specification is available at https://ontolex.github.io/morph/

Current draft can be inspected on the [website](https://ontolex.github.io/morph/draft.html) and edited under [draft.md](draft.md).
## Repository Layout

The [HTML template](index.html) is still empty, if finalized, it will be exposed via https://ontolex.github.io/morph/.
- `index.md`: the specification, which is the source of both the document and the ontology
- `morph.ttl`: the ontology, extracted from the specification
- `examples/`: the Turtle files of the examples in the specification
- `OntoLex Morph.drawio.svg` / `.png`: the diagram of the model (Figure 1)
- `respec.template`, `expand_tags.py`, `build_ontology.py`, `scripts/`: the build tools
- `data/`: sample data and experiments for agglutinative, fusional and polysynthetic languages and for form generation
- `doc/`, `minutes/`, `minutes_txt/`: background material, reviews and meeting minutes
- `related/`: related vocabularies (including [MMoOn](https://github.com/MMoOn-Project/MMoOn) as a Git submodule)

## GDrive
## Building the Specification

Much information is scattered on Google Drive, and only mirrorred here.
See https://www.w3.org/community/ontolex/wiki/Morphology for the original link.
The specification uses [ReSpec](https://respec.org/docs/) and is generated from the Markdown file `index.md`. A GitHub
action builds the specification on every push to `master` and deploys it to https://ontolex.github.io/morph/. It
also runs on every pull request, where it fails if the build or the checks fail.

In particular, this pertains to the folders
- `minutes/`
- `data/gdrive`
To build it locally you need [Pandoc](https://pandoc.org/) and the Python packages `beautifulsoup4` and `rdflib`. Run,
from the root directory of the repository:

For updating the local mirror, run
```bash
pandoc --template respec.template -f markdown-auto_identifiers --wrap=none index.md -o index.html
python3 expand_tags.py index.html index.html
```

$> bash -e ./sync-gdrive.sh
`expand_tags.py` expands the shorthand tags in the specification into RDFa and draws the diagram of each example
(as a [Mermaid](https://mermaid.js.org/) flowchart) from its Turtle file.

See notes in `sync-gdrive.sh` for how to configure the `rclone` command.
## Extracting the Ontology

To facilitate searchability, `sync-gdrive.sh` will also produce a text export of the GDrive minutes under `minutes_txt/`.
The ontology is encoded in RDFa within the specification. To extract it to `morph.ttl` you also need
[`rapper`](https://librdf.org/raptor/rapper.html) (from `raptor2-utils`). After building `index.html` as above, run:

```bash
rapper -i rdfa index.html -o turtle | python3 build_ontology.py morph
```

Please regenerate and commit `morph.ttl` whenever a change to `index.md` affects the ontology.

## Examples

The listings in `index.md` are the source of the examples. Each example is written in an
`<aside class="example" src="examples/example_N.ttl">` block, and the files in `examples/` are generated from these
listings with:

```bash
python3 scripts/extract_examples.py
```

The GitHub action runs `python3 scripts/extract_examples.py --check` and fails if any file is out of date, so run the
script and commit the result whenever you change an example. To preview the diagram of a single example, run
`python3 scripts/convert_to_mermaid.py examples/example_N.ttl`.

## Google Drive Mirror

Some older material of the group is on Google Drive (see the
[wiki](https://www.w3.org/community/ontolex/wiki/Morphology) for the link) and is only mirrored here, in `minutes/`
and `data/gdrive/`. To update the mirror, run

```bash
bash -e ./sync-gdrive.sh
```

See the notes in `sync-gdrive.sh` for how to configure `rclone`. The script also writes a text export of the minutes
to `minutes_txt/` to make them searchable.

## Contributing

We welcome contributions to the Morphology Module. If you find issues, have suggestions, or want to contribute new
examples, please open an issue or a pull request in this repository. Changes to the specification should follow the
OntoLex style guide.

More information on the module and the work of the group is on the
[wiki](https://www.w3.org/community/ontolex/wiki/Morphology).
Loading