Link Types: easy addition of structured metadata added to hyperlinking dialog in VE
Open, Stalled, LowestPublic

Description

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 "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 ContextHighlighted StringTyped RelationshipNote: only the relationship is labeled with a strong type
cyber attackIP addresscommand and control node used in the attack
cyber attackIP addressvictim of the attack
cyber attackIP addressmachine used in a botnot
cyber attackCyber Incidentis instance ofNote: see inheritance discussion above
companyaddressbranch office
companyaddresshead quarters
personemail addressused by
personPersonis instance ofNote: see inheritance discussion above
personFoot Ball Coachis instance ofNote: see inheritance discussion above
personother personwrote book with
personother personorganized 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 T94296.

Jrf created this task.Mar 28 2015, 8:54 AM
Jrf updated the task description. (Show Details)
Jrf raised the priority of this task from to Needs Triage.
Jrf assigned this task to tosfos.
Jrf added a project: VisualEditor.
Jrf added a subscriber: Jrf.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 28 2015, 8:54 AM
Jrf updated the task description. (Show Details)Mar 28 2015, 9:28 AM
Jrf set Security to None.

This seems like this would be better done through Wikidata. There are some other tasks around for editing Wikidata through VisualEditor (so that it's an integrated experience) – not sure what you're looking for here, however.

@Jrf, I'm marking this stalled since it's not clear how you envision this integrating with Wikidata. If you need to learn more about Wikidata, I'd check out its introduction page or ask questions at its projects chat page. I'm not an expert on Wikidata, but let me know if there's anything I can help you with!

Neil_P._Quinn_WMF changed the task status from Open to Stalled.May 14 2015, 9:48 PM
Neil_P._Quinn_WMF triaged this task as Lowest priority.
Jrf reassigned this task from tosfos to Nischayn22.May 19 2015, 3:34 AM
Jrf added a comment.May 19 2015, 3:40 AM

Thanks to Nischay's efforts, we have a mostly working dialog box for adding properties to links --- the user story works very well. This will be available in a public git repo as soon as Nischay pushes it. It has one bug and one missing feature. We hope to get guidance from the VE dev team on these two issues:

  1. (bug) the default VE mouseover popup on a link now shows incorrect info: it shows a link to a page with title = "my_prop_name::MyTitle" and instead it should link to a page with title="MyTitle". The link mouseover popup would ideally also show a link toProperty:my_prop_name.
  1. (enhancement) the link icon in the main toolbar and control-K keystroke would ideally be replaced by the new LinkTyping dialog.

Changes are being put in the following repository https://github.com/nischayn22/VeSMW

Jrf added a comment.May 21 2015, 2:26 PM

I made a video of the one remaining issue with making this work well:
https://www.youtube.com/watch?v=MvBjtqNap0g&feature=youtu.be

The larger issue of taking over the Link creation dialog is a separate goal/task/issue.