Convert Wikipedia infoboxes into Adaptive Cards.
Adaptive Cards are platform-agnostic UI elements described in JSON that can be rendered and presented in a wide variety of environments such as websites, mobile apps, digital assistants, and messaging platforms. They represent an opportunity for creating and reusing high-level UI templates compatible with popular ontologies and schemas, such as Schema.org. Unfortunately, very few templates have been created and shared by the community since the project's inception in 2016.
SourceWikipedia infoboxes are tables of data typically presented on the right of Wikipedia articles that describe and summarize their subject. Wikipedia's list of infobox templates includes over 1,450 distinct infobox templates, covering a wide range of subjects. These templates were carefully crafted and iterated over for decades by a large community of domain experts to capture the unique presentation characteristics of their domains. This effort is unlikely to be replicated, and it seems unwise not to leverage such an ontological goldmine.
SourceThe box2card project is an experiment and a proof-of-concept that attemps to find whether the effort invested by the Wikipedia community into infobox templates can be leveraged to fill the gap in Adaptive Card's community templates.
-
Can infobox templates be partially or completely converted into adaptive card templates?
-
Can infobox schemas be mapped to external ones such as Schema.org without losing formatting information?
-
Can infobox designs fit into or be adapted for non-encyclopedic use cases such as digital assistants and messaging platforms?
-
Can infobox categories naturally be extended to include non-encyclopedic ones such as GitHub issues, restaurant reservations, business cards, product reviews, and social media posts?
To answer question 1 (feasibility of infobox template extraction), I implemented a Python script which, given an entity (Wikipedia article):
-
Extracts the data of its infobox (JSON).
-
Converts (best effort) the template of its infobox as an adaptive card template (JSON).
This pair of data and template JSON payloads can then be rendered using the Adaptive Cards Designer to analyze the effectiveness of the approach.
Preliminary results regarding question 1 were obtained by testing the tool against 12 distinct entities belonging to different categories:
-
Amazon (company)
-
Changi Airport (airport)
-
Eiffel Tower (landmark/building)
-
F.C. United of Manchester (sports team)
-
Guitar (musical instrument)
-
Homer Simpson (fictional character)
-
Museum of Modern Art (place)
-
Squid Game (TV series)
-
Steve Jobs (person)
-
Terminator 2 (movie)
-
Tesla Model 3 (car)
-
The Dark Side of the Moon (music album)
The rendered adaptive cards can be seen below:
Open in Adaptive Cards Designer (select Preview mode)
Open in Adaptive Cards Designer (select Preview mode)
Open in Adaptive Cards Designer (select Preview mode)
Open in Adaptive Cards Designer (select Preview mode)
Open in Adaptive Cards Designer (select Preview mode)
Open in Adaptive Cards Designer (select Preview mode)
Open in Adaptive Cards Designer (select Preview mode)
Open in Adaptive Cards Designer (select Preview mode)
Open in Adaptive Cards Designer (select Preview mode)
Open in Adaptive Cards Designer (select Preview mode)
Open in Adaptive Cards Designer (select Preview mode)
Open in Adaptive Cards Designer (select Preview mode)
While these preliminary results are not perfect (many elements are missing, some wikidata templates are not supported, line breaks are inconsistent, lists are not ideally rendered), they show the potential of the approach and indicate that extracting infobox templates is at least partially feasible.