Summary: bot – output – updates
During a visit to the Colosseum with a friend, we stopped to observe a reproduction of the Tabula Peutingeriana exhibited in the exhibition that was organized on the first floor of the Amphitheater. We therefore enjoyed looking for all the places linked to our respective experiences, until the ancient name escaped us; conversely, we couldn’t remember today’s correspondence from another.
Recalling other similar experiences, I began to think of a Telegram bot that would allow a quick search for an ancient toponym. Thus was born the “Ancient Atlas bot“, which can be activated by writing the name of the bot in the Telegram chat (@Ancient_Atlas_bot), or by opening this page: t.me/Ancient_Atlas_bot. The start instructions (“/ start”) and the commands present (which can be activated by typing “/”) will guide you in using Ancient Atlas.
Bot
The bot was an excellent opportunity to study APIs, data repositories, mapping, programming and … WordPress. I was already familiar with the Trismegistos project for the collaboration with the monumental EDR database, but I opted for another solution: Pleiades. It is a fantastic repository of historical geographic information made available to scholars, students and enthusiasts from all over the world; the data, released under the CC-by 3.0 license, can be freely used and shared, as long as the attribution is indicated. A dump of all data is made available at regular intervals, available both in .json and .csv: the first contains the entire database structure, the second, divided into three files, only specific information (names, locations , places). In addition, an API service is available, which allows you to query the database in real time. An example is the underlying counter (created using PHP snippets with JSON structure reading programming), which calls the status API: at the present time, the Pleiades database counts
Since the Pleiades API allows you to read a value only once the association with its toponym is known, it is not possible to use them for a search based only on the latter (unlike the WikiData API, which we will see later). The first step was therefore to use the dump of the names, to quickly obtain the relative unique code of Pleiades. The bot allows you to find multiple matches for the searched toponym, after which it reports the relative chronological arc, the possibility of opening a card with more information, the relative card on Pleiades or any entry on Wikipedia, the display on OpenStreetMap or Google Maps cartography.
Output
In order not to burden too much on Telegram (which is still a messaging software), I have implemented some functions through a special web link; with a view to experimentation, I wanted to create a WordPress page that was able to transpose the identifier passed by the bot and proceed with the processing of the related information. To do this, a special supervariable, $ _GET, is provided in PHP, which cannot be used in WordPress due to interception by the system framework; to overcome this problem, it is necessary to intervene directly in the CMS core, and determine the new type of marker:
function add_query_vars_filter($vars){
$vars[] = marcatore;
return $vars;
}
add_filter('query_vars', 'add_query_vars_filter');
Thanks to this expedient, it is possible to process the identifier passed by the bot and extrapolate additional information via API in .json format, directly from the database, therefore updated in real time. In particular, the connectsWith property allows you to examine the relationships of the object and allow further exploration of the searched toponym. The same function used to read the JSON structure of the main site was used recursively to determine the additional toponyms or connected elements.
Using Leaflet, the coordinates – exploded in latitude and longitude with a specific function – were used for a cartographic display with a marker, so as to facilitate the identification of the site; a popup shows the description that is also found in the card itself. All the coordinates, on the other hand, have been extrapolated to populate a cartography loaded quickly in QGIS, with labels and differentiation of the symbologies based on chronology (only for Italy: the selection took place through intersection with .shp of the provinces, so as to locate each toponym at a more restricted territorial level).
The Pleiades identifier is one of the properties stored in another project, WikiData. This platform provides centralized access to structured data management to Wikimedia projects including Wikipedia, Wikivoyage, Wikisource and others. A query system using SPARQL allows you to build complex queries, capable of searching for an element within all database entries. Through a first query in which the Pleiades property (P1584) is searched, the correspondence with the relative WikiData entry is found; a second query, with return in JSON, allows you to extrapolate all the properties and elements of the searched site, allowing you to expand the range of information that the bot – and its web counterpart – are able to provide, such as Wikipedia entry, site official, images uploaded to Commons.
Updates
Work in progress:
- Link to gallery on Wikimedia Commons
- Connection to (historical/archaeological/…) sources repositories
- Connect to other data repositories