Data storage and query method and knowledge base system based on resource semantic association
By establishing the association between resource data and knowledge graphs in the knowledge base, users can query relevant resource data and definition information through keywords, solving the problem of only querying the data itself in the existing knowledge base, and improving learning efficiency.
Patent Information
- Application Number
- CN202111679799.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-12-31
AI Technical Summary
When reviewing materials, the existing knowledge base can only query the data itself, and cannot view more content related to the data, which affects the user's learning efficiency.
By obtaining the information of the knowledge graph and storing it in the keyword table of the database, and associating the keywords of the resource data with the knowledge graph to establish a knowledge list, users can obtain relevant resource data and definition information by selecting keywords.
It enables users to quickly query knowledge context and key content during the learning process, meets users' personalized and convenient needs, and improves learning efficiency.
Smart Images

Figure CN114328972B_ABST
Abstract
Description
Technical Field
[0001] This application relates to data management technologies, and in particular, to a data storage and query method and a knowledge base system based on resource semantic association. Background Art
[0002] Data processing includes data acquisition, storage, retrieval, processing, etc. Its basic purpose is to extract and derive valuable and meaningful data for certain specific people from a large amount of data that may be chaotic and difficult to understand. Knowledge related to course learning, technical analysis, and business familiarity also belongs to data. Integrating and sharing this type of data can quickly provide effective resources for organizations such as enterprises and universities, and improve learning efficiency.
[0003] Currently, existing knowledge bases can divide the data they store into different categories according to types, fields, or departments, etc., so that users can view according to the divided categories. Or, some knowledge bases provide a retrieval function, which is more convenient for users to view.
[0004] However, when existing knowledge base users consult materials, they can only query the data itself and cannot view more content related to the data, which brings inconvenience to users' consultation and affects users' learning efficiency. Summary of the Invention
[0005] This application provides a data storage and query method and a knowledge base system based on resource semantic association to solve the problem that when existing knowledge base users consult materials, they can only query the data itself and cannot view more content related to the data.
[0006] In a first aspect, this application provides a data storage and query method based on resource semantic association, including:
[0007] Obtain a knowledge graph, and store the information of the knowledge graph into the keyword table of the database. The information of the knowledge graph includes the ID of the knowledge graph, the keywords of the knowledge graph, and the definition information of the keywords of the knowledge graph;
[0008] Obtain resource data, extract the keywords of the resource data, and store the keywords of the resource data into the resource table of the database;
[0009] When all the keywords of the resource data stored in the resource table match the keywords in the keyword table successfully, write the ID of the resource data into the keyword table;
[0010] According to the keyword table, associate the ID of the resource data, the ID of the knowledge graph with each keyword in the resource table;
[0011] Obtain the knowledge list of each keyword in the resource table, add the resource data to the corresponding knowledge list, and store the knowledge list in the graph database. The knowledge list includes the definition information of the keyword in the resource table and the resource data;
[0012] Obtain the target keyword selected by the user through the knowledge graph, and obtain and display the target knowledge list corresponding to the target keyword.
[0013] Optionally, the obtaining the knowledge list of each keyword in the resource table and adding the resource data to the corresponding knowledge list includes:
[0014] When there is no knowledge list for the first keyword in the resource table, generate the knowledge list corresponding to the first keyword. The knowledge list corresponding to the first keyword includes the definition information of the first keyword and the resource data;
[0015] When there is a knowledge list for the first keyword, add the resource data to the knowledge list corresponding to the first keyword.
[0016] Optionally, before obtaining the resource data, it further includes:
[0017] When there is a null value in the definition information of the keyword in the keyword table, use web crawler technology to extract the target definition information of the keyword with a null definition information;
[0018] Store the target definition information in the keyword table.
[0019] Optionally, after all the keywords of the resource data match successfully with the keywords in the keyword list, it further includes:
[0020] Perform text parsing on the knowledge graph to obtain data in HyperText Markup Language (HTML) format;
[0021] Highlight the keywords in the resource table in the HTML format data so that the keywords in the resource table are highlighted on the knowledge graph display interface.
[0022] Optionally, the performing text parsing on the knowledge graph to obtain data in HTML format includes:
[0023] Use the jQuery plugin to convert the knowledge graph into data in HTML format.
[0024] Optionally, the associating the ID of the resource data, the ID of the knowledge graph, and the keywords in the resource table includes:
[0025] Form an associated triple with the ID of the resource data, the ID of the knowledge graph, and the keywords of the resource table.
[0026] In a second aspect, the present application provides a knowledge base system, including:
[0027] A first processing module, configured to obtain a knowledge graph and store the information of the knowledge graph in a keyword table of a database, where the information of the knowledge graph includes the ID of the knowledge graph, the keywords of the knowledge graph, and the definition information of the keywords of the knowledge graph;
[0028] A second processing module, configured to obtain resource data, extract the keywords of the resource data, and store the keywords of the resource data in a resource table of the database;
[0029] A writing module, configured to write the ID of the resource data into the keyword table when all the keywords of the resource data match the keywords in the keyword table successfully;
[0030] An association module, configured to associate the ID of the resource data, the ID of the knowledge graph with each keyword in the resource table according to the keyword table;
[0031] A third processing module, configured to obtain the knowledge list of each keyword in the resource table, add the resource data to the corresponding knowledge list, and store the knowledge list in a graph database, where the knowledge list includes the definition information of the keywords of the resource table and the resource data;
[0032] An obtaining module, configured to obtain the target keyword selected by the user through the knowledge graph, and obtain and display the target knowledge list corresponding to the target keyword.
[0033] Optionally, the third processing module is specifically configured to:
[0034] When the first keyword in the resource table does not have a knowledge list, generate a knowledge list corresponding to the first keyword, where the knowledge list corresponding to the first keyword includes the definition information of the first keyword and the resource data;
[0035] When the first keyword has a knowledge list, add the resource data to the knowledge list corresponding to the first keyword.
[0036] In a third aspect, the present application provides a knowledge base system, including: a processor and a memory communicatively connected to the processor;
[0037] The memory stores computer-executable instructions;
[0038] The processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect.
[0039] In a fourth aspect, the present application provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method described in the first aspect when executed by a processor.
[0040] In a fifth aspect, the present application provides a computer program product including a computer program, which implements the method described in the first aspect when executed by a processor.
[0041] A data storage and query method and a knowledge base system based on resource semantic association provided by the present application. The knowledge base system stores the information of the obtained knowledge graph into the keyword table of the database, and then extracts keywords from the obtained resource data and stores the keywords into the resource table of the database. When all the keywords of the resource data match the keywords in the keyword table successfully, the knowledge base system writes the ID of the resource data into the keyword table, then associates the ID of the resource data, the ID of the knowledge graph with each keyword in the resource table, and finally adds the resource data to the knowledge list corresponding to its keyword. The relevance between each resource data and the keyword enables the user to select a target keyword through the knowledge graph, and the knowledge base system can obtain and display the corresponding target knowledge list according to the keyword. The user can quickly query the knowledge context and key content during the learning process, meeting the user's personalized and convenient needs and improving the user's learning efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application and used together with the specification to explain the principles of the present application.
[0043] Figure 1 It is a schematic structural diagram of a knowledge base system applicable to the present application;
[0044] Figure 2 It is a schematic flowchart of a data storage and query method based on resource semantic association provided in Embodiment 1 of the present application;
[0045] Figure 3 It is a schematic structural diagram of a knowledge base system provided in Embodiment 2 of the present application;
[0046] Figure 4 It is a schematic structural diagram of a knowledge base system provided in Embodiment 3 of the present application.
[0047] Through the above-mentioned drawings, specific embodiments of the present application have been shown, and will be described in more detail hereinafter. These drawings and the textual description are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed Description of the Embodiments
[0048] Here, the exemplary embodiments will be described in detail, and examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0049] Currently, existing knowledge bases can divide the data they store into different categories according to types, fields, or departments, etc., so that users can view according to the divided categories. Or, some knowledge bases provide a retrieval function, which is more convenient for users to view. However, even if the knowledge is classified or a retrieval function is provided, due to the lack of semantic association of resources, when users of existing knowledge bases view materials, they can only query the data itself and cannot view more content related to the data, which brings inconvenience to users' viewing and affects users' learning efficiency.
[0050] Therefore, the present application provides a method for data storage and query and a knowledge base system based on resource semantic association. By associating a knowledge graph, keywords, and resource data, when a user views the knowledge base, selecting the corresponding keyword in the knowledge graph can query the resource data related to the keyword, enabling the user to quickly query the knowledge context and key content during the learning process, meeting the personalized and convenient needs of users, and improving the learning efficiency of users.
[0051] Next, the terms involved in the present application will be explained:
[0052] Knowledge graph: It refers to a knowledge outline formed by the knowledge base administrator before storing resource data, and this knowledge graph can be represented in the form of a PPT.
[0053] Knowledge graph: A knowledge graph is a semantic representation that can model entities, concepts, attributes, and the relationships between them in the real world, forming a huge semantic network graph. Nodes represent entities or concepts, and edges are composed of attributes or relationships. The knowledge graph is stored in a graph database.
[0054] Graph Database: A graph database is a type of database that belongs to the non-relational database category. It stores and analyzes the association relationships between entities in the real world: abstracts entities as vertices and the association relationships between entities as edges. Through the graph structure formed by vertices and edges, it intuitively and naturally expresses the world of all things' associations, and at the same time solves the performance problem of deep retrieval of complex association relationships. Currently popular graph databases include Neo4j, OrientDB, and ArangoDB, etc.
[0055] The following uses specific embodiments to elaborate in detail on the technical solutions of this application and how the technical solutions of this application solve the above technical problems. These several specific embodiments can exist independently or be combined with each other. For the same or similar concepts or processes, they may not be repeated in some embodiments. The following will describe the embodiments of this application with reference to the accompanying drawings.
[0056] Figure 1 It is a schematic structural diagram of a knowledge base system applicable to this application. As Figure 1 shown, the knowledge base system 101 includes a user module, a knowledge graph module, a keyword module, a resource library module, a directory module, and a knowledge graph module. Among them, the user module is used to record the users who register the knowledge base system 101. These users are divided into ordinary users and administrators. The permissions of administrators are higher than those of ordinary users, and they can manage resource data, user information, etc. in the knowledge base system. The knowledge graph module is used for administrators to upload knowledge graphs into the system to build knowledge graph models. The keyword module is used to represent the key knowledge in the knowledge graph, and administrators can add it in the form of a table. The resource library module is used for administrators to upload various types of resources, such as text, video, pictures, and exercise information, etc. The exercise information can be provided to users for practice or exams when learning. The directory module is used to divide all resources and keywords in the system into different categories of resource data according to types, fields, or departments, etc. The knowledge graph module is used to establish a knowledge graph based on the information of the knowledge graph module, the keyword module, and the resource library module to display the information related to keywords, and provide relevant resources to users through the ways of graph query and keyword search mapping.
[0057] The knowledge base system 101 can be a knowledge platform for managing internal materials and learning used within organizations such as enterprises or schools.
[0058] Refer to Figure 2 , Figure 2 It is a schematic flowchart of a data storage and query method based on resource semantic association provided in the first embodiment of this application. This method can be executed by the knowledge base system, and this method includes the following steps.
[0059] S201. Obtain a knowledge graph and store the information of the knowledge graph in the keyword table of the database.
[0060] The knowledge base system can obtain the knowledge graph uploaded by the administrator. The knowledge graph can be uploaded in the form of a PPT and can be pre-made by the administrator based on the existing resource data. The administrator can download an upload template in the knowledge base system, which can be in the form of Excel. Then the administrator fills in the information of the knowledge graph in the template and imports the filled template into the knowledge base system. The knowledge base system can obtain the information of the knowledge graph and store it in the keyword table of the database. The information of the knowledge graph includes the ID of the knowledge graph, the keywords of the knowledge graph, and the definition information of the keywords of the knowledge graph. A knowledge graph corresponds to a unique ID. The keywords of the knowledge graph can be one or more, and the definition information of the keyword is the corresponding explanatory meaning of the keyword. It should be noted that the definition information of the keywords of the knowledge graph can be a null value, that is, the administrator can not fill in this definition information.
[0061] After the knowledge base system stores the information of the knowledge graph in the keyword table of the database, when there is a null value in the keyword definition in the keyword table, the crawler technology can be used to extract the target definition information of the keyword with a null value in the definition information. The specific extraction process is as follows:
[0062] The knowledge base system sends a request to the server where the corresponding URL of the target web page is located through the browser. The request includes the keyword to be queried. The server where the target URL is located returns a request response to the knowledge base system according to the received request. The request response includes the page content of the target web page to be obtained. This web page content can be in types such as HTML format, Json string, or binary data.
[0063] Exemplarily, the web content of the target web page is in HTML format. The knowledge base system can use regular expressions or web parsing libraries to parse this format to obtain a Document Object Model (DOM). This model can represent the above HTML-formatted web content as a tree structure with tag contents as nodes, and find the content to be extracted through the paths between the nodes. That is, in the DOM tree, the content to be extracted is 1 sub-node, corresponding to a path from the root node to this node, which is the retrieval path of the extraction content. For example, the retrieval path corresponding to the extraction of the keyword definition is / html / body / div class="body-wrapper" / div class="content" / div class="main-content" / div class="lemma-summary" / div class="para". The definition of the keyword can be extracted layer by layer. That is, the definition of the keyword can be obtained at the layer of / div class="para". The knowledge base system writes the extraction result into the keyword definition information item in the keyword table in the database to supplement the keyword definition information item of the keyword in the keyword table.
[0064] S202. Obtain resource data, extract keywords of the resource data, and store the keywords of the resource data in the resource table of the database.
[0065] After the knowledge base system stores the information of the knowledge graph in the keyword table, it can obtain resource data, which is text data and / or non-text data. Non-text data is data such as videos and pictures. After the knowledge base system obtains the resource data, it can extract the keywords of the resource data. The specific extraction is as follows:
[0066] For text data, first, the knowledge base system uses a third-party Python library to convert the text data file into a txt type, and then inputs the converted type into the TextRank extraction tool to extract keywords from the text data.
[0067] For non-text data, the knowledge base system adds an attribute of introduction to this part of the data, adopts a strategy of manual annotation to complete the filling of the introduction, and then the knowledge base system extracts the information of the introduction field as the keyword of the resource data.
[0068] After the knowledge base system extracts the keywords of the resource data, it stores the keywords in the resource table in the database.
[0069] S203. Associate the resource data with the knowledge graph according to the keywords of the knowledge graph and the keywords of the resource data.
[0070] After the knowledge base system stores the keywords of the resource data in the resource table in the database, in order to enable users to query relevant resource data according to the keywords when querying the resource data, the knowledge base system can associate the resource data with the knowledge graph according to the keywords of the knowledge graph and the keywords of the resource data. Specifically, it can be implemented in the following ways:
[0071] The knowledge base system matches the keywords of the resource data stored in the resource table with the keywords in the keyword table. When each keyword of the resource data stored in the resource table matches successfully with the keywords in the keyword table, the ID of the resource data is written in the keyword table. Then, according to this keyword table, the ID of the resource data, the ID of the knowledge graph, and each keyword in the resource table are associated. This association can be in the form of an associated triple formed by the ID of the resource data, the ID of the knowledge graph, and the keyword of the resource table, so that users can query the resource data related to the keyword through the keyword.
[0072] Optionally, after each keyword of the resource data matches successfully with the keywords in the keyword table, the knowledge base system performs text parsing on the knowledge graph to obtain data in the form of HyperText Markup Language (HTML), and then highlights the keywords in the resource table in this HTML-formatted data, so that the keywords in the resource table are highlighted on the knowledge graph display interface. The highlighted keywords are used for users to quickly locate the target keywords when viewing the knowledge graph.
[0073] S204. Obtain the knowledge list of each keyword in the resource table, add the resource data to the corresponding knowledge list, and store the knowledge list in the graph database.
[0074] After associating the ID of the resource data, the ID of the knowledge graph, and each keyword in the resource table, the knowledge base system can obtain the knowledge list of each keyword in the resource table, add the resource data to the corresponding knowledge list. The knowledge list includes the definition information of the keyword in the resource table and the resource data. The specific process of adding the resource data is as follows:
[0075] When the first keyword in the resource table does not exist in the knowledge list, the knowledge base system generates a knowledge list corresponding to the first keyword, and then adds the resource data to this knowledge list. The knowledge list corresponding to the first keyword includes the definition information of the first keyword and the resource data.
[0076] When the first keyword exists in the knowledge list, the knowledge base system adds the resource data to the knowledge list corresponding to the first keyword. At this time, it can be understood that there are at least two resource data in this knowledge list.
[0077] Then the knowledge base system stores the knowledge list in the graph database, such as Neo4j.
[0078] The above steps S201 to S204 can be understood as the process of building a knowledge graph model, that is, forming a semantic network diagram with keywords, knowledge graphs, and resource data. By building a knowledge graph model, keywords are linked to knowledge lists, enabling users to obtain the definition information of the keyword and its corresponding resource data through the keyword. One keyword corresponds to one knowledge list, and this knowledge list includes at least two resource data. It can be understood that this keyword can also be a keyword in multiple knowledge graphs.
[0079] S205. Obtain the target keyword selected by the user through the knowledge graph, and obtain and display the target knowledge list corresponding to the target keyword.
[0080] After the knowledge graph model is established, the user can select the target keyword to be queried in the knowledge graph displayed on the access interface of the knowledge base system. After the knowledge base system obtains this target keyword, it can obtain the target knowledge list corresponding to this keyword according to the keyword, and then display the obtained target knowledge list for the user. The user can consult the definition information of the keyword corresponding to the target keyword to be queried by the user and the corresponding resource data in this knowledge list, meeting the personalized and convenient needs of the user.
[0081] Alternatively, the user can enter a keyword in the search bar provided on the access interface, directly consult the knowledge graph where the keyword is located, and then the user can select the target keyword in the knowledge graph to query relevant resource data.
[0082] When there is exercise information uploaded by the administrator in the resource data of the knowledge base system, the user can also select the corresponding keyword in the knowledge graph, so as to obtain the exercise information related to this keyword. The user can use these exercise information for practice or exams, and can consolidate the knowledge learned while studying, improving the learning efficiency.
[0083] In this embodiment, the knowledge base system stores the information of the obtained knowledge graph in the keyword table of the database, and then extracts keywords from the obtained resource data and stores the keywords in the resource table of the database. When all the keywords of the resource data match the keywords in the keyword table successfully, the knowledge base system writes the ID of the resource data into the keyword table, then associates the ID of the resource data, the ID of the knowledge graph with each keyword in the resource table, and finally adds the resource data to the knowledge list corresponding to its keyword. The relevance of each resource data to the keyword enables the user to select the target keyword through the knowledge graph, and the knowledge base system can obtain and display the corresponding target knowledge list according to this keyword. The user can quickly query the knowledge context and key content during the learning process, meeting the personalized and convenient needs of the user and improving the user's learning efficiency.
[0084] ReferenceFigure 3 , Figure 3 This is a schematic structural diagram of a knowledge base system provided in the second embodiment of the present application. As Figure 3 shown, the system 30 includes: a first processing module 301, a second processing module 302, a writing module 303, an association module 304, a third processing module 305, and an acquisition module 306.
[0085] The first processing module 301 is used to obtain a knowledge graph and store the information of the knowledge graph in the keyword table of the database. The information of the knowledge graph includes the ID of the knowledge graph, the keywords of the knowledge graph, and the definition information of the keywords of the knowledge graph.
[0086] The second processing module 302 is used to obtain resource data, extract the keywords of the resource data, and store the keywords of the resource data in the resource table of the database.
[0087] The writing module 303 is used to write the ID of the resource data into the keyword table when all the keywords of the resource data stored in the resource table match the keywords in the keyword table.
[0088] The association module 304 is used to associate the ID of the resource data, the ID of the knowledge graph with each keyword in the resource table according to the keyword table.
[0089] The third processing module 305 is used to obtain the knowledge list of each keyword in the resource table, add the resource data to the corresponding knowledge list, and store the knowledge list in the graph database. The knowledge list includes the definition information of the keyword of the resource table and the resource data.
[0090] The acquisition module 306 is used to obtain the target keyword selected by the user through the knowledge graph, and obtain and display the target knowledge list corresponding to the target keyword.
[0091] Optionally, the third processing module 305 is specifically used for:
[0092] When the first keyword in the resource table does not have a knowledge list, generate a knowledge list corresponding to the first keyword. The knowledge list corresponding to the first keyword includes the definition information of the first keyword and the resource data.
[0093] When the first keyword has a knowledge list, add the resource data to the knowledge list corresponding to the first keyword.
[0094] Optionally, the association module 304 is specifically used for:
[0095] Form an associated triple form of the ID of the resource data, the ID of the knowledge graph, and the keyword of the resource table.
[0096] Optionally, before obtaining the resource data, it further includes:
[0097] When the definition information of a keyword in the keyword table has a null value, web crawler technology is used to extract the target definition information of the keyword with a null definition information.
[0098] Store the target definition information in the keyword table.
[0099] Optionally, after all keywords in the resource data match the keywords in the keyword list, it further includes:
[0100] Perform text parsing on the knowledge graph to obtain data in HyperText Markup Language (HTML) format.
[0101] Highlight the keywords in the resource table in the HTML format data so that the keywords in the resource table are highlighted on the knowledge graph display interface.
[0102] Optionally, performing text parsing on the knowledge graph to obtain data in HTML format includes:
[0103] Use a jQuery plugin to convert the knowledge graph into data in HTML format.
[0104] The system of this embodiment can be used to execute the data storage and query method based on resource semantic association in Embodiment 1. The specific implementation manner and technical effect are similar and will not be elaborated here.
[0105] Reference Figure 4 , Figure 4 FIG. is a schematic structural diagram of a knowledge base system provided in Embodiment 3 of the present application. The knowledge base system 40 includes: a processor 401, a memory 402, and a transceiver 403. The processor 401 executes computer execution instructions stored in the memory 402 and controls the receiving and sending actions of the transceiver 403, so that at least one processor executes the steps of the data storage and query method based on resource semantic association in Embodiment 1. The specific implementation manner and technical effect are similar and will not be elaborated here.
[0106] Embodiment 4 of the present application provides a computer-readable storage medium. Computer execution instructions are stored in the computer-readable storage medium. When the computer execution instructions are executed by a processor, they are used to implement the steps of the data storage and query method based on resource semantic association as described in Embodiment 1 above. The specific implementation manner and technical effect are similar and will not be elaborated here.
[0107] Embodiment 5 of the present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the steps of the data storage and query method based on resource semantic association as described in Embodiment 1 above. The specific implementation manner and technical effect are similar and will not be elaborated here.
[0108] Other embodiments of the present application will be readily contemplated by those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include known common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and examples are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.
[0109] It should be understood that the present application is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A data storage and query method based on resource semantic association, characterized in that, Applied to a knowledge base system, including: Obtain a knowledge graph, and store the information of the knowledge graph into a keyword table in a database. The information of the knowledge graph includes the ID of the knowledge graph, the keywords of the knowledge graph, and the definition information of the keywords of the knowledge graph; Obtain resource data, extract the keywords of the resource data, and store the keywords of the resource data into a resource table in the database; When all the keywords of the resource data stored in the resource table match the keywords in the keyword table successfully, write the ID of the resource data into the keyword table; According to the keyword table, associate the ID of the resource data, the ID of the knowledge graph with each keyword in the resource table; Obtain the knowledge list of each keyword in the resource table, add the resource data to the corresponding knowledge list, and store the knowledge list into a graph database. The knowledge list includes the definition information of the keyword in the resource table and the resource data; Obtain the target keyword selected by the user through the knowledge graph, and obtain and display the target knowledge list corresponding to the target keyword; The obtaining the knowledge list of each keyword in the resource table and adding the resource data to the corresponding knowledge list includes: When the first keyword in the resource table does not have a knowledge list, generate a knowledge list corresponding to the first keyword. The knowledge list corresponding to the first keyword includes the definition information of the first keyword and the resource data; When the first keyword has a knowledge list, add the resource data to the knowledge list corresponding to the first keyword.
2. The method according to claim 1, wherein Before obtaining the resource data, it further includes: When there is a null value in the definition information of the keyword in the keyword table, use web crawler technology to extract the target definition information of the keyword with a null definition information; Store the target definition information into the keyword table.
3. The method according to any one of claims 1-2, characterized in that, After all the keywords of the resource data match the keywords in the keyword list successfully, it further includes: Perform text parsing on the knowledge graph to obtain data in HyperText Markup Language (HTML) format; Highlight the keywords in the resource table in the HTML format data, so that the keywords in the resource table are highlighted on the knowledge graph display interface.
4. The method according to claim 3, wherein The performing text parsing on the knowledge graph to obtain data in HTML format includes: Use a jQuery plugin to convert the knowledge graph into data in HTML format.
5. The method according to any one of claims 1-2, characterized in that, The associating the ID of the resource data, the ID of the knowledge graph with each keyword in the resource table includes: Form an associated triple form with the ID of the resource data, the ID of the knowledge graph and the keyword in the resource table.
6. A knowledge base system, characterized in that, Including: A first processing module, configured to obtain a knowledge graph, and store the information of the knowledge graph into a keyword table in a database. The information of the knowledge graph includes the ID of the knowledge graph, the keywords of the knowledge graph, and the definition information of the keywords of the knowledge graph; A second processing module, configured to obtain resource data, extract keywords of the resource data, and store the keywords of the resource data into a resource table of the database; A writing module, configured to write the ID of the resource data into the keyword table when all the keywords of the resource data stored in the resource table match the keywords in the keyword table; An association module, configured to associate the ID of the resource data, the ID of the knowledge graph with each keyword in the resource table according to the keyword table; A third processing module, configured to obtain a knowledge list of each keyword in the resource table, add the resource data to the corresponding knowledge list, and store the knowledge list into a graph database, where the knowledge list includes definition information and resource data of the keyword in the resource table; An obtaining module, configured to obtain a target keyword selected by a user through the knowledge graph, and obtain and display a target knowledge list corresponding to the target keyword; The third processing module is specifically configured to: When a first keyword in the resource table does not have a knowledge list, generate a knowledge list corresponding to the first keyword, where the knowledge list corresponding to the first keyword includes definition information of the first keyword and the resource data; When the first keyword has a knowledge list, add the resource data to the knowledge list corresponding to the first keyword.
7. A knowledge base system, characterized in that, Including: A processor and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, they are used to implement the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1-5.
Citation Information
Patent Citations
Knowledge map based resource retrieval method
CN103605706A