CONTEXT: adding structured metadata to articles is a complex issue. This feature is intended to provide a **minimal** capability that keeps control in the hands of editors and enables strong typing on links between articles.
USER STORY: As an editor using VE to write an article about a well structured type of entity, such as a person, company, chemical, or event, I want to be able to mark key attributes and relations in the body text with metadata that allows the wiki system to apply strong typing to both the string and the form of the attribute or relation connecting the subject of the article as expressed in the title to that string. For example, when writing an article about a French person, I would like to be able to highlight the word "French" and hyperlink it to the article on the French people and simultaneously mark it as the **nationality** of the person. This would allow the wiki system to populate the nationality field in a summary about the person, and also enables search for people with that nationality.
SIMPLIFICATION: the concept of strong typing can go haywire. This kind of feature could easily get super complicated with typing appearing on the current article, and the string being linked, and the thing it is linked to, and implied graph edge between this article and that article, etc. So! we should keep this as simple as possible. The proposal is to impose typing **only on the edge**, which articulates the way in which the subject of the present page (whatever it is) relates to the subject of the linked page (whatever that is).
INHERITANCE: This approach leads to the use of a fundamental "is instance of" relation for typing, also known as [[ https://en.wikipedia.org/wiki/Is-a | "isA" relations ]]. This naturally leads to inheritance of types. For example, when writing an article about an NFL football coach, they can add a hyperlink to an article on NF Coaches with an "is instance of" type on the link, and that article can have an "is instance of" link to an article on Coaches, which itself has an "is instance of" link to Person, which itself has an "is instance of" link to Animal. Through this chain, the present article on a particular coach will inherit the type Person and Animal. The NFL Coaches article might also have an "is instance of" link to an article on National Football League Staff, or alternatively a link to an article on the NFL with a link type of "is staff member of".
COMPARISON: Wikipedia attempts to solve a related problem by putting pages into categories. Instead of associating an article about a football coach with an article on Person, wikipedia puts articles into Categories, such as Living People. While the subject of heated debate, I believe at least some community consensus has come around to the opinion that using categories in this way is inferior to putting types on links to articles.
TYPES: The labels applied to links are described by records of some kind in the wiki. This is a crucial implementation issue, and the focus of the implementation discussion below.
As further examples, when writing an article about a _____________, I would like to be able to highlight a ________ that I just typed or pasted into the article to create a hyperlink and mark that hyperlink as a _____________ type of relation.
NB: in this type, the first two columns are merely descriptions to provide context in this discussion; they are not strong types applied out of thin air :-)
| **Article Context** | **Highlighted String** | **Typed Relationship** | Note: **only** the relationship is labeled with a strong type
| cyber attack | IP address | command and control node used in the attack |
| cyber attack | IP address | victim of the attack |
| cyber attack | IP address | machine used in a botnot |
| cyber attack | Cyber Incident | is instance of | Note: see inheritance discussion above |
| company | address | branch office |
| company | address | head quarters |
| person | email address | used by |
| person | Person | is instance of | Note: see inheritance discussion above |
| person | Foot Ball Coach | is instance of | Note: see inheritance discussion above |
| person | other person | wrote book with |
| person | other person | organized an easter egg hunt on the East Lawn with |
DIVERSITY: The list of relation types is as diverse as Wikipedia itself, so I would like to be able to pick from existing link types and also be able to enter new values when needed.
RED LINK PROBLEMS: If I create a link to an article that does not exist, then I risk having some create that article with something different than I intended. This proposal does not address that issue. If I use a link type that does not yet exist, then I am taking the same risk. It is up to the editor to populate the new articles to which they link, and also to populate the new link types that they assert when linking.
UNTYPE LINKS: the default link type should be "undefined" or None or NULL because that is the case today. This is not just for backwards compatibility. Editors should not be required to assert a link type.
SINGLE ASSERTION: each link has exactly one type. It can be modified by subsequent editors.
IMPLEMENTATION: This functionality could be relevant to TemplateData, WikiData, and Semantic MediaWiki. Exactly which to use and how is part of the technical task requested by this ticket. The desired end result is a modified hyperlinking dialog that enables this functionality.
LOOKAHEAD: The visual dialog that helps users apply a type to a link should provide lookahead suggestions as they use their keyboard to enter the name of the type. At least initially, the lookahead functionality should be simple and not worry about the complexity or hierarchy of possible types. A full "browser" of possible types can be a subsequent ticket, possibly related to [[ https://phabricator.wikimedia.org/T94296 | T94296 ]].