diff --git a/README.md b/README.md index b39ac21..785f4c2 100644 --- a/README.md +++ b/README.md @@ -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 +`