Introduction

In recent years, with the rapid development of information technology, computing technology has extensively promoted the inheritance and protection of culture. At the same time, with the deepening of digitization and the internet, a large amount of cultural data has accumulated. However, due to the large number of types and scattered sources of cultural network resources, the traditional method of catalog retrieval is inefficient, making it impossible for users to obtain more accurate and structured information. At the same time, relatively professional and in-depth knowledge in the cultural field is still based on academic monographs and publications, and most network media resources are superficial and lack systematic information. Therefore, to solve these problems, the effective use of these cultural data to construct high-level and intelligent cultural products has become an important challenge for mining and reusing knowledge from traditional cultural resources [1]. Due to its advantages in knowledge system construction and expression, knowledge graphs have become the optimal solution for the construction and application of resources for cultural research, providing new ideas and methods for exploring the application of digital cultural technology.

Cultural computing was introduced to the human—computer interaction model after the social computing paradigm [2]. It is defined as the application of computing and related technologies to the cultural field to explore the conditions of development, reveal internal connections, or visually analyze and display culture [3]. These technical advances are crucial for artistic research, resource mining, preservation of inheritance, and promotion. As Li [4] said, data art is a new form of contemporary technological trends. Webization and digitization are the inevitable trends of the current era, and data-driven cultural analysis is also a trending research field. The literature [2] that studies social survey data frequently presents the argument that the current generation of cultural computing will mainly occur through the medium of HCI (human—computer interaction), which is technically embodied as the digitization and practical preservation of cultural information in the form of a knowledge base. Then, it spreads effectively through various methods and tools, leaving a rich user experience. The domain knowledge graph has undoubtedly become the best option for resource description because of its data structure and technical framework.

Beijing’s ancient capital culture is very representative of Chinese culture. Studying it can provide a good idea of the whole field of Chinese culture [5]. Our project “Excavation and Utilization of Cultural Resources in the Ancient Capital of Beijing” was proposed in this context. By collecting and sorting out a large number of documents, we have constructed an exclusive knowledge map of the cultural field of Beijing’s ancient capital and developed a series of upper-level applications based on this database, including a Web platform, data analysis and visualization display, and a simple question answering system.

Two main problems were discovered in our investigation and research:

  • 1. The application of knowledge graphs in the field of research into Beijing’s ancient capital culture is lacking. For a long time, experts and scholars in the humanities have produced fruitful research results on Beijing’s ancient capital culture. Zhang [5] summarized the essence of Beijing’s ancient capital culture from the perspectives of architecture, etiquette, music, and geography. However, although these results are excellent, they all focus on the humanistic perspective. To date, there is no comprehensive database covering the culture of the ancient capital of Beijing, nor has it integrated information technology research. It is very helpful to apply information technology to research in the field of culture. Regrettably, there has been no research into the digital knowledge graph of the cultural field of Beijing’s ancient capital thus far.

  • 2. There is a lack of a complete structure for studying knowledge graphs in the cultural field. Because the two areas, knowledge graphs and culture, are very different, combining them is more complicated. There are many types of research in the field of Chinese culture that use knowledge maps, such as Chinese national culture [6,7,8], Chinese art [9], and Chinese history [10]. Knowledge graphs have excellent application prospects in the study of Chinese culture due to their comprehensive coverage and structured data. However, the above work is focused on knowledge graph technology in specific fields, such as entity recognition, relationship extraction, straightforward answers, and visualization.

Similarly, there are many excellent jobs around the world. The literature [11,12,13] reveals efforts to establish a model of ontology and base of knowledge to study the British Museum, Indian textile crafts, and ancient Egyptian culture. Literature [13, 14] contains studies of ontological research on drama and fine arts culture. There are also studies on the ontology of the cultural field [15] and knowledge architecture [16]. However, these studies focus on modeling cultural ontology and the retrieval of knowledge bases.

Summarizing the above work, in the field of Chinese culture, there are many excellent cases of the application of knowledge graphs, but a complete methodology has not yet been formed.

In response to the above two issues, the contributions of this article are as follows:

  • According to the survey conducted when the project was established, this is the first time the theories and methods of domain knowledge graphs have been applied to the culture of Beijing’s ancient capital. A cultural knowledge map of Beijing’s ancient capital was established, and an upper-level application was developed.

  • We propose a set of frameworks for Chinese cultural research combined with a knowledge graph and use the field of Beijing’s ancient capital culture as an example to verify the framework’s effectiveness.

The structure of this article is as follows:

  • The first part is an introduction. Our questions are raised.

  • The second part introduces the research framework of our proposed knowledge map in the cultural field. It uses the ancient cultural knowledge of the Beijing capital to form a map to verify the framework’s validity.

  • The third part reveals the results of a user test of the content that we conducted with the resulting map.

The research framework of the knowledge graph in the cultural field

We propose a research framework for Beijing’s ancient capital culture combined with a knowledge graph based on the above analysis. The block diagram is shown in Fig. 1.

Fig. 1
figure 1

Ancient capital culture in Beijing as a research framework combined with a knowledge graph

According to the definition of cultural computing [3], we believe that the process of applying the knowledge graph in the cultural field should be as follows: For cultural content (content), data collection is performed (data), the technology (technique) of the knowledge map is used at each stage to provide services for different types of users (users), and finally the purpose of enhancing cultural influence is achieved (influence). Inspired by the theory of CPSS (Social Information Physics System) [17], we believe that this process for constructing knowledge graphs in the cultural field has every attribute in CPSS and is complete:

  • Social attributes: the content and user population in the cultural field.

  • Information attributes: the technology of the knowledge map, the electronic version of the data, and the developed upper-level application.

  • Physical attributes: nonelectronic version of the data and the equipment used for the application.

Content layer

The content layer is composed of the content of the cultural field as the research object. Studies [18] have argued that the content of culture is vibrant, including history, writing, language, architecture, food, tools, skills, technology, knowledge, customs, art, etc.

In the cultural field of Beijing’s ancient capital, we used a process starting with the central line and moving sequentially through content expansion, and thematic division to obtain the structure of cultural content, as shown in Fig. 2.

Fig. 2
figure 2

The research process of the cultural content structure of the ancient capital of Beijing

Steps for extracting the main line

The extraction of the main line is carried out in the order of document text extraction, Delphi survey method, text word segmentation, high-frequency word type summary, and sampled document verification. This sequence of methodologies is shown in Fig. 3.

Fig. 3
figure 3

Research process to extract the cultural main line

With the collection of CiteSpace tools, we conducted many relevant literature analyses and processed high-value articles for word segmentation. After statistical analysis, three main lines were determined: “Manchu and Han culture,” “Old Beijing culture,” and “Beijing architecture.”

Main line content expansion

The content of Beijing’s ancient capital culture is vibrant. After establishing the three main lines, we used multiple perspectives, including an overall view and narrowed focuses, to expand the cultural genes in the main lines. On the one hand, select representative nodes are derived from them and develop over time, extending the network through time and revealing an overall expression; on the other hand, starting from the three main lines, representative cultural content is selected for highlight (focus). In the end, through the interweaving of the content in the three main lines, we clustered several aspects with many mutual relationships and strong connections as branch elements that can reflect the genes of typical Beijing culture. The expanded representation of the idea is shown in Fig. 4 below.

Fig. 4
figure 4

Main line expansion clusters

Topics of the three main lines

After expanding the content from the three main lines, the structure of this content needs to be established. After classification by experts, the content division was ultimately determined to be the three main lines:

  • 1. The main line “Manchu-Han Culture” consists of three parts: history, festival etiquette, and utensils. The three parts are all developed around the background of the integration of Manchu and Han culture. Taking material and spiritual aspects as the starting point, it describes the influence of the fusion of Manchu and Han cultures on Beijing’s cultural history, festivals, and the use and design of artifacts. Ethnic integration is a natural and lengthy process involving the mutual influence of two cultures, finally generating a concept of pluralistic unity of the Chinese nation.

  • 2. “Old” in the main line “Old Beijing” distinguishes itself from the broader concept of Beijing literature. “Old” expresses a kind of higher literary value and aesthetic requirement, mandating that the object have a recognizable taste beyond simply language and image. The main line of this culture is composed of six parts: Peking opera, literature, Beijing dialect, hutongs, celebrities, and time-honored brands.

  • 3. The main line “Beijing Architecture” presents the spatial characteristics of old Beijing with the development of architecture. Since Beijing was made the capital in the Yuan Dynasty, this city has always been the center of supreme power and represents the entire country of China. Its architectural style is no exception. This part is composed of the “Three Mountains and Five Gardens” and “Central Axis,” expressing the geography of Beijing. At the same time, representative buildings and architectural elements complement this part in its entirety.

The determination of the topic also provides a direction for us to collect the data of the knowledge graph. The main line components are shown in Table 1.

Table 1 Main line content

Affected layer

The digitization of culture conforms to modern mainstream developments in today’s world. Access to digital cultural knowledge can significantly improve the efficiency of cultural communication, reduce the requirements for cultural learning, and play a good role in enhancing cultural influence and cultural cohesion.

User layer

After our user test, users in the cultural field can be divided into three groups with different attributes: expert researchers, active enthusiasts, and potential users. The specific user test content is introduced in the fourth part.

  • 1. Expert researchers. Expert researchers are professionals in the cultural field. They conduct research on cultural content, explore cultural evolution and underlying laws and are also responsible for protecting and restoring material and intangible culture.

  • 2. Active enthusiasts. This part of the user group consists of fans of cultural content. They are not engaged in professional work but have a high demand for cultural content and experience.

  • 3. Potential users. This part comprises potential users. They account for the most significant role and are also the target groups for cultural dissemination.

Data layer

The data layer consists of two types of databases, relational databases and graph databases. Relational databases are used to store the original data in this article (unstructured and semistructured text) and the results of social surveys. As the volume of data and links increases, it is difficult for relational databases to efficiently complete complex relational operations. The graph database can make better use of the links between the data and has a higher retrieval efficiency. After extracting a large number of knowledge graph triples, the graph database is used to store these triples.

Taking Peking Opera knowledge extraction as an example, the the knowledge map in the field of Peking Opera in this paper is constructed with offline and online data sources.

  • (1) Knowledge extraction of offline data and structured online data.

    Offline data mainly come from the book “Dictionary of Peking Opera Knowledge.” This is a very comprehensive Peking Opera encyclopedia with wide coverage: business, music, vocal tunes, rhyme, chanting, outfits, makeup, facial makeup, training, basic skills, performance procedures, troupe disciplines, troupe rules and customs, performance venues, genres, history, terminology, works, characters, repertoire, and other entries. In this part, data was mainly manually collated for collection and knowledge extraction. After evaluation, a small amount of manual work is done to obtain RDF triple data for the existing Peking Opera-related database and Excel table data.

  • (2) Knowledge extraction from semistructured data.

    The initial data acquisition is carried out through web crawlers for online encyclopedias and thematic websites. The data sources are mainly websites such as “Beijing Opera Art Network,” “Beijing Opera Drama Test Network,” and Baidu Encyclopedia.

  • (3) Knowledge extraction from unstructured data.

    For unstructured data sources such as web texts and e-books, information extraction technology needs to be used for knowledge extraction. This paper uses the HanLP natural language processing tool for entity and relationship extraction. HanLP is a natural language processing toolkit built with the largest and most diverse corpus in the world. It provides many natural language processing functions, such as multilingual word segmentation, part-of-speech tagging, named entity recognition, keyword extraction, automatic summarization, phrase extraction, and dependency syntax analysis. Based on dependency syntactic analysis, entity relations in the text can be extracted.

Dependency parsing can be used to analyze the sentence structure or the dependent relationship of words in the sentence, such as subject–predicate, verb–object, core–comment, etc. With the sentence “Jiangsu Provincial Peking Opera Troupe was established in 1953” as an example, HanLP is used for dependency parsing, resulting in < Jiangsu Peking Opera Troupe (subject-predicate) was established >  < founded (verb) in >  < 1953 (object) > . Converting the analysis results into triples, we can obtain the structured knowledge representation of “Jiangsu Peking Opera Troupe—Founded—1953”.

Based on the graph model [19], the graph database is a type of NoSQL database that can store, access and manipulate graphable data. It fits well with the data structure of the knowledge graph. The graph model is a very important concept in the graph database. The graph model consists of two key elements: nodes and edges. Each node represents an entity, usually referring to the name of a person, place, or thing, or other conceptual data, and each edge represents the way in which two nodes are related, which indicates a relationship. The data are organized by the graph model so that the graph database can show higher performance when dealing with relational data.

Neo4j is an open-source graph database that is also widely used for data storage of knowledge graphs. Neo4j has the following characteristics [20]:

  • 1. Following the graph model, the graph query mode is more efficient, and the unique graph query language Cypher can be used to speed up queries.

  • 2. It supports complete ACID transaction.

  • 3. It provides REST API, which can be accessed by multiple programming languages.

  • 4. It supports massive data, such as billions of nodes, relationship or attribute level data.

  • 5: It is highly available as a distributed cluster.

This article will also use the Neo4j graph database for supporting storage. With the help of its intuitive expression and high query efficiency, the user experience of the web system is improved. The data collection process in this article is shown in Fig. 5 below.

Fig. 5
figure 5

Data collection process

Neo4j provides a manual data import function for loading CSV files, but this method is inconvenient for large-scale, multitable data processing. This article uses the neo4j-import tool natively provided by Neo4j to automatically import data and create indices for entity nodes to improve data retrieval efficiency.

After importing the data, this paper's cultural field knowledge map contains 17,921 entities and 114,565 triples. The specific data are shown in Table 2.

Table 2 Scale of the knowledge graph

Technical layer

The architecture contains technical support for researching knowledge graphs in the cultural field. It contains three main parts: map construction, content mining, and map application. Graph construction technology mainly includes crawling, information extraction, knowledge fusion, and ontology construction [21]. However, in this article, because of the lack of a marking dataset in the cultural field of the ancient capital of Beijing, the automated construction of knowledge extraction and knowledge fusion is not adopted. All data come from crawlers, manual cleaning, and simple NLP (natural language processing) tools. The technology used in content mining mainly includes retrieval systems, visual analysis, data storage, and web development. Graph application: The mainstream applications are recommendation systems and question answering systems [22].

Crawler

The crawler tool is based on a browser automation program written by Selenium. First, Selenium is used to send a control signal to the browser and pass in the Xpath of the corresponding data according to the returned web page structure to obtain the data. Then, regularization expressions are used to extract noise-free data.

Construction of ontology

Ontology is the earliest concept in philosophy. In philosophy, ontology is defined as “the abstract nature of objective reality.” When this definition is transferred to the computer domain, ontology is the upper conceptual model that describes the environment, industry, or subject knowledge. In Studer’s report [23], ontology includes four requirements: sharing, conceptualization, clarity, and formalization. Sharing refers to the need for consensus on ontological knowledge, and conceptualization refers to the upper-level conceptual role of ontology; clarity refers to the fact that the ontological description cannot be vague and general while formalization refers to the fact that ontology can be read and processed by a computer.

With the deepening of research on ontology, it is generally believed that ontology contains five basic units: class (concept), relationship, function, hypothesis, and instance. The class is the abstract or upper-level expression of a specific type of thing in the field, such as characters, representative achievements, etc. Relations are used to describe the relationship between classes (concepts), such as the relationship between the whole and the part, the relationship between the parent class and the subclass, etc.; function is used to express the constraints or reasoning behind the relationship, such as transitivity and symmetry. Axioms or hypotheses represent ontological facts. An instance is an instantiation of the existence of a particular class.

Culture can be understood as human society’s spiritual activities and products relative to the economy and politics. Philosophy, religion, art, science, etc., all belong to the category of culture in a broad sense. At the same time, politics, economy, and culture interact. For the broad and narrow definitions of cultural concepts, there has never been a unified standard in either China or the West. Different scholars, disciplines, and genres will give different answers.

According to the incomplete statistics of today’s scholars, there are almost 260 definitions of Chinese culture thus far. For many purposes, this article attempts to describe culture from the perspective of the unity of opposites in the broad and narrow sense.

Culture broadly refers to the sum of human life, including spiritual, material, social, and other comprehensive aspects. Culture can be divided into four layers based on morphology.

  • (1) Material culture: the sum of activities in human material production and their products, such as architectural art, food, clothing, etc.

  • (2) System culture: various social norms and systems, such as the family, governance administration, economic system, political and legal system, and imperial examination system.

  • (3) Behavioral culture: etiquette, folk customs, customs, etc., established in interpersonal relationships. Examples include traditional festivals such as the Spring Festival, Lantern Festival, and Mid-Autumn Festival, as well as patterned behaviors corresponding to festivals such as pasting couplets during the Spring Festival, eating moon cakes during the Mid-Autumn Festival, and making zongzi for the Dragon Boat Festival;

  • (4) Mental culture: this area refers to values, aesthetics, way of thinking, and psychological activities, etc.

In a narrow sense, culture mainly focuses on spiritual activities, including consciousness, concepts, mentality, and customs.

Although there are various definitions of culture, it is difficult to give a standard definition. However, by combining and analyzing multiple meanings, it can be found that “human beings engage in activities of material or spiritual creation” is shared content in all kinds of definitions. It can be further proposed that the core of culture is people, that the two elements of culture are human beings and human activities, that and various cultural forms have their concrete or abstract representative results. At the same time, the process of cultural evolution and creation is often inextricably linked with time and geographical factors.

This paper extracts the concepts of character, achievement, geography, and time to form the core concept set of the cultural field. It builds a general model of ontology in the cultural area (Fig. 6). This model mainly focuses on the accurate description of domain knowledge. The person concept refers to persons directly related to artistic achievements or all-natural persons associated with the cultural field. The idea of results refers to various material or nonmaterial results produced in the cultural area. Geographical concepts refer to corresponding regions and locations in cultural evolution. The concept of time refers to related dynasties and eras in cultural change.

Fig. 6
figure 6

A general conceptual model of ontology in the cultural field

With Peking Opera as an example, data collection and related literature research provide further analysis and definition of the core concepts of Peking Opera, the division of concept levels, and the definition of object attributes and data attributes.

  • (1) Character concept analysis

    Peking Opera characters refer to Peking Opera actors, Peking Opera-related family figures, Peking Opera-related practitioners, etc. In terms of object attributes, there are teacher–student relationships, kinship relationships, and fellowship relationships among Peking Opera characters. In terms of data attributes, in addition to basic attributes such as age and native place, Peking Opera characters also have professional attributes such as genre, profession, and class.

  • (2) Concept analysis of results

    The achievements of the Peking Opera are multidimensional, including singing, reading, acting, fighting, specialized gestures with the hands, eyes, and body, special forms of stepping, methods and other expressive techniques and skills. There are also costume props with specific intentions, such as facial makeup and outfits, as well as many sequences with clear themes and profound connotations. A sequence includes attributes such as theme, script, main content, expression technique, name, and role. The character itself also includes attributes such as props, outfits, and facial makeup.

  • (3) Geographic concept analysis

    In the ontology constructed in this paper, geographical concepts mainly refer to theater buildings, theater gardens and former residences. During the Qianlong period, the four major Anhui troupes entered Beijing sequentially. The performances of the Hui troupes were exchanged and integrated with the techniques of Kunqu Opera, Qin Opera, and local folk tunes and eventually developed into Peking Opera. These Anhui troupes who came to Beijing mainly lived in the most prosperous area, Dashilanr, at that time, where they trained, rehearsed and performed. Therefore, there are also many famous opera gardens and teahouses in the Dashilanr area.

    Expressing the geographical concept of the Peking Opera with theater buildings, theater gardens and former residences, this area of the city inherited the history of the origin of Peking Opera and connects the evolution, rise and fall of Peking Opera, and the transmission of repertoire, performance schools and character interpretations.

  • (4) Time concept analysis

    This paper uses the year, the developmental stage of Peking Opera and the era as the concept of time in the field of Peking Opera. The year is the specific year expressed in AD. The developmental stages of Peking Opera are mainly based on the historical divisions in the authoritative book “History of Peking Opera in China”. The development of Peking Opera can be summarized into the following five processes: the gestation and formation period (approximately 1790–1840), the gradual maturity (approximately 1840–1917), the heyday (approximately 1918–1937), the turbulence and ups and downs (approximately 1938–1948) and the rebirth and twists and turns of Peking Opera (approximately 1949–1990). The era refers to when the stories described in the Peking Opera repertoire took place. In this paper, through the analysis of plays corresponding to elements of Peking Opera repertoire in the data, the eras are divided into Shang, Zhou, Qin, Western Chu, Han, Three Kingdoms, Jin, Southern and Northern Dynasties, Sui, Tang, Song, Yuan, Ming, Qing, etc.

Web and visualization

In the layout of the entire website, we have drawn a historical scroll at the top, as shown in Fig. 7. According to the change of dynasties in ancient China, important historical events in Beijing were displayed horizontally. The middle also contains the design of the illustration and the description of the event. At the same time, the scroll can also be converted from a two-dimensional perspective to a three-dimensional view, as shown in Fig. 8. The screening function is based on the content of different events, such as the change in dynasties and the changes in cities.

Fig. 7
figure 7

The long scroll 2D perspective at the top of the website

Fig. 8
figure 8

The long scroll 3D perspective at the top of the website

The following layout shows the content of the three main lines introduced in the previous section and the related topics, as shown in Fig. 9.

Fig. 9
figure 9

The three main lines of the website and the corresponding topics

In the subtopics, we elaborated on the ancient capital culture of Beijing in this field in three ways: introduction, a complete map of the topic, and a relationship diagram.

The following is an example of the topic of “Beijing Time-honored Brands.”

First, we will initially show the characteristics of this topic in the form of a long scroll. To explain the “time-honored” aspect, we offer a schematic diagram of each time-honored element, as shown in Fig. 10. This method allowed users to clearly understand the cultural content expressed in each topic and have textual introductions for supplementary explanations.

Fig. 10
figure 10

The introduction of Beijing time-honored brands

Second, in the thematic full-map section, we use a three-dimensional diagram of nodes and edges to show the elements and relationships between them. When the user selects a specific node, we move the camera inward to bring the chosen node to the center of the view and display the detailed node information, as shown in Fig. 11.

Fig. 11
figure 11

Thematic full map of Beijing time-honored brands

Finally, in the diagram of topic relationships, we selected appropriate data visualization to assist in expressing the different characteristics of different topics. We use tree diagrams, as shown in Fig. 12, and Sankey charts, as shown in Fig. 13, to describe the data, showing the association between Beijing celebrities and time-honored brands. The advantage of visualization is that it can more intuitively show the relationship between data and assist cultural research.

Fig. 12
figure 12

Thematic relationship tree diagram

Fig. 13
figure 13

Sankey Diagram of Thematic Relations

The other topics are combined with the characteristics of their respective issues. They are also displayed from the three directions of topic introduction, full case map, and relationship map to show the audience a more comprehensive Beijing ancient capital culture as much as possible. Readers of other topics can log onto our website to visit. (http://39.105.99.126:5050/).

Question answering system

Intelligent question answering is one of the typical applications of knowledge graphs. Knowledge graph question answering (KBQA) can use the structured data of knowledge graphs to analyze and understand user questions, submit queries and examine reasons in the knowledge base and then return accurate answers to the user. At present, many intelligent question answering platforms or intelligent robot assistants have used knowledge graph technology, such as Microsoft Xiaobing and Apple Siri.

There are two leading solutions for intelligent answering based on knowledge graphs. One is to use semantic analysis, combined with rules or template matching, to analyze user questions according to a fixed structure or process and to map and express them in the database’s query language. Then, the answer is obtained directly from the knowledge graph database. The advantage of the semantic parsing method is its high accuracy. Nevertheless, the disadvantage is that it requires considerable labor to write templates and rules and maintain them, which also leads to the weak scalability of such methods. The other is an end-to-end method based on deep learning, which uses deep neural networks to represent natural language texts as semantic vectors. The realization of this method is to express the user question and the triples in the knowledge graph as vectors and then calculate the semantic similarity between the vectors and match the correct answers according to the ranking of the similarities. The deep learning method transforms the QA task into a classification or sorting task. Its advantage is that it reduces the labor cost and does not require much effort to maintain rules and templates. The disadvantage is that the interpretability of the model is not strong, the support of large-scale corpus data is required, and the application in the field may be poor. In addition, the literature [24, 25] also includes a simple question answering and multihop question answering system framework based on knowledge graph embedding, but the author has patented the method.

Considering that we are focusing on the particular field of Beijing's ancient capital culture, the highest requirement for the QA system is accuracy, and the need for scalability is not high. Therefore, our project's intelligent question-answering reference [26] is mainly based on rules and template matching. The flow of the QA system model in this article is shown in Fig. 14 below.

Fig. 14
figure 14

Flow chart of the question-and-answer algorithm

The real flow for the question answering algorithm is entity recognition, question template matching, and answer retrieval.

Dictionary-based entity recognition

The question-and-answer system in this article uses all the entities in the cultural knowledge map of the ancient capital of Beijing to construct an entity dictionary, containing entries such as “Forbidden City” and “Lu Xun.” When performing entity recognition, the word segmentation tool uses a specific dictionary for word segmentation, and the question input in natural language from the user is segmented and tagged for part of speech. Entity recognition in the question is completed through the word segmentation tool and dictionary. We give an example, as shown in Fig. 15.

Fig. 15
figure 15

Word segmentation and entity recognition

Rule-based question template matching

For simple questions with relatively standardized question forms, template matching is an efficient method [26]. After completing the recognition of entities and relationships in the question, the query sentence can be generated by directly matching the question template.

The relationship in the knowledge graph is the desired goal to be obtained from this step. There may be more than one way to ask questions for the same intention. We designed different question templates expressing the same intention in Chinese, using the intention as a label, and trained a machine learning classification model to an accuracy of 0.95. Its function is to match the most similar question template with the input question after entity recognition and output the intent label. Part of the training data format is shown in Table 3.

Table 3 Question template (partial)

Answer search

Answer retrieval combines the entity obtained in entity recognition with the intent obtained in question template matching and calls the Cypher sentence to access the Neo4j database. Each intent category corresponds to a Cypher sentence constructed manually in advance. For example, for the intent of “ask for the work by the author,” the corresponding sentence is “MATCH (n: nm) RETURN n,” and nm is the identified entity.

Voice interaction

To enable users to interact through voice, the voice-to-text method is used. With the help of iFLYTEK’s “Voice-to-Text” service, users’ questions are converted into text.

After obtaining the text, the algorithm returns a result through the question-and-answer system we designed. This result is identified from the database. After receiving the result returned by the query, the return code is used to determine whether the returned result is correct. The results obtained are synthesized into speech through Baidu’s speech synthesis interface. Baidu speech synthesis is based on leading deep learning technology, providing highly anthropomorphic, smooth, and natural speech synthesis services.

Users can use voice input to ask questions. The system searches for the results in the existing library and gives answers, which are communicated to the customer by voice. In addition, accompanied by an animated figure on one side, facial expressions can be activated together with the voice to achieve virtual services for answering questions. Users can obtain a more natural and authentic interactive experience by communicating with representations of ancient people from hundreds of years ago.

We also designed multiple historical images, including Genghis Khan, Mencius, and Du Fu. Through the parameter design used by speech synthesis, the voices of different virtual characters are chosen when they are suitable for the historical character involved. For example, Genghis Khan’s voice is deeper and more magnetic, and his speech rate is slower, with the characteristics of an emperor’s calm and authoritative personality. Mencius’s voice sounds high-pitched and bright, and his speaking speed is also faster to show his bold personality. Du Fu’s tone is resonant and powerful to show his severe and profound character and form a somber image. Through the differences in the voice parameters, the user seems to have a conversation with a natural and emotional ancient person who has realistic feelings. The interface is shown in Fig. 16.

Fig. 16
figure 16

QA virtual image

Above, we have introduced the research framework we proposed and provided a reference to help study the combination of the cultural field and the knowledge graph.

User testing

User evaluation

The user evaluation in this article was based on several evaluation tasks. This article invited users to participate in the experiment. It paid attention to the user’s subjective satisfaction, task duration, and accuracy rate and comprehensively analyzed these indicators to determine the system’s effectiveness.

We contacted 20 volunteers interested in and related to the cultural field and invited them to participate in user evaluation. These participants had no experience in the preparation of any part of this project. Additional file 1: Appendix A lists their identities and backgrounds. Information was sent to the participants before the review, explaining the purpose and method of the meeting, and the project link was provided so that the interviewee could choose to examine the relevant background and the form of the website in advance. Additional file 1: Appendix B provides a detailed list of tasks that participants had to complete during the meeting, which were mainly divided into two: actively accepting knowledge and passively accepting knowledge. After the test, they recorded their answers and participated in user interviews. In the end, the interviewees provided additional relevant comments, which are recorded in detail in Additional file 1: Appendix C.

Each interview lasted approximately 2 h. In the first half-hour, the researcher briefly described the content of the project and the objectives of the interview. Later, other members explained how to browse the cultural map, use the question answering system, examine the retrieval module, and explore the data visualization module through a PowerPoint presentation. In the following hour, participants performed the 11 tasks in Additional file 1: Appendix B. Finally, the participants completed the general questions individually in the interview and discussed as a group common suggestions and feedback for improving the system.

Task design

Because this project is a platform for the cultural display of Beijing’s ancient capital, the effect of acquiring cultural knowledge depends on the logic of the system design. The methods for knowledge output are mainly divided into two categories. One is for users to actively acquire knowledge, and the other is to passively accept the content on the platform. From this, the forum’s usability and ease of use are evaluated.

In the first part, users actively search for answers. The correct answer rate of task 1 reached a gratifying 100%, and 95% of those who chose to explore and formulate questions rated the experience as “very easy” and “easy”. This is a better experience for users who are not very familiar with the system or who are using it for the first time. When the complexity of the search increases and more than two queries are needed, although relatively good answers can be obtained, the proportion of people who think that the search is “very easy” and “easy” dropped to 80% after the second question and 75% after three questions. Some users raised specific questions about the question-and-answer system. If the user does not fully remember the result of the first answer, subsequent questions will be affected. We explained that it might be more convenient to seek answers in the form of a chat that used multiple rounds of questions and answers. Some users questioned the usefulness of the virtual image, thinking that each character simply changed voice and appearance, and they could not feel the unique language habits of different characters. This point may need to be improved. Due to the limitations of the webpage, it is still difficult for the character's expressions to match the language perfectly, which is caused by a current technical bottleneck. As the task continued, we found that the participants gradually became familiar with the task completion method, so although the difficulty of task four did not decrease, the percentage of users who obtained entirely correct answers still increased to 80%, which is very gratifying.

The title of the second part is where users passively acquire knowledge. Users needed to search for relevant knowledge from relevant pages. In the beginning, the percentage of users who agreed that the task was “quite easy” dropped significantly. Most users chose “easy” or “general” because this question required thinking and participation to obtain relevant answers. In Task 5, some users gave feedback that they “hoped that the geographic information would be richer.” As some users were not familiar with the topography of Beijing, they found some queries difficult to answer by forming related questions. However, in subsequent tasks 6, 8, 9, and in the middle, users can only roughly observe the relevant data because the characters were too small to read; users could not quickly and accurately locate the knowledge they want to know. Here some search methods may need to be added to avoid this situation. However, only 50% of the seven tasks could be completed correctly, which exposes some problems, such as the imperfection of relevant information, and obstructions preventing users from easily obtaining news. In the last task, the difficulty was rated “easy” by 12 users,” “general” by four users, and “difficult” by three users.

Discussion and conclusion

In this article, we solved two main problems. First, it filled the research gap in the creation of knowledge maps for the cultural field of Beijing as an ancient capital. Second, a complete framework for applying and researching knowledge graphs in the cultural area was proposed.

With the rapid development of information technology, the combination of cultural fields and computing technology has become a trend. In this respect, the attempt to use the culture of the ancient capital of Beijing plays a representative role in the study of Chinese culture. Based on the definition of cultural computing and the CPSS theory, we designed the main components of the entire program. In the user section, the survey results categorized users according to their degree of research in the cultural field. For the content, we collected all kinds of materials in the cultural field related to the ancient capital of Beijing for sorting to ensure the authenticity and reliability of the content source. In terms of data and technology, we fully covered and explained the technology and directions for using the application with knowledge graphs. In the impact section, we listed the benefits of cultural computing, and positive feedback was evident from the user test results as well.

We hope our research can help research in the intersection of the cultural field and technology.