Skip to content

Bring the specification in line with the OntoLex style guide - #87

Merged
jmccrae merged 2 commits into
masterfrom
style-guide
Nov 26, 2026
Merged

jmccrae merged 2 commits into
masterfrom
style-guide

Conversation

@jmccrae

@jmccrae jmccrae commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Applies the OntoLex style guide (STYLE.md, ontolex/ontolex#120) to the Morphology module.

Examples: the listings in index.md are the source

  • scripts/extract_examples.py (the same script as Listings in index.md as the source of the examples; example captions ontolex#121) replaces the old extractor. It writes each listing to the file named in its src (no longer numbered by position), with only the prefixes the listing uses, taken from the Namespaces section. --check fails if a file is out of date, a listing does not parse or a .ttl file is unused. scripts/extract_examples.sh is removed.
  • @prefix : <http://www.example.com/#> is now in the Namespaces listing rather than only in the text.
  • All 23 files are regenerated. Their graphs are unchanged; the old files had the full shared header with no newline before the first statement.

Captions

  • The "Example:" prefix is removed (ReSpec already shows "Example N:", so captions read "Example 1: Example: …"). Markdown asterisks (which show literally in a caption) are replaced by quotes, and the caption mentioning morph:DerivationRule is reworded.

References to the core: data-cite

  • localBiblio now has a single ontolex entry for the published OntoLex-Lemon report (https://www.w3.org/2016/05/ontolex/), instead of three entries pointing to the stale 2015 draft at ontolex.github.io/ontolex/specification.html. vartrans#… and decomp#… citations use ontolex#…, and the anchors that did not exist there are fixed (CanonicalForm → canonicalForm, MorphologicalPattern → morphologicalPattern). The vartrans and decomp modules are named in italics, without links.
  • The vartrans properties source and target were written [=source=]/[=target=], which ReSpec could not resolve; they are now data-cite links. Together with the module references this fixes the four ReSpec errors; the page now has no errors or warnings.
  • The References section links to the published report.

Wording

  • rdfs:subClassOf, consistsOf, rdf:Seq, morph:sourceRegex/targetRegex in the prose are replaced by term links or linked natural wording. Example resources referred to in the text are written as code, as in the listing (:adam, :sg_rule). Regex syntax and rdf:_1/rdf:_2 stay as code.

LexInfo

Labels

  • English rdfs:labels are in Title Case with lang="en", and the two <dataProperty> label tags are now <datatypeProperty>. In the extracted ontology, only the case of 13 labels and the comment of Word Formation Relation change.

morph.ttl is not regenerated in this PR (see below).

🤖 Generated with Claude Code

- Example files are generated from the listings in index.md by
  scripts/extract_examples.py (named by src, prefixes from the Namespaces
  section); CI checks that they are up to date and runs on pull requests.
- Captions without the redundant "Example:" prefix, and without Markdown or
  CURIEs in them.
- References to the core use data-cite with a single "ontolex" localBiblio
  entry for the published OntoLex-Lemon report, with anchors that exist there.
- Prose: code-style and CURIE references replaced by term links and natural
  wording; example words in italics.
- LexInfo: accusative -> accusativeCase; stem types that LexInfo does not
  define move to the example namespace.
- English labels in Title Case with lang="en".

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Comment thread index.md Outdated
</aside>

In order to generate forms of the entry `:adam`, all the rules associated with the corresponding morphological pattern must first be extracted, namely `sg_rule`, `pl_rule`, and `acc_rule`. Next, we must establish the order of inflection slots mentioned in the rules (by looking for the slot that is not used as an object in a [=next=] property).
In order to generate forms of the entry *adam*, all the rules associated with the corresponding morphological pattern must first be extracted, namely *sg_rule*, *pl_rule*, and *acc_rule*. Next, we must establish the order of inflection slots mentioned in the rules (by looking for the slot that is not used as an object in a [=next=] property).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually fit the style guide?

Comment thread index.md Outdated

<div class="note">
In the two examples above, a Morph instance (`:i`) was not defined in the original data and was generated by the generation implementation.
In the two examples above, a [=morph=] (*i*) was not defined in the original data and was generated by the generation implementation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should still be :i as referencing code in the example

Comment thread index.md Outdated
The values of a base type are URLs that can be further specified in a local
ontology and some examples values are provided by [LexInfo](https://github.com/ontolex/lexinfo).
The values of a base type are IRIs that can be further specified in a local
ontology. In the examples below they are defined in the example namespace.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should probably not be made as we are expecting ontolex/lexinfo#48

Comment thread index.md Outdated
To be able to not only encode this descriptive information but also possibly further specify it by expressing additional details, in OntoLex-Morph, word formation relations are reified in a dedicated class, [=word formation rule=].
Since word formation relations are relations between different lexical entries, this class is defined as a subclass of the class introduced in the <a data-cite="vartrans">vartrans</a> module of OntoLex for such relations -- namely, <a data-cite="vartrans#LexicalRelation">lexical relation</a>.
As a consequence, vartrans properties are also used to link lexical entries to the relations holding between them: specifically, each word formation relation is linked through [=source=] to its base(s) and through [=target=] to the derivative.
Since word formation relations are relations between different lexical entries, this class is defined as a subclass of the class introduced in the <a data-cite="ontolex#variation-translation-vartrans">variation and translation</a> module of OntoLex for such relations -- namely, <a data-cite="ontolex#LexicalRelation">lexical relation</a>.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be vartrans (no link) according to the style guide

Comment thread index.md Outdated
The same kind of modelling can be applied to compounds -- i.e., lexemes that are morphologically related to two or more bases; e.g. English *wallpaper*.

It should be noted that there is another OntoLex module that was envisaged to be usable also for compounding, namely <a data-cite="decomp">decomp</a>, devised for the decomposition of complex lexical entries (like Multi-Word Expressions) in their parts. However, in OntoLex-<a data-cite="decomp">decomp</a>, the relationship between complex lexical entries and their parts is not reified, as there is no dedicated class, differently than what happens in OntoLex-morph for word formation relations.
It should be noted that there is another OntoLex module that was envisaged to be usable also for compounding, namely the <a data-cite="ontolex#decomposition-decomp">decomposition</a> module, devised for the decomposition of complex lexical entries (like Multi-Word Expressions) in their parts. However, in the decomposition module, the relationship between complex lexical entries and their parts is not reified, as there is no dedicated class, differently than what happens in OntoLex-morph for word formation relations.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, check style guide for referencing module

Comment thread index.md Outdated
It should be noted that there is another OntoLex module that was envisaged to be usable also for compounding, namely the <a data-cite="ontolex#decomposition-decomp">decomposition</a> module, devised for the decomposition of complex lexical entries (like Multi-Word Expressions) in their parts. However, in the decomposition module, the relationship between complex lexical entries and their parts is not reified, as there is no dedicated class, differently than what happens in OntoLex-morph for word formation relations.

As a consequence, to allow for a parallel treatment of different word formation processes (derivation and compounding), a subclass of [=Word Formation Relation=] is introduced for compounding -- namely, [=Compound Relation=]. This can be considered as a reification of the property <a data-cite="decomp#subterm">sub term</a> introduced in the <a data-cite="decomp">decomp</a> module of OntoLex, which can be used to decompose lexical entries into other lexical entries: hence, the existence of a compound relation entails that the source lexical entry is a subterm of the compound.
As a consequence, to allow for a parallel treatment of different word formation processes (derivation and compounding), a subclass of [=Word Formation Relation=] is introduced for compounding -- namely, [=Compound Relation=]. This can be considered as a reification of the property <a data-cite="ontolex#subterm">sub term</a> introduced in the <a data-cite="ontolex#decomposition-decomp">decomposition</a> module of OntoLex, which can be used to decompose lexical entries into other lexical entries: hence, the existence of a compound relation entails that the source lexical entry is a subterm of the compound.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subterm is one word

Comment thread index.md Outdated
:scribo_form a ontolex:Form ;
ontolex:writtenRep "scribo"@la ;
morph:baseType lexinfo:presentStem .
morph:baseType :presentStem .

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, these will be added to LexInfo

…y were, name modules in italics; fix the example check

- Example resources referred to in the text stay as code (:i, :adam, :sg_rule).
- The LexInfo stem values are kept (they are being added in ontolex/lexinfo#48).
- Modules are named *vartrans* and *decomp* in italics, without links.
- "subterm" as one word.
- Regenerate the example files changed since the last extraction (this was the
  CI failure), and let extract_examples.py exit 0 after writing files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant