JP7211255B2 - Search processing program, search processing method and information processing device - Google Patents

Search processing program, search processing method and information processing device Download PDF

Info

Publication number
JP7211255B2
JP7211255B2 JP2019090011A JP2019090011A JP7211255B2 JP 7211255 B2 JP7211255 B2 JP 7211255B2 JP 2019090011 A JP2019090011 A JP 2019090011A JP 2019090011 A JP2019090011 A JP 2019090011A JP 7211255 B2 JP7211255 B2 JP 7211255B2
Authority
JP
Japan
Prior art keywords
data
identifier
processing
search
rdf
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2019090011A
Other languages
Japanese (ja)
Other versions
JP2020038610A (en
Inventor
雄一 松田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Publication of JP2020038610A publication Critical patent/JP2020038610A/en
Application granted granted Critical
Publication of JP7211255B2 publication Critical patent/JP7211255B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

本発明は、検索処理プログラム、検索処理方法及び情報処理装置に関する。 The present invention relates to a search processing program, a search processing method, and an information processing apparatus.

近年、さまざまな知識に関するデータを集め、蓄積し、そして検索することへの関心が高まっている。このようなデータは、何らかのグラフデータモデルで表されると考えられる。このようなグラフデータモデルの一つとして、RDF(Resource Description Framework)が知られている。現在、RDFにより記述されたオープンデータは、数多く存在する。RDFのデータモデルでは、トリプル(triple)と称される主語(subject)、述語(predicate)及び目的語(object)の3つの要素をノードとしてその関係が表される。以下では、RDFにより記述されたデータをRDFデータと呼ぶ。 In recent years, there has been an increasing interest in collecting, accumulating, and searching data on various kinds of knowledge. Such data may be represented in some graph data model. RDF (Resource Description Framework) is known as one of such graph data models. Currently, there are many open data described by RDF. In the RDF data model, the relationships are expressed using three elements, a subject, a predicate, and an object, which are called triples, as nodes. Data described in RDF is hereinafter referred to as RDF data.

RDFデータを検索したり分析したりするため、SPARQLと呼ばれる問い合せ言語が標準化されている。SPARQLは、SQLに似た言語であり、これを用いてクエリを記述することでRDFデータを格納したRDFストアから条件に合うデータを引き出すことができる。 A query language called SPARQL has been standardized for searching and analyzing RDF data. SPARQL is a language similar to SQL, and by using this to describe a query, it is possible to retrieve data that meets conditions from an RDF store that stores RDF data.

このようなSPARQLのクエリ処理の効率を改善する方法として、並列化という技術がある。並列化の一手法としてMapReduceに代表される分散フレームワークを使用した手法がある。分散フレームワークを使用した手法とは、簡単に言えば、計算機毎に並列に処理するアプローチである。分散フレームワークでは、計算機の台数を増やすことによってデータ量の増加に対するスケーラビリティを確保し、大規模データを効率良く処理することが可能となる。 As a method for improving the efficiency of such SPARQL query processing, there is a technique called parallelization. As one method of parallelization, there is a method using a distributed framework represented by MapReduce. A method using a distributed framework is, simply put, an approach in which each computer performs parallel processing. In the distributed framework, by increasing the number of computers, it is possible to secure scalability against an increase in the amount of data and to process large-scale data efficiently.

このような分散フレームワークを使用したミドルウェアとして、例えばHadoop(登録商標)がある。Hadoopは、データを複数のサーバに分散し、並列して処理するミドルウェアであり、テラバイト級さらにはペタバイト級の大容量データの分析などを高速処理できるため、ビッグデータ活用における主要技術として利用されている。Hadoopでは、1台のマスタサーバと、その配下に繋がる多数のスレーブサーバとが連携し、データの高速処理を行う。データ処理全体の流れをコントロールするのがマスタサーバであり、実際の計算処理は配下のスレーブサーバが手分けして行う。したがって、Hadoopは、スレーブサーバの台数が多ければ多いほど処理能力が高まり、増大するデータを高速に計算処理することができる。 Middleware using such a distributed framework is, for example, Hadoop (registered trademark). Hadoop is middleware that distributes data to multiple servers and processes it in parallel. Because it is capable of high-speed analysis of terabyte-level and even petabyte-level data, it is used as a major technology for big data utilization. there is In Hadoop, one master server cooperates with a large number of slave servers connected under it to perform high-speed data processing. The master server controls the flow of the entire data processing, and the actual calculation processing is performed by subordinate slave servers. Therefore, in Hadoop, the greater the number of slave servers, the higher the processing power, and the more data can be calculated at high speed.

さらに、Hadoopには、2つの主要な技術が用いられている。1つは、HDFS(Hadoop Distributed File System)である。HDFSは、多数のスレーブサーバのハードディスクを取りまとめ、そこに計算すべき膨大なデータを書き込んだり、集計した結果を書き込んだりすることが可能な仮想的なファイルシステムである。 In addition, Hadoop uses two main technologies. One is HDFS (Hadoop Distributed File System). HDFS is a virtual file system capable of collecting hard disks of many slave servers, writing huge amounts of data to be calculated, and writing aggregated results.

もう1つは、MapReduce処理である。MapReduce処理は、与えられたデータから欲しいデータを抽出し分解するMap処理及び抽出されたデータを集計するReduce処理という2つの手順で計算処理を行う手法である。MapReduce処理は、複数台のスレーブサーバで並列処理ができるので、効率的である。MapReduce処理が計算処理の対象とするデータはHDFS上に分散されているものが利用される。 Another is MapReduce processing. MapReduce processing is a method of performing calculation processing in two steps: Map processing for extracting and decomposing desired data from given data and Reduce processing for summarizing the extracted data. MapReduce processing is efficient because parallel processing can be performed by a plurality of slave servers. The data distributed on the HDFS is used as the data to be calculated by the MapReduce process.

なお、SPARQL検索クエリにおいて頻繁に比較される値に対応する変数を抽出し、抽出した変数に対応する値を結合して作成した新たなノードをRDFデータに加えて検索処理を行う従来技術がある。また、トリプルのデータにしたがって順序付けられたデータアイテムのセットの中のデータアイテムにトリプルが格納され、そのデータアイテムが格納される分散型の計算機がセット内のデータアイテムの位置に応じて決定される従来技術がある。また、インデックスを作成する場合に、文字列の長さが設定された閾値を超える場合には文字列から決まるハッシュ値とキーの値との組を登録する従来技術がある。また、タグと文字列とを用いて文書管理を行う従来技術がある。 In addition, there is a conventional technology that extracts variables corresponding to frequently compared values in SPARQL search queries, adds new nodes created by combining values corresponding to the extracted variables to RDF data, and performs search processing. . Also, the triple is stored in a data item in a set of data items ordered according to the data of the triple, and the distributed calculator in which the data item is stored is determined according to the position of the data item in the set. There is prior art. Also, there is a conventional technique for registering a set of a hash value and a key value determined from a character string when the length of the character string exceeds a set threshold when creating an index. There is also a conventional technique for document management using tags and character strings.

国際公開第2014/207827号WO2014/207827 特開2013-175181号公報JP 2013-175181 A 特開2000-90115号公報JP-A-2000-90115 特開2008-52662号公報JP-A-2008-52662

しかしながら、例えば、RDFデータは、主語、述語及び目的語の3要素のそれぞれの関係を表すことで成り立つ。これに対して、MapReduce処理を行う場合、入力されたデータはkey=valueの形式、つまり2要素として扱われる。そのため、RDFデータをMapRdduce処理で処理する場合、RDFデータをkey=valueの2要素の形式に分解して全ての組み合わせを予め作成する作業が加わる。例えば、RDFデータの3要素を(s,p,o)と表した場合、(s,p)、(p,o)又は(o,s)の組み合わせを1つの要素として、全体で2要素となるように分解される。この変換作業には膨大な時間が掛かる。 However, for example, RDF data consists of representing the relationship between three elements of subject, predicate and object. On the other hand, when MapReduce processing is performed, input data is treated as a key=value format, that is, as two elements. Therefore, when RDF data is processed by MapRdduce processing, the work of decomposing the RDF data into two-element format of key=value and creating all combinations in advance is added. For example, when the three elements of RDF data are represented as (s, p, o), the combination of (s, p), (p, o) or (o, s) is regarded as one element, and the total is two elements. is decomposed into This conversion work takes an enormous amount of time.

さらに、RDFデータの場合、例えば、3要素のうち2要素が決まっている検索を行う場合には、2つの要素のそれぞれを比較して検索することになる。RDFデータの各要素の値には長い文字列、言い換えればデータ領域が大きい値を格納することもできる。特にこのような長い文字列を決まった2要素として検索を行う場合、膨大な時間が掛かるおそれがある。 Furthermore, in the case of RDF data, for example, when performing a search in which two of the three elements are determined, the two elements are compared and searched. A long character string, in other words, a value with a large data area can be stored as the value of each element of the RDF data. In particular, it may take an enormous amount of time to search such a long character string as two fixed elements.

また、頻出の変数に対応する値を結合して作成した新たなノードをRDFデータに加える従来技術を用いても、RDFデータとMapReduce処理とで取り扱われるデータ形式の違いは解消されず、検索処理を高速に行うことは困難である。また、セット内のデータアイテムの位置に応じて配置する計算機を決定する従来技術を用いても、同様にRDFデータとMapReduce処理とで取り扱われるデータ形式の違いは解消されず、検索処理を高速に行うことは困難である。また、文字列に基づくハッシュ値とキーの値との組をインデックスとして登録する従来技術では、要素が異ならない場合の検索処理は早くなるが、要素数が異なる場合のデータ形式の違いはやはり解消されず、検索処理を高速に行うことは困難である。さらに、タグと文字列とを用いて文書管理を行う従来技術でも、同様にRDFデータとMapReduce処理とで取り扱われるデータ形式の違いは解消されず、検索処理を高速に行うことは困難である。 Moreover, even if a conventional technique is used in which a new node created by combining values corresponding to frequently appearing variables is added to the RDF data, the difference between the data formats handled by the RDF data and the MapReduce process cannot be resolved, and the search process is difficult to perform at high speed. Also, even if the conventional technique of determining the computer to be arranged according to the position of the data item in the set is used, the difference in data format handled by the RDF data and the MapReduce process is similarly not resolved, and the search process is speeded up. It is difficult to do. In addition, with the conventional technology that registers pairs of hash values and key values based on character strings as indexes, search processing is faster when elements do not differ, but differences in data format when the number of elements differs is also eliminated. Therefore, it is difficult to perform search processing at high speed. Furthermore, even with conventional techniques for document management using tags and character strings, the difference in data format handled between RDF data and MapReduce processing is similarly not eliminated, making it difficult to perform high-speed retrieval processing.

開示の技術は、上記に鑑みてなされたものであって、検索処理を高速に実行する検索処理プログラム、検索処理方法及び情報処理装置を提供することを目的とする。 The disclosed technology has been made in view of the above, and aims to provide a search processing program, a search processing method, and an information processing apparatus that perform search processing at high speed.

本願の開示する検索処理プログラム、検索処理方法及び情報処理装置の一つの態様において、コンピュータに以下の処理を実行させる。3要素を有するデータのうち2要素を抽出し、抽出した前記2要素よりも小さいサイズの識別子を抽出した前記2要素に対応付けた第1の表を生成する。前記3要素の表に対して前記識別子を付加した第2の表を生成する。前記第2の表を複数の処理装置に分割して配置する。検索する際に、前記第1の表を用いて前記識別子を取り出し、取り出した前記識別子を用いてそれぞれの前記処理装置において、各前記処理装置に配置された前記第2の表の一部に対して検索を行う。前記検索により前記第2の表のうちの抽出される行を出力する。 In one aspect of the search processing program, search processing method, and information processing apparatus disclosed in the present application, a computer is caused to execute the following processes. Two elements are extracted from data having three elements, and a first table is generated in which an identifier smaller in size than the extracted two elements is associated with the extracted two elements. A second table is generated by adding the identifier to the three-element table. The second table is divided and arranged in a plurality of processing units. When retrieving, the first table is used to retrieve the identifier, and the retrieved identifier is used in each of the processing units for a portion of the second table located in each of the processing units. to search. Outputting the rows of the second table extracted by the search.

1つの側面では、本発明は、検索処理を高速に実行することができる。 In one aspect, the present invention can perform search processing at high speed.

図1は、情報処理システムのシステム構成図である。FIG. 1 is a system configuration diagram of an information processing system. 図2は、マスタサーバ及びスレーブサーバの詳細を表すブロック図である。FIG. 2 is a block diagram showing the details of the master server and slave servers. 図3は、RDFデータをツリー形式で表した一例の図である。FIG. 3 is a diagram showing an example of RDF data represented in a tree format. 図4は、RDFデータを表形式で表した一例の図である。FIG. 4 is a diagram of an example of RDF data represented in tabular form. 図5は、識別子対応表の一例を表す図である。FIG. 5 is a diagram showing an example of an identifier correspondence table. 図6は、識別子付RDFデータ表の一例を表す図である。FIG. 6 is a diagram showing an example of an identifier-attached RDF data table. 図7は、MapReduce処理の概要を表す図である。FIG. 7 is a diagram showing an overview of MapReduce processing. 図8は、実施例1に係るパラメータ識別子を用いた場合のMapReduce処理の概要を表す図である。FIG. 8 is a diagram illustrating an overview of MapReduce processing when using parameter identifiers according to the first embodiment. 図9は、実施例1に係る識別子表及び識別子付RDFデータ表の生成処理のフローチャートである。FIG. 9 is a flowchart of processing for generating an identifier table and an identifier-attached RDF data table according to the first embodiment. 図10は、実施例1に係るMapReduce処理のフローチャートである。FIG. 10 is a flowchart of MapReduce processing according to the first embodiment. 図11は、分割データ表の一例を表す図である。FIG. 11 is a diagram showing an example of a divided data table. 図12は、実施例2に係るパラメータ識別子を用いた場合のMapReduce処理の概要を表す図である。FIG. 12 is a diagram illustrating an overview of MapReduce processing when using parameter identifiers according to the second embodiment. 図13は、コンピュータのハードウェア構成の一例を表す図である。FIG. 13 is a diagram illustrating an example of the hardware configuration of a computer; 図14は、実施例3に係るマスタサーバ及びスレーブサーバの詳細を表すブロック図である。FIG. 14 is a block diagram showing details of a master server and slave servers according to the third embodiment. 図15は、分割前の識別子対応表の一例を表す図である。FIG. 15 is a diagram showing an example of the identifier correspondence table before division. 図16は、分割識別子対応表の一例を表す図である。FIG. 16 is a diagram showing an example of a division identifier correspondence table. 図17は、実施例3に係るパラメータ識別子を用いた場合のMapReduce処理の概要を表す図である。FIG. 17 is a diagram illustrating an overview of MapReduce processing when using parameter identifiers according to the third embodiment. 図18は、実施例3に係る識別子表及び識別子付RDFデータ表の生成処理のフローチャートである。FIG. 18 is a flowchart of processing for generating an identifier table and an identifier-attached RDF data table according to the third embodiment. 図19は、実施例3に係るMapReduce処理のフローチャートである。FIG. 19 is a flowchart of MapReduce processing according to the third embodiment.

以下に、本願の開示する検索処理プログラム、検索処理方法及び情報処理装置の実施例を図面に基づいて詳細に説明する。なお、以下の実施例により本願の開示する検索処理プログラム、検索処理方法及び情報処理装置が限定されるものではない。 Exemplary embodiments of a search processing program, a search processing method, and an information processing apparatus disclosed in the present application will be described below in detail with reference to the drawings. The search processing program, search processing method, and information processing apparatus disclosed in the present application are not limited to the following embodiments.

図1は、情報処理システムのシステム構成図である。情報処理システム1は、図1に示すように、Hadoopクラスタ10、HDFS(Hadoop Distributed File System)クライアント20及びジョブクライアント30を有する。 FIG. 1 is a system configuration diagram of an information processing system. The information processing system 1 has a Hadoop cluster 10, an HDFS (Hadoop Distributed File System) client 20, and a job client 30, as shown in FIG.

HDFSクライアント20は、Hadoopクラスタ10に対してデータ管理の指示を行う情報処理端末である。HDFSクライアント20は、ネットワークを介してHadoopクラスタ10のマスタサーバ11と接続される。HDFSクライアント20は、利用者からのデータ管理の指示の入力を入力装置(不図示)から受ける。そして、HDFSクライアント20は、利用者からの入力に応じたデータ管理の処理命令をHDFS API(Application Programing Interface)を介してマスタサーバ11へ送信する。 The HDFS client 20 is an information processing terminal that instructs the Hadoop cluster 10 to manage data. The HDFS client 20 is connected to the master server 11 of the Hadoop cluster 10 via a network. The HDFS client 20 receives an input of a data management instruction from a user from an input device (not shown). Then, the HDFS client 20 transmits to the master server 11 via the HDFS API (Application Programming Interface) a processing instruction for data management according to the input from the user.

ジョブクライアント30は、Hadoopクラスタ10に対してジョブ管理の指示を行う情報処理端末である。ジョブクライアント30は、ネットワークを介してHadoopクラスタ10のマスタサーバ11と接続される。ジョブクライアント30は、MapReduceプログラムを有する。ジョブクライアント30は、利用者からのジョブ管理の指示の入力を入力装置(不図示)から受ける。そして、ジョブクライアント30は、利用者からの入力に応じたジョブ管理の処理命令をマスタサーバ11へ送信する。 The job client 30 is an information processing terminal that issues job management instructions to the Hadoop cluster 10 . The job client 30 is connected to the master server 11 of the Hadoop cluster 10 via a network. The job client 30 has a MapReduce program. The job client 30 receives an input of a job management instruction from a user from an input device (not shown). The job client 30 then transmits to the master server 11 a processing command for job management according to the input from the user.

これら、HDFSクライアント20及びジョブクライアント30は、同じ情報処理装置に配置されてもよいし、異なる情報処理装置に配置されてもよい。また、HDFSクライアント20及びジョブクライアント30の機能は、Hadoopクラスタ10の中に配置されてもよい。 These HDFS client 20 and job client 30 may be arranged in the same information processing apparatus, or may be arranged in different information processing apparatuses. Also, the functionality of the HDFS client 20 and the job client 30 may be located within the Hadoop cluster 10 .

Hadoopクラスタ10は、マスタサーバ11及びスレーブサーバ12を有する。図1では、3台のスレーブサーバ12を図示したが、スレーブサーバ12の数に特に制限は無い。マスタサーバ11は、各スレーブサーバ12とネットワークで接続される。さらに、マスタサーバ11は、HDFSクライアント20及びジョブクライアント30とネットワークで接続される。また、各スレーブサーバ12は、それぞれ相互にネット―ワークで接続される。 Hadoop cluster 10 has master server 11 and slave server 12 . Although three slave servers 12 are illustrated in FIG. 1, the number of slave servers 12 is not particularly limited. The master server 11 is connected to each slave server 12 via a network. Furthermore, the master server 11 is connected to the HDFS client 20 and the job client 30 via a network. Each slave server 12 is connected to each other via a network.

図2は、マスタサーバ及びスレーブサーバの詳細を表すブロック図である。以下では、図2を参照して、マスタサーバ11及びスレーブサーバ12について説明する。ここで、図1では構成の概略を図示するため、主要構成に絞りいくつかの構成を省略して記載したが、マスタサーバ11及びスレーブサーバ12は、より詳しくは図2に示す構成を有する。 FIG. 2 is a block diagram showing the details of the master server and slave servers. The master server 11 and the slave server 12 will be described below with reference to FIG. Here, in FIG. 1, in order to illustrate the outline of the configuration, only the main configuration is described and some configurations are omitted, but the master server 11 and the slave server 12 have the configuration shown in FIG.

マスタサーバ11は、RDFストア110、HDFS111、ネームノード112、メタデータDB(Data Base)113及びジョブトラッカー114を有する。さらに、マスタサーバ11は、第1生成部115、第2生成部116、RDFコントローラ117、SPARQL処理部118及びMapReduce処理部119を有する。 The master server 11 has an RDF store 110 , an HDFS 111 , a name node 112 , a metadata DB (Data Base) 113 and a job tracker 114 . Furthermore, the master server 11 has a first generator 115 , a second generator 116 , an RDF controller 117 , a SPARQL processor 118 and a MapReduce processor 119 .

HDFS111は、複数のサーバと連携して見た目上1つのファイルシステムと見せる仮想ファイルシステムである。HDFS111は、ファイルをブロックサイズと呼ばれる単位で分割することでファイル管理を行う。ブロックサイズはデフォルトで64MBである。HDFS111は、排他制御機能を有さない。また、HDFS111では、ファイルの新規作成及び追加は可能であるが、修正は許可されない。HDFS111の1つのブロックに対して1つのMapタスクが作成される。 The HDFS 111 is a virtual file system that looks like one file system in cooperation with a plurality of servers. The HDFS 111 performs file management by dividing a file into units called block sizes. The block size is 64MB by default. HDFS 111 does not have an exclusive control function. Also, in the HDFS 111, new creation and addition of files are possible, but modification is not permitted. One Map task is created for one block of HDFS 111 .

RDFデータは、例えば、図3に示すようにツリー形式で表すことができる。図3は、RDFデータをツリー形式で表した一例の図である。図3における、矢印の始点に配置された楕円で囲われたデータが主語にあたる。また、矢印の終点に配置された楕円で囲われたデータが述語にあたる。さらに、矢印上に記載されたデータが述語にあたる。 RDF data can be represented, for example, in a tree format as shown in FIG. FIG. 3 is a diagram showing an example of RDF data represented in a tree format. The subject is the data surrounded by an ellipse placed at the starting point of the arrow in FIG. Also, the data surrounded by an ellipse arranged at the end point of the arrow corresponds to the predicate. Furthermore, the data written on the arrow corresponds to the predicate.

また、RDFデータは、図4に示すように表形式で表すこともできる。図4は、RDFデータを表形式で表した一例の図である。図3に示したツリー形式のRDFデータを表形式で表した図が、図4にあたる。図4における、id(Identifier)は各トリプルに与えられた識別子を表す。また、Subjectはトリプルにおける主語を表し、predicateは述語を表し、objectは目的語を表す。このようにして各トリプルに割り当てられた識別子に対応させて、そのトリプルの主語、述語及びオブジェクトが表形式における1行(横列)に対応させて登録される。 The RDF data can also be represented in tabular form as shown in FIG. FIG. 4 is a diagram of an example of RDF data represented in tabular form. FIG. 4 is a diagram showing the tree-format RDF data shown in FIG. 3 in tabular form. In FIG. 4, id (Identifier) represents an identifier given to each triple. Also, Subject represents a subject in a triple, predicate represents a predicate, and object represents an object. Corresponding to the identifier assigned to each triple in this way, the subject, predicate and object of the triple are registered corresponding to one row (row) in the tabular format.

RDFストア110は、例えば、図4に示すような表形式のRDFデータを保持することができる。このRDFストア110に格納されたRDFデータを入力としてHDFS111へ保存することで、後述するMapReduce処理でHDFS111内のデータを操作することが可能となる。 The RDF store 110 can hold RDF data in tabular form as shown in FIG. 4, for example. By storing the RDF data stored in the RDF store 110 as an input in the HDFS 111, it becomes possible to manipulate the data in the HDFS 111 by the MapReduce process described later.

図2に戻って説明を続ける。RDFコントローラ117は、RDFストア110に格納されたRDFデータの管理を行う。例えば、RDFコントローラ117は、読み出し要求や格納要求を受けて、指定されたRDFデータの読み出し又は格納をRDFストア110に対して行う。また、RDFコントローラ117は、RDFストア110に格納されたRDFデータのHDFS111への保存の指示を受けて、RDFストア110に格納されRFDデータを入力としてHDFS111に保存させる。 Returning to FIG. 2, the description continues. The RDF controller 117 manages RDF data stored in the RDF store 110 . For example, the RDF controller 117 reads or stores designated RDF data in the RDF store 110 in response to a read request or storage request. In addition, the RDF controller 117 receives an instruction to store the RDF data stored in the RDF store 110 in the HDFS 111 , and stores the RFD data stored in the RDF store 110 in the HDFS 111 as an input.

第1生成部115は、識別子対応表の生成の指示をHDFSクライアント20から受ける。そして、第1生成部115は、RDFストア110に登録された全てのRDFデータの主語、述語及び目的語の取得をRDFコントローラ117に指示する。その後、第1生成部115は、RDFストア110に登録された全てのRDFデータの主語、述語及び目的語をRDFコントローラ117から取得する。 The first generation unit 115 receives an instruction to generate an identifier correspondence table from the HDFS client 20 . The first generator 115 then instructs the RDF controller 117 to acquire the subject, predicate and object of all RDF data registered in the RDF store 110 . After that, the first generator 115 acquires the subjects, predicates and objects of all RDF data registered in the RDF store 110 from the RDF controller 117 .

次に、第1生成部115は、取得した主語、述語及び目的語のそれぞれの重複を除いて集計する。そして、第1生成部115は、集計した主語、述語及び目的語を用いて、「主語、述語」、「述語、目的語」及び「主語、目的語」の全ての通りの組み合わせを生成する。これらの組を以下では、「valueパターン」という。このRDFデータの主語、述語及び目的語が、「3要素」の一例にあたり、valueパターンに含まれる2つの値が、「2要素」の一例にあたる。 Next, the first generating unit 115 tabulates the obtained subjects, predicates, and objects by removing duplicates. Then, the first generating unit 115 generates all possible combinations of "subject, predicate", "predicate, object", and "subject, object" using the aggregated subjects, predicates, and objects. These sets are hereinafter referred to as "value patterns". The subject, predicate and object of this RDF data are an example of "three elements", and the two values included in the value pattern are an example of "two elements".

次に、第1生成部115は、生成したvalueパターンの中に、実際の各RDFデータの主語、述語及び目的語の組の中に含まれないvalueパターンが存在するか否かを判定する。実際の各RDFデータの主語、述語及び目的語の組の中に含まれないvalueパターンが存在する場合、第1生成部115は、各RDFデータの主語、述語及び目的語の中に含まれないvalueパターン以外のvalueパターンを抽出する。 Next, the first generating unit 115 determines whether or not the generated value patterns include a value pattern that is not included in the actual set of subject, predicate and object of each RDF data. If there is a value pattern that is not included in the actual set of subject, predicate and object of each RDF data, the first generation unit 115 generates the value pattern not included in the subject, predicate and object of each RDF data Extract value patterns other than value patterns.

第1生成部115は、抽出したvalueパターンのそれぞれにパターン識別子を割り当てる。この識別子は、valueパターンより小さいデータサイズである。データサイズとは、メモリを占有する上でのサイズである。そして、第1生成部115は、各valueパターンと割り当てたパターン識別子との対応を表す識別子対応表を作成する。このとき、第1生成部115は、実際の各RDFデータの主語、述語及び目的語の組の中に含まれないvalueパターンについては、不存在を表す情報を付加して識別子対応表へ登録する。図5は、識別子対応表の一例を表す図である。 The first generator 115 assigns a pattern identifier to each of the extracted value patterns. This identifier has a smaller data size than the value pattern. The data size is the size that occupies memory. Then, the first generation unit 115 creates an identifier correspondence table representing the correspondence between each value pattern and the assigned pattern identifier. At this time, the first generating unit 115 adds information indicating non-existence of value patterns that are not included in the set of subject, predicate and object of each RDF data and registers them in the identifier correspondence table. . FIG. 5 is a diagram showing an example of an identifier correspondence table.

ここでは、図4に示したRDFデータを基に識別子対応表を作成する場合で説明する。また、述語と目的語の組み合わせのvalueパターンを生成する場合を例に説明する。 Here, a case of creating an identifier correspondence table based on the RDF data shown in FIG. 4 will be described. Also, a case of generating a value pattern of a combination of a predicate and an object will be described as an example.

第1生成部115は、図4に示されるRDFデータにおける述語201を重複を除いて集計する。この場合、第1生成部115は、「likes」及び「loves」という2語を述語として取得する。また、第1生成部115は、図4に示されるRDFデータにおける目的語202を重複を除いて集計する。この場合、第1生成部115は、「A」、「C」、「D」及び「F」という4語を述語として取得する。そして、第1生成部115は、取得した述語及び目的語の全ての組み合わせを生成する。この場合、第1生成部115は、「likes A」、「likes C」、「likes D」、「likes F」、「loves A」、「loves C」、「loves D」及び「loves F」をvalueバターンとして生成する。そして、第1生成部115は、「likes A」及び「loves D」が図4に示すRDFデータに含まれないと判定する。その後、第1生成部115は、実際に存在するValueパターンにパターン識別子を割り当て、実際には存在しないvalueパターンに対しては不存在を示す情報を対応させて、図4に示す識別子対応表211及び212を生成する。図5では、「likes」を述語として含むvalueパターンを表す識別子対応表211と「loves」を述語として含むvalueパターンを表す識別子対応表212とを分けて記載した。さらに、第1生成部115は、存在しないvalueパターンである「likes A」及び「loves D」に不存在を表すNA(Not Applicable)を付加して識別子対応表211及び212にそれぞれ登録する。 The first generation unit 115 tabulates the predicates 201 in the RDF data shown in FIG. 4 excluding duplicates. In this case, the first generator 115 acquires the two words “likes” and “loves” as predicates. In addition, the first generation unit 115 tabulates the objects 202 in the RDF data shown in FIG. 4 by eliminating duplication. In this case, the first generator 115 acquires four words "A", "C", "D" and "F" as predicates. Then, the first generation unit 115 generates all combinations of the acquired predicates and objects. In this case, the first generation unit 115 generates “likes A”, “likes C”, “likes D”, “likes F”, “loves A”, “loves C”, “loves D” and “loves F”. Generate as a value pattern. Then, the first generating unit 115 determines that "likes A" and "loves D" are not included in the RDF data shown in FIG. After that, the first generation unit 115 assigns pattern identifiers to value patterns that actually exist, associates information indicating non-existence with value patterns that do not actually exist, and creates an identifier correspondence table 211 shown in FIG. and 212. In FIG. 5, an identifier correspondence table 211 representing value patterns including "likes" as a predicate and an identifier correspondence table 212 representing value patterns including "loves" as a predicate are separately described. Furthermore, the first generation unit 115 adds NA (Not Applicable) indicating non-existence to non-existent value patterns “likes A” and “loves D” and registers them in the identifier correspondence tables 211 and 212, respectively.

その後、第1生成部115は、生成した識別子対応表をRDFコントローラ117へ送信し、RDFストア110への格納を指示する。さらに、第1生成部115は、識別子対応表の生成完了を第2生成部116に通知する。この識別子対応表が、「第1の表」の一例にあたる。 After that, the first generation unit 115 transmits the generated identifier correspondence table to the RDF controller 117 and instructs the RDF store 110 to store it. Furthermore, the first generation unit 115 notifies the second generation unit 116 of completion of generation of the identifier correspondence table. This identifier correspondence table corresponds to an example of the "first table".

第2生成部116は、識別子対応表の生成完了の通知を第1生成部115から受ける。そして、第2生成部116は、識別子対応表の取得要求をRDFコントローラ117へ送信する。その後、第2生成部116は、第1生成部115により作成された全ての識別子対応表をRDFコントローラ117から取得する。 Second generation unit 116 receives from first generation unit 115 notification of the completion of generation of the identifier correspondence table. Second generation unit 116 then transmits an identifier correspondence table acquisition request to RDF controller 117 . After that, the second generator 116 acquires all identifier correspondence tables created by the first generator 115 from the RDF controller 117 .

次に、第2生成部116は、RDFストア110に登録された各RDFデータの取得要求をRDFコントローラ117へ送信する。そして、第2生成部116は、RDFコントローラ117から取得した各RDFデータの主語、述語及び目的語を確認し、それぞれの組み合のvalueパターンに対応するパターン識別子を識別子対応表から取得する。その後、第2生成部116は、各RDFデータのトリプルの対応表に、RDFデータ毎の取得したパターン識別子を付加した識別子付RDFデータ表を生成する。 Next, the second generating unit 116 transmits to the RDF controller 117 an acquisition request for each RDF data registered in the RDF store 110 . Then, the second generation unit 116 confirms the subject, predicate and object of each RDF data acquired from the RDF controller 117, and acquires the pattern identifier corresponding to the value pattern of each combination from the identifier correspondence table. After that, the second generating unit 116 generates an RDF data table with an identifier by adding the acquired pattern identifier for each RDF data to the triple correspondence table of each RDF data.

図6は、識別子付RDFデータ表の一例を表す図である。図6における「vp-id」は、パターン識別子を表す。そして、パターン識別子221は、主語と述語との組み合わせのvalueパターンに対応する。パターン識別子222は、述語と目的語との組み合わせのvalueパターンに対応する。パターン識別子223は、主語と目的語との組み合わせのvalueパターンに対応する。 FIG. 6 is a diagram showing an example of an identifier-attached RDF data table. “vp-id” in FIG. 6 represents a pattern identifier. The pattern identifier 221 corresponds to the value pattern of the combination of subject and predicate. The pattern identifier 222 corresponds to the value pattern of the predicate-object combination. The pattern identifier 223 corresponds to the value pattern of the subject-object combination.

第2生成部116は、例えば、図4の1行目のRDFデータの主語、述語及び目的語として「A」、「likes」及び「D」を取得する。そして、第2生成部116は、取得した各値から「A likes」、「likes D」及び「A D」というvalueパターンを取得する。その後、第2生成部116は、取得したvalueパターンに対応するパターン識別子を取得する。例えば、第2生成部116は、図5の識別子対応表211から「likes D」のパターン識別子である「0002」を取得する。同様に、第2生成部116は、「A likes」及び「A D」のパターン識別子として「2001」及び「4001」を取得する。その後、第2生成部116は、各パターン識別子を1行目のRDFデータに対応させて登録する。 The second generator 116 acquires, for example, "A", "likes" and "D" as the subject, predicate and object of the RDF data on the first line in FIG. Then, the second generation unit 116 acquires value patterns of “A likes”, “likes D”, and “AD” from the acquired values. After that, the second generator 116 acquires a pattern identifier corresponding to the acquired value pattern. For example, the second generation unit 116 acquires the pattern identifier "0002" of "likes D" from the identifier correspondence table 211 of FIG. Similarly, the second generator 116 acquires “2001” and “4001” as pattern identifiers of “A likes” and “AD”. After that, the second generation unit 116 registers each pattern identifier in association with the RDF data in the first row.

その後、第2生成部116は、生成した識別子付RDFデータ表をRDFコントローラ117へ送信し、RDFストア110に格納させる。この識別子付RDFデータ表が、「第2の表」の一例にあたる。 After that, the second generating unit 116 transmits the generated identifier-attached RDF data table to the RDF controller 117 and stores it in the RDF store 110 . This identifier-attached RDF data table corresponds to an example of the "second table".

ネームノード112は、RDFストア110に格納された識別子付RDFデータ表の取得要求をRDFコントローラ117に通知する。そして、ネームノード112は、RDFストア110に格納された識別子付RDFデータ表をRDFコントローラ117から取得する。ここで、識別子付RDFデータ表のデータを分散配置する場合、ネームノード112は、RDFコントローラ117と連携してRDFストア110に格納されたデータを取り扱うが、他の形式のデータを取り扱う場合にはRDFストア110から直接データを取得してもよい。 The namenode 112 notifies the RDF controller 117 of a request to acquire the identifier-attached RDF data table stored in the RDF store 110 . The namenode 112 then acquires the identifier-attached RDF data table stored in the RDF store 110 from the RDF controller 117 . Here, when the data of the identifier-attached RDF data table is distributed, the namenode 112 handles the data stored in the RDF store 110 in cooperation with the RDF controller 117. Data may be obtained directly from the RDF store 110 .

ネームノード112は、識別子付RDFデータ表の一部の行データを含むブロックの格納先のデータノード121を決定する。ここで、図2では、分かり易いように、スレーブサーバ12を1つ記載したが、実際には図1のように複数のスレーブサーバ12が配置されており、ネームノード112は、各スレーブサーバ12のデータノード121の中から各ブロックの配置先を選択する。 The name node 112 determines the data node 121 in which blocks containing partial row data of the identifier-attached RDF data table are stored. Here, although one slave server 12 is shown in FIG. 2 for the sake of clarity, a plurality of slave servers 12 are actually arranged as shown in FIG. , the location of each block is selected from among the data nodes 121 of .

そして、ネームノード112は、識別子付RDFデータ表の一部の行データを含むブロックを選択したデータノード121へ送信し配置する。ここで、ネームノード112は、複数のブロックを1つのデータノード121へ送信してもよい。この各ネームノード112へのブロックの配置が、「複数の処理装置に分割して配置」することの一例にあたる。さらに、ネームノード112は、各ブロックの保存先のデータノード121の情報をメタデータDB113に登録する。 Then, the name node 112 transmits and arranges a block containing part of row data of the identifier-attached RDF data table to the selected data node 121 . Here, the NameNode 112 may transmit multiple blocks to one DataNode 121 . This placement of blocks in each name node 112 corresponds to an example of "dividing and placing in a plurality of processing units". Furthermore, the name node 112 registers information on the data node 121 that is the storage destination of each block in the metadata DB 113 .

ここで、分散配置において、ネームノード112は、1つのデータブロックを複製して複数のデータノード121に配置する。例えば、ネームノード112は、1つのデータブロックを複製して3つにする。これにより、あるデータノード121に障害が発生した場合に、他のデータノード121に格納された同一のブロックを用いることができるようになり、Hadoopクラスタ10の耐障害性が確保される。このネームノード112が、「配置部」の一例にあたる。 Here, in distributed arrangement, the name node 112 duplicates one data block and places it in a plurality of data nodes 121 . For example, NameNode 112 duplicates one data block into three. As a result, when a failure occurs in a certain data node 121, the same block stored in another data node 121 can be used, and the Hadoop cluster 10 is ensured of failure tolerance. This name node 112 corresponds to an example of the "placement section".

SPARQL処理部118は、SPARQLクエリの入力をジョブクライアント30から受ける。そして、SPARQL処理部118は、取得したSPARQLクエリを解析してMapReduce処理に変換する。さらに、SPARQL処理部118は、識別子対応表の取得要求をRDFコントローラ117に通知する。その後、SPARQL処理部118は、RDFストア110に格納された識別子対応表をRDFコントローラ117から取得する。次に、SPARQL処理部118は、識別子対応表を参照して、取得したクエリの要素に対応するvalueパターンが存在するか否かを判定する。取得したクエリの要素に対応するvalueパターンが存在しなければ、SPARQL処理部118は、そのようなvalueパターンのマッチング結果は0件としてジョブクライアント30に検索結果を返す。 The SPARQL processing unit 118 receives SPARQL query input from the job client 30 . Then, the SPARQL processing unit 118 analyzes the obtained SPARQL query and converts it into MapReduce processing. Furthermore, the SPARQL processing unit 118 notifies the RDF controller 117 of an identifier correspondence table acquisition request. After that, the SPARQL processing unit 118 acquires the identifier correspondence table stored in the RDF store 110 from the RDF controller 117 . Next, the SPARQL processing unit 118 refers to the identifier correspondence table and determines whether or not there is a value pattern corresponding to the acquired query element. If there is no value pattern corresponding to the acquired query element, the SPARQL processing unit 118 returns the search result to the job client 30 as zero matching results for such a value pattern.

一方、取得したクエリの要素に対応するvalueパターンが存在する場合、SPARQL処理部118は、取得したクエリの要素のvalueパターンに割り当てられたパターン識別子を取得する。次に、SPARQL処理部118は、MAPReduce処理において、文字列を取得したパターン識別子に置き換える。その後、SPARQL処理部118は、パターン識別子を含むMapReduce処理をMapReduce処理部119に出力する。 On the other hand, if there is a value pattern corresponding to the acquired query element, the SPARQL processing unit 118 acquires the pattern identifier assigned to the value pattern of the acquired query element. Next, the SPARQL processing unit 118 replaces the character string with the obtained pattern identifier in the MAPReduce process. After that, the SPARQL processing unit 118 outputs MapReduce processing including the pattern identifier to the MapReduce processing unit 119 .

その後、SPARQL処理部118は、MapReduce処理の実行結果の入力をMapReduce処理部119から受ける。そして、SPARQL処理部118は、取得したMapReduce処理の実行結果をSPARQLクエリの実行結果としてジョブクライアント30へ送信する。このSPARQL処理部118が、「出力部」の一例にあたる。 After that, the SPARQL processing unit 118 receives the input of the execution result of the MapReduce processing from the MapReduce processing unit 119 . Then, the SPARQL processing unit 118 transmits the acquired execution result of the MapReduce process to the job client 30 as the execution result of the SPARQL query. The SPARQL processing unit 118 corresponds to an example of the "output unit".

MapReduce処理部119は、パターン識別子を含むMapReduce処理の入力をSPARQL処理部118から受ける。このMapReduce処理には、元のSPARQL処理に含まれる個々の検索処理に対応する複数のMapReduce処理が含まれる。そこで、MapReduce処理部119は、受信したMapReduce処理に含まれる個々のMapReduce処理を取得する。そして、MapReduce処理部119は、取得した各MapReduce処理の実行をジョブトラッカー114に指示する。この場合、検索に用いる文字列がパターン識別子に置き換えられているので、MapReduce処理部119は、パターン識別子を用いたMapReduce処理の実行をジョブトラッカー114に指示する。 The MapReduce processing unit 119 receives a MapReduce processing input including a pattern identifier from the SPARQL processing unit 118 . This MapReduce process includes multiple MapReduce processes corresponding to individual search processes included in the original SPARQL process. Therefore, the MapReduce processing unit 119 acquires each MapReduce process included in the received MapReduce process. The MapReduce processing unit 119 then instructs the job tracker 114 to execute each acquired MapReduce process. In this case, since the character string used for the search is replaced with the pattern identifier, the MapReduce processing unit 119 instructs the job tracker 114 to execute the MapReduce process using the pattern identifier.

その後、MapReduce処理部119は、MapReduce処理の実行結果の入力をジョブトラッカー114から受ける。そして、MapReduce処理部119は、MapReduce処理の実行結果をSPARQL処理部118へ出力する。 After that, the MapReduce processing unit 119 receives an input of the execution result of the MapReduce processing from the job tracker 114 . The MapReduce processing unit 119 then outputs the execution result of the MapReduce processing to the SPARQL processing unit 118 .

ジョブトラッカー114は、各MapReduce処理の実行の指示をMapReduce処理部119から受ける。次に、ジョブトラッカー114は、メタデータDB113に格納された各ブロックが配置されたデータノード121を確認し、各MapReduce処理を実行させるデータノード121を決定する。そして、ジョブトラッカー114は、1つのブロックに対して1つのMapタスクを生成して割り当てる。その後、ジョブトラッカー114は、各Mapタスクを対応するブロックを保持するデータノード121を有するスレーブサーバ12のタスクトラッカー123へ送信する。このように、各Mapタスクが対象とするブロックを有するスレーブサーバ12に対して、それぞれのMapタスクが割り振られることにより、通信コストを最小化することができる。 The job tracker 114 receives an instruction to execute each MapReduce process from the MapReduce processing unit 119 . Next, the job tracker 114 confirms the data node 121 where each block stored in the metadata DB 113 is arranged, and determines the data node 121 to execute each MapReduce process. The job tracker 114 then generates and assigns one Map task to one block. Job tracker 114 then sends each Map task to task tracker 123 of slave server 12 having a data node 121 holding the corresponding block. In this way, the communication cost can be minimized by allocating each Map task to the slave server 12 having a block targeted by each Map task.

その後、ジョブトラッカー114は、各スレーブサーバ12のタスクトラッカー123からジョブの実行結果を受信する。そして、ジョブトラッカー114は、ジョブの実行結果をまとめたMapReduce処理の実行結果をMapReduce処理部119へ出力する。 After that, the job tracker 114 receives the job execution result from the task tracker 123 of each slave server 12 . Then, the job tracker 114 outputs to the MapReduce processing unit 119 an execution result of the MapReduce process, which summarizes the job execution results.

次に、スレーブサーバ12について説明する。スレーブサーバ12は、図2に示すように、データノード121、HDFS122、タスクトラッカー123及びMapReduce処理部124を有する。 Next, the slave server 12 will be explained. The slave server 12 has a data node 121, an HDFS 122, a task tracker 123 and a MapReduce processing unit 124, as shown in FIG.

HDFS122は、HDFS111と同様にデフォルト64MBのサイズのブロック単位でデータを管理する。各スレーブサーバ12のそれぞれのHDFS122は、全体で1つの仮想ファイルシステムを形成する。 The HDFS 122 manages data in block units with a default size of 64 MB, like the HDFS 111 . Each HDFS 122 of each slave server 12 forms one virtual file system as a whole.

データノード121は、識別子付RDFデータ表の一部の行データを含むブロックをネームノード112から受信する。ここで、データノード121は、複数のブロックを受信してもよい。そして、データノード121は、取得したブロックを自装置のHDFS122へ格納する。すなわち、HDFS122には、識別子付RDFデータ表の全行のうちの一部の行のデータが格納される。 The data node 121 receives from the name node 112 a block containing partial row data of the RDF data table with identifier. Here, data node 121 may receive multiple blocks. Then, the data node 121 stores the obtained block in the HDFS 122 of its own device. That is, the HDFS 122 stores the data of some of the rows of the RDF data table with identifiers.

タスクトラッカー123は、自装置が有するブロックに対応するMapタスクをジョブトラッカー114から受信する。そして、タスクトラッカー123は、Mapタスクで指示されたMap処理の実行をMapReduce処理部124に指示する。その後、タスクトラッカー123は、Mapタスクにしたがって実行されたMapReduce処理の実行結果の入力をMapReduce処理部124から受ける。そして、タスクトラッカー123は、Mapタスク毎の実行結果をジョブトラッカー114へ送信する。 The task tracker 123 receives from the job tracker 114 the Map task corresponding to the blocks it owns. The task tracker 123 then instructs the MapReduce processing unit 124 to execute the Map processing instructed by the Map task. After that, the task tracker 123 receives the input of the execution result of the MapReduce process executed according to the MapTask from the MapReduce processing unit 124 . The task tracker 123 then transmits the execution result of each Map task to the job tracker 114 .

MapReduce処理部124は、タスクトラッカー123から取得したMapタスクにしたがってMapReduce処理を実行する。ここで、図7を参照して、MapReduce処理について説明する。図7は、MapReduce処理の概要を表す図である。ここでは、MapReduce処理部124A~124Cが動作する場合で説明する。さらに、ここでは、MapReduce処理部124Aがブロック301~303に対する処理を行い、MapReduce処理部124B及び124Cは他のブロックを処理する。各ブロックのデータは、key=valueの形式を有するデータを含む。図7において括弧でくくられた2つの文字は、先頭の文字がkeyを表し、2番目の文字がvalueを表す。さらに、ここでは、MapReduce処理としてvalueがXのデータをカウントする処理を実行する場合で説明する。 The MapReduce processing unit 124 executes MapReduce processing according to the Map Task acquired from the task tracker 123 . Here, the MapReduce process will be described with reference to FIG. FIG. 7 is a diagram showing an overview of MapReduce processing. Here, a case where the MapReduce processing units 124A to 124C operate will be described. Further, here, the MapReduce processing unit 124A processes blocks 301 to 303, and the MapReduce processing units 124B and 124C process other blocks. Data of each block includes data having a format of key=value. Of the two characters enclosed in parentheses in FIG. 7, the first character represents key and the second character represents value. Furthermore, here, a case where a process of counting data whose value is X is executed as a MapReduce process will be described.

MapReduce処理部124Aは、ブロック301~303の各データを入力として、入力をmap関数に与えて内部で処理した結果を新たなkey=valueの形式のデータとして出力する。ここでは、MapReduce処理部124Aは、ValueがXであるデータを出力する。この場合、MapReduce処理部124Aは、ブロック301から(K1,X)及び(K4,X)を抽出し、ブロック302から(K2,X)及び(K3,X)を抽出し、ブロック303から(K2,X)及び(K5,X)を抽出する。この処理がMap処理にあたる。Map処理は、ブロック301~303毎に行われる。 The MapReduce processing unit 124A receives the data of blocks 301 to 303 as input, gives the input to the map function, and outputs the result of internal processing as new data in the key=value format. Here, the MapReduce processing unit 124A outputs data whose Value is X. In this case, the MapReduce processing unit 124A extracts (K1, X) and (K4, X) from the block 301, extracts (K2, X) and (K3, X) from the block 302, and extracts (K2 , X) and (K5, X). This processing corresponds to the Map processing. Map processing is performed for each block 301-303.

同様に、MapReduce処理部124Bは、処理対象とするブロックからvalueがXであるものを抽出する。この場合、MapReduce処理部124Bは、(K1,X)、(K4,X)、(K5,X)、(K1,X)及び(K6,X)を抽出する。また、MapReduce処理部124Cも同様に処理対象とするブロックからvalueがXであるものを抽出する。 Similarly, the MapReduce processing unit 124B extracts blocks whose value is X from the blocks to be processed. In this case, the MapReduce processing unit 124B extracts (K1, X), (K4, X), (K5, X), (K1, X) and (K6, X). Similarly, the MapReduce processing unit 124C also extracts blocks whose value is X from the blocks to be processed.

次に、MapReduce処理部124A~124Cは、抽出した各データを分類してそれぞれを、MapReduce処理部124A~124Cのうちの決められた送信先へ送信する。例えば、図7では、keyがK1及びK2のデータがMapReduce処理部124Aへまとめられる。また、keyがK3及びK4のデータがMapReduce処理部124Bへまとめられる。また、keyがK5及びK6のデータがMapReduce処理部124Cへまとめられる。次に、各MapReduce処理部124A~124Cは、自己に集められたデータを並び替える。ここでは、MapReduce処理部124A~124Cは、key毎にまとまるようにデータを並び替える。すなわち、MapReduce処理部124A~124Cは、おなじkeyを有するkey=value形式のデータ同士を集約する。これらの処理をシャッフル及びソート処理と言う。 Next, the MapReduce processing units 124A to 124C classify each extracted data and transmit each of them to a predetermined transmission destination among the MapReduce processing units 124A to 124C. For example, in FIG. 7, the data with keys K1 and K2 are combined into the MapReduce processing unit 124A. Also, data with keys K3 and K4 are put together in the MapReduce processing unit 124B. Also, data with keys K5 and K6 are put together in the MapReduce processing unit 124C. Next, each of the MapReduce processing units 124A to 124C rearranges the collected data. Here, the MapReduce processing units 124A to 124C rearrange the data so that they are grouped for each key. In other words, the MapReduce processing units 124A to 124C aggregate the key=value format data having the same key. These processes are called shuffle and sort processes.

次に、MapReduce処理部124A~124Cは、シャッフル及びソート処理が完了したデータを取得し、取得したデータをReduce関数の内部で処理した結果をkey=value形式のデータとして出力する。ここでは、MapReduce処理部124A~124Cは、Reduce関数として同じkeyを有するデータ毎に集計を行う。図7では、MapReduce処理部124Aは、(K1,X)が3つあることを表すデータとして(K1,3)を出力する。また、MapReduce処理部124Aは、(K2,X)が2つあることを表すデータとして(K2,2)を出力する。MapReduce処理部124Bは、keyがK3又はK4であるデータの集計結果を出力する。MapReduce処理部124Cは、keyがK5又はK6であるデータの集計結果を出力する。この処理をReduce処理と言う。Reduce処理は、利用者が編集可能である。ここでは、Reduce処理として、同じkeyを有するデータの集計を行う処理を行ったが、他の処理に変更することも可能である。例えば、SPARQLクエリに対応する結果を返す場合、Reduce処理を、valueがXであり、そのXに対応する値をkeyとするデータをそのまま出力する処理にしてもよい。 Next, the MapReduce processing units 124A to 124C obtain the data for which the shuffle and sort processing have been completed, process the obtained data inside the Reduce function, and output the result as data in the key=value format. Here, the MapReduce processing units 124A to 124C aggregate each data having the same key as the Reduce function. In FIG. 7, the MapReduce processing unit 124A outputs (K1, 3) as data representing that there are three (K1, X). Also, the MapReduce processing unit 124A outputs (K2, 2) as data indicating that there are two (K2, X). The MapReduce processing unit 124B outputs the totalization result of the data whose key is K3 or K4. The MapReduce processing unit 124C outputs the totalization result of the data whose key is K5 or K6. This processing is called Reduce processing. The Reduce process can be edited by the user. Here, as the Reduce process, a process of aggregating data having the same key is performed, but it is also possible to change to other processes. For example, when returning a result corresponding to a SPARQL query, the Reduce process may be a process of outputting data whose value is X and whose key is the value corresponding to X as it is.

MapReduce処理部124は、Mapタスク実行部241及びReduceタスク実行部242を有する。Mapタスク実行部241は、Map処理及びシャッフル及びソート処理を行う。 The MapReduce processing unit 124 has a Map task execution unit 241 and a Reduce task execution unit 242 . The Map task execution unit 241 performs Map processing and shuffle and sort processing.

Mapタスク実行部241は、タスクトラッカー123から実行の指示を受けたMapタスクを取得する。そして、Mapタスク実行部241は、Map処理を実行する。この場合、Mapタスク実行部241は、パラメータ識別子を用いたMapタスクを受信する。そこで、Mapタスク実行部241は、例えば、図8に示すようにパラメータ識別子を用いてMap処理を実行する。図8は、実施例1に係るパラメータ識別子を用いた場合のMapReduce処理の概要を表す図である。図8に記載された識別子付RDFデータ表411及び421のそれぞれが異なるMapReduce処理部124で処理される場合で説明する。 The Map task execution unit 241 acquires a Map task whose execution has been instructed by the task tracker 123 . Then, the Map task execution unit 241 executes Map processing. In this case, the Map task execution unit 241 receives the Map task using the parameter identifier. Therefore, the Map task execution unit 241 executes Map processing using parameter identifiers as shown in FIG. 8, for example. FIG. 8 is a diagram illustrating an overview of MapReduce processing when using parameter identifiers according to the first embodiment. A case where the RDF data tables 411 and 421 with identifiers shown in FIG. 8 are processed by different MapReduce processing units 124 will be described.

例えば、図8では、Mapタスク実行部241は、太枠で囲われた1002というパラメータ識別子をvalueとするデータを抽出するMapタスクを取得する。ここで、図8では、分かり易いように1002に対応するvalueパターンを記載したが、実際のMapタスクにはvalueパターンは含まれなくてもよい。 For example, in FIG. 8, the Map task execution unit 241 acquires a Map task that extracts data whose value is the parameter identifier 1002 surrounded by a thick frame. Here, in FIG. 8, the value pattern corresponding to 1002 is described for easy understanding, but the actual Map task may not include the value pattern.

Mapタスク実行部241は、識別子付RDFデータ表411又は421からMap処理を行う対象とするデータを取得してkey=value形式のデータに変換しそのデータを入力とする。ここでは、Mapタスク実行部241は、主語とkeyとし述語及び目的語の組み合わせのvalueパターンをvalueとするデータを入力とする。 The Map task execution unit 241 acquires data to be subjected to Map processing from the identifier-attached RDF data table 411 or 421, converts the data into key=value format data, and receives the data as input. Here, the Map task execution unit 241 receives data with a subject and a key and a value pattern of a combination of a predicate and an object as the value.

そして、各Mapタスク実行部241は、入力のデータからvalueを表すパターン識別子が1002であるデータ412又は422を抽出する。そして、各Mapタスク実行部241は、抽出したデータ412又は422に対してシャッフル及びソート処理を実行する。ここでは、各Mapタスク実行部241は、keyがBであるデータを一方に集め、それ以外のデータを他方に集める。このkey毎に各スレーブサーバ12にデータを集める処理が、「3要素のいずれか1つの要素を基準に集約」する処理の一例にあたる。 Then, each Map task execution unit 241 extracts data 412 or 422 whose pattern identifier representing value is 1002 from the input data. Each Map task execution unit 241 then shuffles and sorts the extracted data 412 or 422 . Here, each Map task execution unit 241 collects data whose key is B to one side, and collects other data to the other side. The process of collecting data in each slave server 12 for each key corresponds to an example of the process of "summarizing based on any one of the three elements".

さらに、各Mapタスク実行部241は、keyを基準に収集したデータをソートしてデータ413又は423を生成する。そして、各Mapタスク実行部241は、データ413又は423をReduceタスク実行部242へ出力する。このMapタスク実行部241が、「検索部」の一例にあたる。 Furthermore, each Map task execution unit 241 sorts the collected data based on the key to generate data 413 or 423 . Each Map task execution unit 241 then outputs the data 413 or 423 to the Reduce task execution unit 242 . This Map task execution unit 241 corresponds to an example of a "search unit".

Reduceタスク実行部242は、Reduce処理を行う。例えば図8に示すように、各Reduceタスク実行部242は、データ413又は423の入力をそれぞれ対応するMapタスク実行部241から受ける。次に、各Reduceタスク実行部242は、取得したデータ413又は423から同じkeyを有するデータの数を集計する。そして、各Reduceタスク実行部242は、Reduce処理の結果414又は424をタスクトラッカー123へ出力する。ここで、図8の結果414及び424におけるcはカウント値を表す。このReduceタスク実行部242による同じkeyを有するデータの数を集計が、「予め決められた処理の実行」の一例にあたる。 The Reduce task execution unit 242 performs Reduce processing. For example, as shown in FIG. 8, each Reduce task execution unit 242 receives input of data 413 or 423 from the corresponding Map task execution unit 241 respectively. Next, each Reduce task execution unit 242 tallies the number of data having the same key from the acquired data 413 or 423 . Each Reduce task execution unit 242 then outputs a result 414 or 424 of the Reduce process to the task tracker 123 . Here, c in results 414 and 424 in FIG. 8 represents the count value. Aggregation of the number of data having the same key by the Reduce task execution unit 242 corresponds to an example of “execution of predetermined processing”.

次に、図9を参照して、実施例1に係る識別子表及び識別子付RDFデータ表の生成処理の流れについて説明する。図9は、実施例1に係る識別子表及び識別子付RDFデータ表の生成処理のフローチャートである。以下では、HDFS111との間のデータの送受信におけるRDFコントローラ117の仲介動作を省略する。 Next, with reference to FIG. 9, a flow of processing for generating an identifier table and an identifier-added RDF data table according to the first embodiment will be described. FIG. 9 is a flowchart of processing for generating an identifier table and an identifier-attached RDF data table according to the first embodiment. In the following, the intermediate operation of the RDF controller 117 in data transmission/reception with the HDFS 111 will be omitted.

第1生成部115は、RDFストア110に格納されたRDFデータから全ての主語、述語及び目的語の重複を除いて取得する。そして、第1生成部115は、取得した主語、述語及び目的語を2つずつ組み合わせて、valueパターンを抽出する(ステップS1)。 The first generating unit 115 obtains the RDF data stored in the RDF store 110 by excluding duplication of all subjects, predicates and objects. Then, the first generation unit 115 combines two each of the acquired subject, predicate and object to extract a value pattern (step S1).

次に、第1生成部115は、抽出したvalueパターンの中にRDFストア110に格納された実際のRDFデータの中に存在しないvalueパターンがあるか否かを判定する(ステップS2)。実際には存在しないvalueパターンが無い場合(ステップS2:否定)、第1生成部115は、ステップS4へ進む。 Next, the first generator 115 determines whether or not the extracted value patterns include a value pattern that does not exist in the actual RDF data stored in the RDF store 110 (step S2). If there is no value pattern that does not actually exist (step S2: No), the first generator 115 proceeds to step S4.

実際には存在しないvalueパターンがある場合(ステップS2:肯定)、第1生成部115は、抽出したvalueパターンの中から実際には存在しないvalueパターンを除いて、実際に存在するvalueパターンを抽出する(ステップS3)。 If there is a value pattern that does not actually exist (step S2: Yes), the first generation unit 115 extracts the value pattern that actually exists by removing the value pattern that does not actually exist from the extracted value patterns. (step S3).

次に、第1生成部115は、実際に存在するvalueパターンに識別子を割り当て、各valueパターンに対応するパターン識別子を表す識別子対応表を生成する(ステップS4)。その後、第1生成部115は、生成した識別子対応表のRDFストア110への格納をRDFコントローラ117に行わせ、識別子対表の生成完了を第2生成部116に通知する。 Next, the first generating unit 115 assigns identifiers to actually existing value patterns, and generates an identifier correspondence table representing pattern identifiers corresponding to each value pattern (step S4). After that, the first generation unit 115 causes the RDF controller 117 to store the generated identifier correspondence table in the RDF store 110, and notifies the second generation unit 116 of the completion of the generation of the identifier correspondence table.

識別子対表の生成完了の通知を受けた第2生成部116は、RDFストア110に含まれる全てのRDFデータ及び識別子対応表をRDFストア110から取得する。次に、第2生成部116は、各RDFデータの主語と述語とを組み合わせたvalueパターン、述語と目的語とを組わせたvalueパターン及び主語と目的語とを組わせたvalueパターンを取得する。そして、第2生成部116は、取得したvalueパターンに対応するパターン識別子を識別子対応表から取得する。次に、第2生成部116は、トリプルの対応を表す対応表における各RDFデータに取得したパターン識別子を付加して識別子付RDFデータ表を生成する(ステップS5)。その後、第2生成部116は、生成した識別子付RDFデータ表をRDFストア110に格納する。ここで、本実施例では、第1生成部115からの通知を受けた第2生成部116が、自動的に識別子付RDFデータの生成を行うように説明したが、これは他の手順でもよい。例えば、第2生成部116は、ジョブクライアント30を用いた利用者からの指示を受けて、その指示の入力をトリガとして識別子付RDFデータの生成を行ってもよい。 The second generating unit 116 that has received the notification of the completion of generation of the identifier pair table acquires from the RDF store 110 all the RDF data and the identifier correspondence table contained in the RDF store 110 . Next, the second generation unit 116 acquires a value pattern that combines the subject and predicate of each RDF data, a value pattern that combines the predicate and object, and a value pattern that combines the subject and object. . Then, the second generating unit 116 acquires pattern identifiers corresponding to the acquired value patterns from the identifier correspondence table. Next, the second generating unit 116 generates an RDF data table with an identifier by adding the acquired pattern identifier to each piece of RDF data in the correspondence table representing triple correspondence (step S5). After that, the second generation unit 116 stores the generated identifier-attached RDF data table in the RDF store 110 . Here, in the present embodiment, the second generation unit 116, which receives the notification from the first generation unit 115, automatically generates RDF data with an identifier, but other procedures may be used. . For example, the second generation unit 116 may receive an instruction from a user using the job client 30 and use the input of the instruction as a trigger to generate identifier-attached RDF data.

ネームノード112は、識別子付RDFデータ表をRDFストア110から取得する。次に、ネームノード112は、識別子付RDFデータ表に登録されたデータを含む各ブロックを配置するデータノード121を決定する。そして、ネームノード112は、識別子付RDFデータ表の一部の行データを含む各ブロックを、配置先として決定したそれぞれのデータノード121へ送信し、データの分散配置を実行する(ステップS6)。 The NameNode 112 acquires the RDF data table with identifier from the RDF store 110 . Next, the namenode 112 determines the datanode 121 in which each block containing the data registered in the identifier-attached RDF data table is placed. Then, the namenode 112 transmits each block including a part of row data of the identifier-attached RDF data table to each of the datanodes 121 determined as allocation destinations, and executes data distribution allocation (step S6).

次に、図10を参照して、実施例1に係るMapReduce処理の流れについて説明する。図10は、実施例1に係るMapReduce処理のフローチャートである。 Next, the flow of MapReduce processing according to the first embodiment will be described with reference to FIG. FIG. 10 is a flowchart of MapReduce processing according to the first embodiment.

SPARQL処理部118は、SPARQLクエリの実行命令の入力をジョブクライアント30から受ける。そして、SPARQL処理部118は、SPARQLクエリを実行する(ステップS11)。 The SPARQL processing unit 118 receives an input of a SPARQL query execution command from the job client 30 . The SPARQL processing unit 118 then executes the SPARQL query (step S11).

次に、SPARQL処理部118は、SPARQLクエリをMapReduce処理のジョブへ変換する(ステップS12)。 Next, the SPARQL processing unit 118 converts the SPARQL query into a job for MapReduce processing (step S12).

次に、SPARQL処理部118は、HDFS111から識別子対応表を取得する。そして、SPARQL処理部118は、投入されたクエリを構文解析(パース)して識別子対応表に登録されたvalueパターンに該当するvalueパターンがあるか否かを判定する(ステップS13)。該当するvalueパターンが無い場合(ステップS13:否定)、SPARQL処理部118は、そのようなvalueパターンのマッチング結果は0件であるという検索結果をジョブクライアント30に返してSPARQLクエリの実行処理を終了する。実際には、SPARQL処理部118は、パースした段階で識別子対応表に登録されたvalueパターンに該当するvalueパターンがあるか否かが分かる。 Next, the SPARQL processing unit 118 acquires the identifier correspondence table from the HDFS 111. FIG. Then, the SPARQL processing unit 118 parses the entered query and determines whether there is a value pattern corresponding to the value patterns registered in the identifier correspondence table (step S13). If there is no corresponding value pattern (step S13: No), the SPARQL processing unit 118 returns to the job client 30 a search result indicating that the matching result for such a value pattern is 0, and ends the SPARQL query execution processing. do. In practice, the SPARQL processing unit 118 can know whether or not there is a value pattern corresponding to the value pattern registered in the identifier correspondence table at the parsing stage.

これに対して、該当するvalueパターンがある場合(ステップS13:肯定)、SPARQL処理部118は、パターン識別子を参照してMapReduce処理を実行する。 On the other hand, if there is a corresponding value pattern (step S13: Yes), the SPARQL processing unit 118 refers to the pattern identifier and executes the MapReduce process.

MapReduce処理部119は、SPARQL処理部118からの指示を受けて、パターン識別子を参照してMapReduce処理の実行をジョブトラッカー114に指示する。ジョブトラッカー114は、メタデータDB113を確認し、MapReduce処理を行わせるスレーブサーバ12を選択する。そして、ジョブトラッカー114は、MapReduce処理をブロック単位のMapタスクに分割し、選択したスレーブサーバ12へ送信する。タスクトラッカー123は、Mapタスクをジョブトラッカー114から受信する。そして、タスクトラッカー123は、取得したMapタスクの実行をMapReduce処理部124に指示する。MapReduce処理部124は、Mapタスクの実行の指示をタスクトラッカー123から受ける。そして、Mapタスク実行部241は、HDFS122に格納された識別符号付RDFデータを用いて、Mapタスクで指定されたMap処理を実行する(ステップS14)。 The MapReduce processing unit 119 receives an instruction from the SPARQL processing unit 118, refers to the pattern identifier, and instructs the job tracker 114 to execute the MapReduce process. The job tracker 114 confirms the metadata DB 113 and selects a slave server 12 to perform the MapReduce process. The job tracker 114 then divides the MapReduce process into block-based Map tasks and transmits them to the selected slave server 12 . The task tracker 123 receives Map tasks from the job tracker 114 . The task tracker 123 then instructs the MapReduce processing unit 124 to execute the acquired Map task. The MapReduce processing unit 124 receives an instruction to execute a Map task from the task tracker 123 . The Map task execution unit 241 then uses the RDF data with identification code stored in the HDFS 122 to execute the Map process designated by the Map task (step S14).

次に、Mapタスク実行部241は、Map処理の処理結果をkey毎にまとまるようシャッフルして各スレーブサーバ12のMapタスク実行部241に振り分ける。さらに、Mapタスク実行部241は、シャッフルにより自装置に振り分けられたデータをkey毎にまとまるようにソートする(ステップS15)。そして、Mapタスク実行部241は、ソートしたデータをReduceタスク実行部242へ出力する。 Next, the Map task execution unit 241 shuffles the processing results of the Map processing so that they are collected for each key and distributes them to the Map task execution unit 241 of each slave server 12 . Further, the Map task execution unit 241 sorts the data distributed to its own device by shuffling so that the data are grouped for each key (step S15). The Map task execution unit 241 then outputs the sorted data to the Reduce task execution unit 242 .

Reduceタスク実行部242は、Mapタスク実行部241から取得したデータに対して予め指定されたReduce処理を実行する(ステップS16)。例えば、Reduceタスク実行部242は、データをkey毎に集計する。 The Reduce task execution unit 242 executes a predesignated Reduce process on the data acquired from the Map task execution unit 241 (step S16). For example, the Reduce task execution unit 242 aggregates data for each key.

その後、Reduceタスク実行部242は、MapReduce処理の結果をタスクトラッカー123へ出力する。タスクトラッカー123は、入力されたMapReduce処理の結果をマスタサーバ11のジョブトラッカー114へ送信する。ジョブトラッカー114は、各スレーブサーバ12から送信されたMapReduce処理の結果を収集する。そして、ジョブトラッカー114は、MapReduce処理の結果を結合する。そして、ジョブトラッカー114は、結合したMapReduce処理の結果をMapReduce処理部119を介してSPARQL処理部118へ送信する。SPARQL処理部118は、結合されたMapReduce処理の結果を受信し、受信したデータをRDF形式に変換する(ステップS17)。その後、SPARQL処理部118は、RDF形式に変換したMapReduce処理の結果をSPARQLクエリの実行結果としてジョブクライアント30へ送信する。 After that, the Reduce task execution unit 242 outputs the result of the MapReduce process to the task tracker 123 . The task tracker 123 transmits the input result of the MapReduce process to the job tracker 114 of the master server 11 . The job tracker 114 collects the MapReduce processing results sent from each slave server 12 . The job tracker 114 then combines the results of the MapReduce processing. The job tracker 114 then transmits the combined result of the MapReduce processing to the SPARQL processing unit 118 via the MapReduce processing unit 119 . The SPARQL processing unit 118 receives the results of the combined MapReduce processing, and converts the received data into RDF format (step S17). After that, the SPARQL processing unit 118 transmits the result of the MapReduce process converted into the RDF format to the job client 30 as the execution result of the SPARQL query.

以上に説明したように、本実施例に係るHadoopクラスタは、グラフデータに含まれる3要素のうちの2要素の組み合わせであるvalueパターンに識別子を割り当てし、その識別子を用いてMapReduce処理を実行する。これにより、MapReduce処理においてグラフデータの検索を行う場合に、データ領域が小さい識別子を用いて検索を行うことができ、検索時のマッチングを高速に行うことができる。 As described above, the Hadoop cluster according to the present embodiment assigns identifiers to value patterns that are combinations of two elements out of three elements included in graph data, and uses the identifiers to execute MapReduce processing. . As a result, when searching for graph data in the MapReduce process, the search can be performed using an identifier with a small data area, and matching at the time of search can be performed at high speed.

さらに、本実施例に係るHadoopクラスタは、実際のRDFデータの中には存在しないvalueパターンを除いて識別子対応表を作成する。これにより、存在しないRDFデータを用いた処理を省くことができ、検索速度がさらに向上する。例えば、RDFデータに存在しないvalueパターンを用いた検索操作の指示を受けた場合、本実施例に係るHadoopクラスタは、MapReduce処理を行わずに結果を返すことができる。 Furthermore, the Hadoop cluster according to this embodiment creates an identifier correspondence table by excluding value patterns that do not exist in actual RDF data. As a result, processing using non-existent RDF data can be omitted, further improving search speed. For example, when receiving an instruction for a search operation using a value pattern that does not exist in RDF data, the Hadoop cluster according to this embodiment can return a result without performing MapReduce processing.

次に実施例2について説明する。本実施例に係るHadoopクラスタは、検索の対象とするデータとしてvalueパターンと対応するkeyとが登録された分割データ表を用いることが実施例1と異なる。本実施例に係るHadoopクラスタ10も図1及び2で表される。以下の説明では、実施例1と同様の各部の機能については説明を省略する。 Next, Example 2 will be described. The Hadoop cluster according to the present embodiment differs from the first embodiment in that a divided data table in which value patterns and corresponding keys are registered is used as data to be searched. A Hadoop cluster 10 according to this embodiment is also represented in FIGS. In the following description, descriptions of the functions of the same units as in the first embodiment will be omitted.

第2生成部116は、RDFコントローラ117を介してR全てのRDFデータ及び識別対応表をRDFストア110から取得する。次に、第2生成部116は、各RDFデータの主語、述語及び目的語のうち2つの組み合わせた値を取得し、識別子対応表からその組み合わせの値と一致するvalueパターンに対応する識別子を取得する。そして、第2生成部116は、主語、述語及び目的語のうちの2つを組み合わせ毎に、valueパターンに対応するパターン識別子と、主語、述語及び目的語のうちvalueパターンに含まれる2要素以外の残りの1要素とを対応させて分割データ表を生成する。 The second generator 116 acquires all R RDF data and the identification correspondence table from the RDF store 110 via the RDF controller 117 . Next, the second generation unit 116 acquires a combined value of two of the subject, predicate, and object of each RDF data, and acquires an identifier corresponding to the value pattern that matches the combined value from the identifier correspondence table. do. Then, for each combination of two of the subject, predicate, and object, the second generation unit 116 generates a pattern identifier corresponding to the value pattern, is associated with the remaining one element of to generate a split data table.

図11は、分割データ表の一例を表す図である。本実施例に係る第2生成部116は、図11に示すようにkeyの種類多一致するデータ毎にパターン識別情報とkeyとを一致させる分割データ表501~503を生成する。 FIG. 11 is a diagram showing an example of a divided data table. As shown in FIG. 11, the second generation unit 116 according to the present embodiment generates divided data tables 501 to 503 that match the pattern identification information and the key for each data that has multiple matching key types.

具体的には、第2生成部116は、述語と目的語との組み合わせを表すvalueパターンに対応するパターン識別子と主語との対応を表す分割データ表501を生成する。また、第2生成部116は、主語と述語との組み合わせを表すvalueパターンに対応するパターン識別子と目的語との対応を表す分割データ表502を生成する。また、分割データ表502は、主語と目的語との組み合わせを表すvalueパターンに対応するパターン識別子と述語との対応を表す分割データ表503を生成する。そして、第2生成部116は、RDFコントローラ117を介してRDFストア110に生成した分割データ表501~503を格納させる。 Specifically, the second generating unit 116 generates the divided data table 501 representing the correspondence between the pattern identifier corresponding to the value pattern representing the combination of the predicate and the object and the subject. The second generating unit 116 also generates a divided data table 502 representing the correspondence between the pattern identifier corresponding to the value pattern representing the combination of the subject and the predicate and the object. Also, the divided data table 502 generates a divided data table 503 representing the correspondence between the pattern identifier corresponding to the value pattern representing the combination of the subject and the object and the predicate. Then, the second generating unit 116 stores the generated divided data tables 501 to 503 in the RDF store 110 via the RDF controller 117 .

ネームノード112は、分割データ表の一部の行データを含むブロックを各データノード121へ送信する。データノード121は、分割データ表の一部の行データを含むブロックをHDFS122に格納する。 The namenode 112 transmits a block containing partial row data of the partitioned data table to each datanode 121 . The data node 121 stores in the HDFS 122 blocks containing partial row data of the partitioned data table.

Mapタスク実行部241は、Mapタスクの実行指示をタスクトラッカー123から受信する。そして、Mapタスク実行部241は、Mapタスクで使用するテーブルを選択する。例えば、Mapタスクが述語と目的語とを組み合わせたvalueパターン用いるMap処理の場合、Mapタスク実行部241は、述語と目的語とを組み合わせたvalueパターンが登録された分割データ表を選択する。図11を用いた場合を例に説明すると、例えば、主語と述語との組み合わせのvalueパターンを用いたMap処理の場合、Mapタスク実行部241は、分割データ表501を選択する。 The Map task execution unit 241 receives a Map task execution instruction from the task tracker 123 . The Map task execution unit 241 then selects a table to be used in the Map task. For example, if the Map task uses a value pattern that combines a predicate and an object, the Map task execution unit 241 selects a divided data table in which a value pattern that combines a predicate and an object is registered. Taking the case of FIG. 11 as an example, for example, in the case of Map processing using value patterns of combinations of subjects and predicates, the Map task execution unit 241 selects the divided data table 501 .

そして、Mapタスク実行部241は、HDFS122に格納された各ブロックに対して、タスクトラッカー123から実行の指示を受けたMapタスクを実行する。その後、Mapタスク実行部241は、Map処理、並びに、シャッフル及びソート処理を実行した結果をReduceタスク実行部242へ出力する。 Then, the Map task executing unit 241 executes the Map task instructed to execute by the task tracker 123 for each block stored in the HDFS 122 . After that, the Map task execution unit 241 outputs the result of executing the Map processing and the shuffle and sort processing to the Reduce task execution unit 242 .

ここで、図12を参照して、実施例2に係るMapタスク実行部241によるMap処理の流れについて説明する。図12は、実施例2に係るパラメータ識別子を用いた場合のMapReduce処理の概要を表す図である。ここでは、図12に記載された分割データ表511及び521のそれぞれが異なるMapReduce処理部124で処理される場合で説明する。 Now, with reference to FIG. 12, the flow of Map processing by the Map task execution unit 241 according to the second embodiment will be described. FIG. 12 is a diagram illustrating an overview of MapReduce processing when using parameter identifiers according to the second embodiment. Here, a case where the divided data tables 511 and 521 shown in FIG. 12 are processed by different MapReduce processing units 124 will be described.

例えば、図12では、Mapタスク実行部241は、太枠で囲われたパラメータ識別子である1002をvalueとして抽出するMapタスクを取得する。次に、Mapタスク実行部241は、分割データ表511又は521からMap処理を行う対象とするデータを取得する。この場合、分割データ表511及び521のデータは既にkey=valueの形式であるので、各Mapタスク実行部241は、分割データ表511又は521のデータをそのまま入力とすることができる。 For example, in FIG. 12, the Map task execution unit 241 acquires a Map task that extracts the parameter identifier 1002 surrounded by a thick frame as a value. Next, the Map task execution unit 241 acquires data to be subjected to Map processing from the divided data table 511 or 521 . In this case, since the data of the divided data tables 511 and 521 are already in the format of key=value, each Map task execution unit 241 can directly input the data of the divided data tables 511 and 521 .

そして、各Mapタスク実行部241は、入力されたデータからvalueにあたるパターン識別子が1002であるデータ512又は522を抽出する。次に、各Mapタスク実行部241は、抽出したデータ512又は522に対してシャッフル及びソート処理を実行しデータ513及び523を取得する。 Then, each Map task execution unit 241 extracts data 512 or 522 whose pattern identifier is 1002 and corresponds to value from the input data. Next, each Map task execution unit 241 performs shuffle and sort processing on the extracted data 512 or 522 to acquire data 513 and 523 .

Reduceタスク実行部242は、Map処理、並びに、シャッフル及びソート処理の結果をMapタスク実行部241から取得する。そして、Reduceタスク実行部242は、取得したデータに対してReduce処理を行う。 The Reduce task execution unit 242 acquires the results of Map processing and shuffle and sort processing from the Map task execution unit 241 . Then, the Reduce task execution unit 242 performs Reduce processing on the acquired data.

ここで、図12を参照して、実施例2に係るReduceタスク実行部242によるReduce処理の流れについて説明する。各Reduceタスク実行部242は、データ513又は523の入力をそれぞれ対応するMapタスク実行部241から受ける。次に、各Reduceタスク実行部242は、取得したデータ513又は523から同じkeyを有するデータの数を集計する。そして、各Reduceタスク実行部242は、Reduce処理の結果514又は524をタスクトラッカー123へ出力する。 Here, a flow of Reduce processing by the Reduce task execution unit 242 according to the second embodiment will be described with reference to FIG. 12 . Each Reduce task execution unit 242 receives input of data 513 or 523 from the corresponding Map task execution unit 241 . Next, each Reduce task execution unit 242 tallies the number of data having the same key from the acquired data 513 or 523 . Then, each Reduce task execution unit 242 outputs the result 514 or 524 of the Reduce process to the task tracker 123 .

以上に説明したように、本実施例に係るHadoopクラスタは、valueパターンに対応する識別子とその識別子に対応するkeyとの対応を表す分割データ表を用いてMapReduec処理を実行する。本実施例に係るHadoopクラスタは、Map処理の目的に応じて分割データ表を選択する。各分割データ表は実施例1で用いた識別子付RDFデータ表よりもサイズが小さいため、実施例1に比べてメモリの消費量を抑えることができ、且つ、表のスキャンを迅速に行うことができる。 As described above, the Hadoop cluster according to the present embodiment executes MapReduce processing using a partitioned data table representing correspondence between identifiers corresponding to value patterns and keys corresponding to the identifiers. The Hadoop cluster according to this embodiment selects a partitioned data table according to the purpose of Map processing. Since each divided data table is smaller in size than the identifier-added RDF data table used in the first embodiment, the memory consumption can be suppressed and the table can be scanned quickly compared to the first embodiment. can.

ここで、以上の各実施例では、Hadoopクラスタを用いて説明したが、システムの構成はこれに限らず、3つの要素を有するデータを2つの要素に対する処理に対して用いるシステムであれば他のシステム構成でもよい。また、以上の各実施例ではRDFデータを用いて説明したが、グラフデータで有れば他のデータを用いても同様の処理を行うことができ、同様の効果を得ることができる。 Here, in each of the above embodiments, a Hadoop cluster was used for explanation, but the system configuration is not limited to this, and other systems may be used as long as the system uses data having three elements for processing two elements. system configuration. Further, although the RDF data is used in the above embodiments, the same processing can be performed using other data as long as it is graph data, and the same effects can be obtained.

(ハードウェア構成)
上述してきた各実施例に係るマスタサーバ11及びスレーブサーバ12は、例えば図13に示すようなハードウェア構成を有するコンピュータで実現できる。図13は、コンピュータのハードウェア構成の一例を表す図である。コンピュータ90は、CPU(Central Processing Unit)91、RAM(Random Access Memory)92、ROM(Read Only Memory)93及びHDD(Hard Disk Drive)94を有する。さらに、コンピュータ90は、通信インターフェイス(I/F:Interface)95、入出力インターフェイス(I/F)96、及びメディアインターフェイス(I/F)97を有する。
(Hardware configuration)
The master server 11 and slave server 12 according to each of the embodiments described above can be realized by a computer having a hardware configuration as shown in FIG. 13, for example. FIG. 13 is a diagram illustrating an example of the hardware configuration of a computer; The computer 90 has a CPU (Central Processing Unit) 91 , RAM (Random Access Memory) 92 , ROM (Read Only Memory) 93 and HDD (Hard Disk Drive) 94 . Further, the computer 90 has a communication interface (I/F) 95 , an input/output interface (I/F) 96 and a media interface (I/F) 97 .

CPU91は、ROM93またはHDD94に格納されたプログラムに基づいて動作し、各部の制御を行う。ROM93は、コンピュータ90の起動時にCPU91によって実行されるブートプログラムや、コンピュータ90のハードウェアに依存するプログラム等を格納する。 CPU91 operates based on the program stored in ROM93 or HDD94, and controls each part. The ROM 93 stores a boot program executed by the CPU 91 when the computer 90 is started, a program depending on the hardware of the computer 90, and the like.

HDD94は、CPU91によって実行されるプログラム、及び、かかるプログラムによって使用されるデータ等を格納する。通信インターフェイス95は、ネットワークを介して他の機器からデータを受信してCPU91へ送り、CPU91が生成したデータをネットワークを介して他の機器へ送信する。 The HDD 94 stores programs executed by the CPU 91 and data used by these programs. The communication interface 95 receives data from other devices via the network, sends the data to the CPU 91, and transmits data generated by the CPU 91 to the other devices via the network.

CPU91は、入出力インターフェイス96を介して、ディスプレイやプリンタ等の出力装置、及び、キーボードやマウス等の入力装置を制御する。CPU91は、入出力インターフェイス96を介して、入力装置からデータを取得する。また、CPU91は、生成したデータを入出力インターフェイス96を介して出力装置へ出力する。 The CPU 91 controls output devices such as a display and a printer and input devices such as a keyboard and a mouse through an input/output interface 96 . The CPU 91 acquires data from the input device via the input/output interface 96 . The CPU 91 also outputs the generated data to the output device via the input/output interface 96 .

メディアインターフェイス97は、記録媒体98に格納されたプログラムまたはデータを読み取り、RAM92を介してCPU91に提供する。CPU91は、かかるプログラムを、メディアインターフェイス97を介して記録媒体98からRAM92上にロードし、ロードしたプログラムを実行する。記録媒体98は、例えばDVD(Digital Versatile Disc)、PD(Phase change rewritable Disk)等の光学記録媒体、MO(Magneto-Optical disk)等の光磁気記録媒体、テープ媒体、磁気記録媒体、または半導体メモリ等である。 The media interface 97 reads programs or data stored in the recording medium 98 and provides them to the CPU 91 via the RAM 92 . The CPU 91 loads the program from the recording medium 98 onto the RAM 92 via the media interface 97 and executes the loaded program. The recording medium 98 is, for example, an optical recording medium such as a DVD (Digital Versatile Disc) or a PD (Phase change rewritable disc), a magneto-optical recording medium such as an MO (Magneto-Optical disk), a tape medium, a magnetic recording medium, or a semiconductor memory. etc.

例えば、コンピュータ90のRAM92及びHDD94は、HDFS111及び122、並びに、メタデータDB113の機能を実現する。さらに、コンピュータ90のCPU91は、RAM92上にロードされたプログラムを実行することにより、ネームノード112、ジョブトラッカー114、第1生成部115、第2生成部116の機能と実現する。また、コンピュータ90のCPU91は、RDFコントローラ117、SPARQL処理部118及びMapReduce処理部119の機能を実現する。さらに、コンピュータ90のCPU91は、データノード121、タスクトラッカー123及びMapReduce処理部124の機能を実現する。 For example, the RAM 92 and HDD 94 of the computer 90 implement the functions of HDFS 111 and 122 and metadata DB 113 . Furthermore, the CPU 91 of the computer 90 implements the functions of the name node 112, the job tracker 114, the first generator 115, and the second generator 116 by executing the programs loaded on the RAM 92. FIG. Also, the CPU 91 of the computer 90 implements the functions of the RDF controller 117 , the SPARQL processing unit 118 and the MapReduce processing unit 119 . Furthermore, the CPU 91 of the computer 90 implements the functions of the data node 121 , task tracker 123 and MapReduce processing unit 124 .

コンピュータ90のCPU91は、これらのプログラムをHDD94から読み取って実行するが、他の例として、記録媒体98からプログラムを読みとってもよいし、他の装置からネットワークを介してこれらのプログラムを取得してもよい。 The CPU 91 of the computer 90 reads these programs from the HDD 94 and executes them, but as another example, the programs may be read from the recording medium 98 or obtained from another device via a network. good.

ここで、以上の説明では、SPARQL処理部118が、SPARQLクエリで指定された検索対象のvalueパターンに対応するパターン識別子を識別子対応表から取得しする場合で説明したが、この処理はスレーブサーバ12側で実行することも可能である。例えば、スレーブサーバ12のMapReduce処理部124が、検索対象のvalueパターンに対応するパターン識別子を識別子対応表から取得して、取得したパターン識別子を用いてMapReduce処理を実行してもよい。 Here, in the above description, the case where the SPARQL processing unit 118 acquires the pattern identifier corresponding to the value pattern to be searched specified in the SPARQL query from the identifier correspondence table has been described. It is also possible to run on the side. For example, the MapReduce processing unit 124 of the slave server 12 may acquire the pattern identifier corresponding to the value pattern to be searched from the identifier correspondence table and execute the MapReduce processing using the acquired pattern identifier.

次に、実施例3について説明する。HadoopによるMapReduce処理では、入力データと最終の出力データは共にHDFSに格納される。さらに、HadoopによるMapReduce処理では、Map処理において、生成される中間ファイルも、一時的にHDFSに格納される。そのため、Map処理において、HDFSに対する中間ファイルの入出力が行われる。HDFSは、HDDやSSD(Solid State Drive)に配置されるファイルシステムであり、演算処理に比べて読み書きにかかる時間が大きい。そのため、HadoopによるMapReduce処理を行う場合、遅延が発生するおそれがある。 Next, Example 3 will be described. In MapReduce processing by Hadoop, both input data and final output data are stored in HDFS. Furthermore, in MapReduce processing by Hadoop, an intermediate file generated in Map processing is also temporarily stored in HDFS. Therefore, intermediate files are input/output to/from HDFS in Map processing. HDFS is a file system arranged in HDDs and SSDs (Solid State Drives), and the time required for reading and writing is longer than for arithmetic processing. Therefore, when performing MapReduce processing by Hadoop, there is a possibility that a delay may occur.

そこで、MapReduce処理を行う際に、メモリ上のデータを用いて処理を行うインメモリ処理を用いることで、HDFSへのアクセスを減らして、処理速度を向上させる方法が考えられる。例えば、分散型のインメモリ処理として、Spark(登録商標)を用いた処理が存在する。Sparkを用いることで、インメモリでMapReduceを行うことができる。 Therefore, a method of reducing access to HDFS and improving processing speed by using in-memory processing that performs processing using data in memory when performing MapReduce processing is conceivable. For example, as distributed in-memory processing, there is processing using Spark (registered trademark). MapReduce can be performed in-memory by using Spark.

Sparkでは、ストレージとして、HadoopのHDFSが利用される。そのため、Sparkを用いた場合にも、入力データ及び最終の出力データは、HDFSに格納される。一方、Map処理における中間データはRDD(Resilient Distributed Dataset)形式でメモリ上に保持され、HDFSに格納されることなく連続的に処理される。そのため、深層学習などにおいて処理結果を用いてMap処理を繰り返す場合などでは、HadoopによるMapReduce処理よりも処理速度をより向上させることが可能である。 Spark uses Hadoop HDFS as storage. Therefore, even when Spark is used, input data and final output data are stored in HDFS. On the other hand, intermediate data in map processing is held in memory in RDD (Resilient Distributed Dataset) format, and is processed continuously without being stored in HDFS. Therefore, in the case of repeating Map processing using processing results in deep learning or the like, it is possible to further improve the processing speed compared to MapReduce processing by Hadoop.

しかしながら、Sparkのような分散型のインメモリ処理を用いてメインメモリでデータ処理を完結させる場合、識別子対応表をメモリ上に展開する構成では、識別子対応表のサイズが大きいとメモリ上に展開することが困難である。その場合、メモリ内でMap処理に割り当てるメモリ容量が不足するため、処理速度が低下するおそれがある。 However, when data processing is completed in the main memory using distributed in-memory processing such as Spark, in the configuration where the identifier correspondence table is developed in memory, if the size of the identifier correspondence table is large, it is developed in memory. is difficult. In that case, there is a possibility that the processing speed will decrease because the memory capacity allocated to the Map processing in the memory will be insufficient.

そこで、本実施例に係る情報処理システムでは、識別子対応表を分割することでメモリ上に展開する識別子対応表を小さくする。以下では、Sparkを用いたMapReduce処理における分割した識別子対応表の使用について主に説明する。図14は、実施例3に係るマスタサーバ及びスレーブサーバの詳細を表すブロック図である。以下の説明では、実施例1と同様の各部の動作は説明を省略する。 Therefore, in the information processing system according to the present embodiment, the identifier correspondence table to be expanded on the memory is reduced by dividing the identifier correspondence table. The following mainly describes the use of the divided identifier correspondence table in the MapReduce process using Spark. FIG. 14 is a block diagram showing details of a master server and slave servers according to the third embodiment. In the following description, the description of the operation of each unit similar to that of the first embodiment will be omitted.

図14に示すように、マスタサーバ11は、実施例1の各部に加えてSpark処理部131を有する。また、スレーブサーバ12は、実施例1の各部に加えてSSD125及びメモリ126を有する。さらに、本実施例に係るスレーブサーバ12のMapReduce処理部124は、Mapタスク実行部241及びReduceタスク実行部242に加えて、メモリ管理部243を有する。 As shown in FIG. 14, the master server 11 has a Spark processing unit 131 in addition to each unit of the first embodiment. Also, the slave server 12 has an SSD 125 and a memory 126 in addition to the components of the first embodiment. Furthermore, the MapReduce processing unit 124 of the slave server 12 according to this embodiment has a memory management unit 243 in addition to the Map task execution unit 241 and the Reduce task execution unit 242 .

第1生成部115は、識別子対応表の生成の指示をHDFSクライアント20から受ける。そして、第1生成部115は、RDFストア110に登録された全てのRDFデータの主語、述語及び目的語の取得をRDFコントローラ117に指示する。その後、第1生成部115は、RDFストア110に登録された全てのRDFデータの主語、述語及び目的語をRDFコントローラ117から取得する。 The first generation unit 115 receives an instruction to generate an identifier correspondence table from the HDFS client 20 . The first generator 115 then instructs the RDF controller 117 to acquire the subject, predicate and object of all RDF data registered in the RDF store 110 . After that, the first generator 115 acquires the subjects, predicates and objects of all RDF data registered in the RDF store 110 from the RDF controller 117 .

次に、第1生成部115は、取得した主語、述語及び目的語のそれぞれの重複を除いて集計する。そして、第1生成部115は、集計した主語、述語及び目的語を用いて、全ての通りの組み合わせのvalueバターンを生成する。次に、第1生成部115は、実際の各RDFデータの主語、述語及び目的語の組み合わせに含まれないvalueパターン以外のvalueパターンを抽出して、識別子を割り当てる。そして、第1生成部115は、実際の各RDFデータの主語、述語及び目的語の組の中に含まれないvalueパターンについては、不存在を表す情報を付加して、各valueパターンと割り当てたパターン識別子との対応を表す識別子対応表を作成する。 Next, the first generating unit 115 tabulates the obtained subjects, predicates, and objects by removing duplicates. Then, the first generation unit 115 generates value patterns of all possible combinations using the aggregated subjects, predicates, and objects. Next, the first generation unit 115 extracts value patterns other than value patterns that are not included in the actual combinations of subject, predicate and object of each RDF data, and assigns identifiers to them. Then, the first generating unit 115 adds information indicating the absence of value patterns that are not included in the set of the subject, predicate, and object of each RDF data, and assigns them to each value pattern. Create an identifier correspondence table representing the correspondence with pattern identifiers.

この段階では、第1生成部115は、図15に示す識別子対応表213が生成される。図15は、分割前の識別子対応表の一例を表す図である。この識別子対応表213には、述語と目的語とを組み合わせたValueバターンを表す領域214、主語と述語とを組み合わせたvalueバターンを表す領域215、主語と目的語とを組み合わせたValueバターンを表す領域216が含まれる。 At this stage, first generation unit 115 generates identifier correspondence table 213 shown in FIG. FIG. 15 is a diagram showing an example of the identifier correspondence table before division. This identifier correspondence table 213 includes an area 214 representing a value pattern combining a predicate and an object, an area 215 representing a value pattern combining a subject and a predicate, and an area representing a value pattern combining a subject and an object. 216 are included.

ここで、例えば、「select ? s where {?s likes C}」といったSPARQLクエリでは、述語と目的語とを組み合わせたvalueパターンが検索される。すなわち、このSPARQLクエリでは、識別子対応表213の中の領域215及び216は、検索対象としなくてもよい。このように、検索が、対応する主語を検出する主語基準の検索なのか、対応する目的語を検出する目的語基準の検索なのか、又は、対応する述語を検出する述語基準の検索なのかにより、識別子対応表213において実際に必要となる領域が異なる。 Here, for example, in a SPARQL query such as "select ?s where {?s likes C}", a value pattern combining a predicate and an object is retrieved. That is, in this SPARQL query, the areas 215 and 216 in the identifier correspondence table 213 do not have to be searched. Thus, depending on whether the search is a subject-based search that finds the corresponding subject, an object-based search that finds the corresponding object, or a predicate-based search that finds the corresponding predicate, , the areas actually required in the identifier correspondence table 213 are different.

そして、第1生成部115は、識別子対応表213を分割して、図16に示す主語基準の検索用の分割識別子対応表231、目的語基準の検索用の分割識別子対応表232及び述語基準の検索用の分割識別子対応表233を生成する。図16は、分割識別子対応表の一例を表す図である。 Then, the first generating unit 115 divides the identifier correspondence table 213 into a divided identifier correspondence table 231 for subject-based retrieval, a divided identifier correspondence table 232 for object-based retrieval, and a predicate-based A split identifier correspondence table 233 for retrieval is generated. FIG. 16 is a diagram showing an example of a division identifier correspondence table.

その後、第1生成部115は、生成した分割識別子対応表231~233をRDFコントローラ117へ送信し、RDFストア110への格納を指示する。さらに、第1生成部115は、識別子対応表の生成完了を第2生成部116に通知する。これにより、RDFコントローラ117によって、RDFストア110へ、分割識別子対応表231~233が格納される。 After that, the first generation unit 115 transmits the generated split identifier correspondence tables 231 to 233 to the RDF controller 117 and instructs the RDF store 110 to store them. Furthermore, the first generation unit 115 notifies the second generation unit 116 of completion of generation of the identifier correspondence table. As a result, the division identifier correspondence tables 231 to 233 are stored in the RDF store 110 by the RDF controller 117 .

SPARQL処理部118は、SPARQLクエリの入力をジョブクライアント30から受ける。そして、SPARQL処理部118は、取得したSPARQLクエリを解析してMapReduce処理に変換する。その後、SPARQL処理部118は、パターン識別子を含むMapReduce処理をSpark処理部131に出力する。さらに、SPARQL処理部118は、分割識別子対応表231~233の送信要求をネームノード112に通知する。 The SPARQL processing unit 118 receives SPARQL query input from the job client 30 . Then, the SPARQL processing unit 118 analyzes the obtained SPARQL query and converts it into MapReduce processing. After that, the SPARQL processing unit 118 outputs MapReduce processing including the pattern identifier to the Spark processing unit 131 . Furthermore, the SPARQL processing unit 118 notifies the name node 112 of a transmission request for the division identifier correspondence tables 231 to 233. FIG.

ネームノード112は、分割識別子対応表231~233の送信要求の通知をSPARQL処理部118から受信する。そして、ネームノード112は、RDFストア110から分割識別子対応表231~233を取得し、データノード121へ送信する。また、ネームノード112は、識別子付RDFデータ表の一部の行データを含むブロックを選択したデータノード121へ送信し配置する。 The name node 112 receives from the SPARQL processing unit 118 notification of the transmission request for the split identifier correspondence tables 231 to 233 . The name node 112 then acquires the split identifier correspondence tables 231 to 233 from the RDF store 110 and transmits them to the data node 121 . Also, the name node 112 transmits and arranges a block including a part of row data of the RDF data table with identifier to the selected data node 121 .

Spark処理部131は、Sparkを用いて実行するMapReduce処理の入力をSPARQL処理部118から受ける。次に、Spark処理部131は、受信したMapReduce処理に含まれる個々のMapReduce処理を取得する。そして、Spark処理部131は、取得したMapReduce処理の実行をジョブトラッカー114に指示する。さらに、深層学習などにおいて実行結果を用いてMapReduce処理が繰り返し行われる場合、Spark処理部131は、繰り返しの手順を管理して、ジョブトラッカー114にメモリ126の上でのMapReduce処理の繰り返しの実行を指示する。 The Spark processing unit 131 receives from the SPARQL processing unit 118 an input for MapReduce processing to be executed using Spark. Next, the Spark processing unit 131 acquires each MapReduce process included in the received MapReduce process. Then, the Spark processing unit 131 instructs the job tracker 114 to execute the acquired MapReduce process. Furthermore, when MapReduce processing is repeatedly performed using execution results in deep learning or the like, the Spark processing unit 131 manages the repetition procedure and instructs the job tracker 114 to repeatedly execute the MapReduce processing on the memory 126. instruct.

その後、Spark処理部131は、MapReduce処理の実行結果の入力をジョブトラッカー114から受ける。そして、Spark処理部131は、MapReduce処理の実行結果をSPARQL処理部118へ出力する。この場合のSpark処理部131は、Sparkにおける「Driver」にあたる。 After that, the Spark processing unit 131 receives an input of the execution result of the MapReduce process from the job tracker 114 . The Spark processing unit 131 then outputs the execution result of the MapReduce processing to the SPARQL processing unit 118 . The Spark processing unit 131 in this case corresponds to "Driver" in Spark.

データノード121は、識別子付RDFデータ表の一部の行データを含むブロックをネームノード112から受信する。ここで、データノード121は、複数のブロックを受信してもよい。そして、データノード121は、取得したブロックを自装置のHDFS122へ格納する。 The data node 121 receives from the name node 112 a block containing partial row data of the RDF data table with identifier. Here, data node 121 may receive multiple blocks. Then, the data node 121 stores the obtained block in the HDFS 122 of its own device.

また、データノード121は、分割識別子対応表231~233をネームノード112から受信する。そして、データノード121は、取得した分割識別子対応表231~233を次装置のHDFS122へ格納する。 The data node 121 also receives the division identifier correspondence tables 231 to 233 from the name node 112 . Then, the data node 121 stores the acquired split identifier correspondence tables 231 to 233 in the HDFS 122 of the next device.

本実施例に係るMapReduce処理部124は、Mapタスク実行部241、Reduceタスク実行部242及びメモリ管理部243を有する。MapReduce処理部124は、Mapタスクをタスクトラッカー123から取得し、Sparkを用いたMapReduce処理を実行する。この場合のMapReduce処理部124は、Sparkにおける「Exector」にあたる。以下にSparkを用いたMapReduce処理の詳細を説明する。 The MapReduce processing unit 124 according to this embodiment has a Map task execution unit 241 , a Reduce task execution unit 242 and a memory management unit 243 . The MapReduce processing unit 124 acquires a Map task from the task tracker 123 and executes MapReduce processing using Spark. The MapReduce processing unit 124 in this case corresponds to "Exector" in Spark. The details of the MapReduce process using Spark will be described below.

メモリ管理部243は、タスクトラッカー123から取得したMapタスクで指定された検索するvalueパターンを取得する。そして、メモリ管理部243は、そのvalueパターンによる検索が、主語基準の検索、目的語基準の検索、又は、述語基準の検索のいずれにあたるかを特定する。そして、メモリ管理部243は、分割識別子対応表231~233のうち特定した種類の検索に対応する表をSSD125から取得する。ここでは、主語基準の検索を行う場合で説明する。すなわち、メモリ管理部243は、主語基準の検索用の分割識別子対応表231をSSD125から取得する。そして、メモリ管理部243は、取得した分割識別子対応表231をRDDに変換する。その後、メモリ管理部243は、RDDに変換した分割識別子対応表231をメモリ126上に展開する。 The memory management unit 243 acquires the value pattern to be searched specified in the Map task acquired from the task tracker 123 . Then, the memory management unit 243 specifies whether the search by the value pattern corresponds to a subject-based search, an object-based search, or a predicate-based search. Then, the memory management unit 243 acquires from the SSD 125 a table corresponding to the identified type of search among the division identifier correspondence tables 231 to 233 . Here, a case where subject-based retrieval is performed will be described. That is, the memory management unit 243 acquires the split identifier correspondence table 231 for subject-based retrieval from the SSD 125 . Then, the memory management unit 243 converts the acquired division identifier correspondence table 231 into an RDD. After that, the memory management unit 243 develops the split identifier correspondence table 231 converted into the RDD on the memory 126 .

また、メモリ管理部243は、HDFS122に格納された識別子付RDFデータ表の一部の行データを含むブロックを取得する。そして、メモリ管理部243は、取得したブロックをRDDに変換する。その後、メモリ管理部243は、RDDに変換したブロックをメモリ126上に展開する。RDDは、不変で並列実行可能な分割されたコレクションである。RDDは、メモリ上に保持することが可能で、耐障害性、データ局所性などの特徴を有する。 Also, the memory management unit 243 acquires a block containing part of row data of the identifier-attached RDF data table stored in the HDFS 122 . The memory management unit 243 then converts the acquired block into an RDD. After that, the memory management unit 243 develops the blocks converted into RDDs on the memory 126 . An RDD is a partitioned collection that is immutable and can be executed in parallel. An RDD can be held in memory and has features such as fault tolerance and data locality.

その後、メモリ管理部243は、Reduceタスク実行部242からReduce処理の完了の通知を受けると、MapReduce処理の実行結果をメモリ126から取得する。そして、メモリ管理部243は、取得したMapReduce処理の実行結果をRDDの形式からHDFS111への格納用のデータ形式に直してHDFS122へ格納する。すなわち、HDFS122には、MapReduce処理に使用するデータが格納された識別子付RDFデータ表及びMapReduce処理の実行結果が格納される。 After that, when the memory management unit 243 receives notification of the completion of the Reduce process from the Reduce task execution unit 242 , it acquires the execution result of the MapReduce process from the memory 126 . Then, the memory management unit 243 converts the acquired execution result of the MapReduce process from the RDD format to the data format for storage in the HDFS 111 and stores it in the HDFS 122 . That is, the HDFS 122 stores an identifier-attached RDF data table in which data used in the MapReduce process is stored, and the execution result of the MapReduce process.

Mapタスク実行部241は、タスクトラッカー123から実行の指示を受けたSparkを用いたMapタスクにおけるMap処理を実行する。具体的には、Mapタスク実行部241は、Mapタスクで指定された検索対象となるvalueパターンを取得する。そして、Mapタスク実行部241は、取得したvalueパターンでメモリ126上の分割識別子対応表231を検索して、valueパターンに対応するパラメータ識別子を取得する。 The Map task execution unit 241 executes Map processing in a Map task using Spark that has received an execution instruction from the task tracker 123 . Specifically, the Map task execution unit 241 acquires the value pattern to be searched specified by the Map task. Then, the Map task execution unit 241 searches the divided identifier correspondence table 231 on the memory 126 with the acquired value pattern to acquire the parameter identifier corresponding to the value pattern.

次に、Mapタスク実行部241は、識別子付RDFデータ表からMap処理を行う対象とするデータを取得してkey=value形式のデータに変換しそのデータを入力とする。次に、Mapタスク実行部241は、RDDに変換された入力データの中からvalueが取得したパターン識別子と一致するデータを抽出する。次に、Mapタスク実行部241は、抽出したデータに対してシャッフル及びソート処理を実行する。そして、各Mapタスク実行部241は、シャッフル及びソート処理を実行したデータをReduceタスク実行部242へ出力する。 Next, the Map task execution unit 241 acquires data to be subjected to Map processing from the identifier-attached RDF data table, converts the data into key=value format data, and inputs the data. Next, the Map task execution unit 241 extracts data that matches the pattern identifier obtained by value from the input data converted to RDD. Next, the Map task execution unit 241 shuffles and sorts the extracted data. Each Map task execution unit 241 then outputs the shuffled and sorted data to the Reduce task execution unit 242 .

ここで、Mapタスク実行部241は、以上の処理の際に生成される中間データはRDD形式でメモリ126上に保持しつつ、以上の処理を連続的に実行する。特に、深層学習などにおいてMapReduce処理の実行結果を繰り返し用いて処理を行う場合、Mapタスク実行部241は、メモリ126に対するデータの読み出し及び書き込みにより連続的に繰り返し処理を実行することができる。 Here, the Map task execution unit 241 continuously executes the above processes while holding intermediate data generated during the above processes in the memory 126 in RDD format. In particular, when performing processing by repeatedly using the execution results of the MapReduce processing in deep learning or the like, the Map task execution unit 241 can continuously and repeatedly perform processing by reading data from and writing data to the memory 126 .

Reduceタスク実行部242は、Reduce処理を行う。Reduce処理は、Reduceの設計者が予め決めた処理を実行することができる。例えば、Reduceタスク実行部242は、値の合計や集約などの処理を行う。その後、Reduceタスク実行部242は、MapReduce処理の実行結果をメモリ126に格納する。さらに、Reduceタスク実行部242は、Reduce処理の完了をメモリ管理部243及びタスクトラッカー123へ通知する。 The Reduce task execution unit 242 performs Reduce processing. The Reduce process can execute a process predetermined by the Reduce designer. For example, the Reduce task execution unit 242 performs processing such as totaling and aggregating values. After that, the Reduce task execution unit 242 stores the execution result of the MapReduce process in the memory 126 . Furthermore, the Reduce task execution unit 242 notifies the memory management unit 243 and the task tracker 123 of the completion of the Reduce process.

タスクトラッカー123は、Reduce処理の完了の通知をReduceタスク実行部242から受ける。そして、タスクトラッカー123は、MapReduce処理の実行結果をHDFS122から取得し、ジョブトラッカー114へ送信する。 The task tracker 123 receives notification of the completion of the Reduce process from the Reduce task execution unit 242 . The task tracker 123 acquires the execution result of the MapReduce process from the HDFS 122 and transmits it to the job tracker 114 .

ここで、以上の説明では、スレーブサーバ12が保持するSSD125に分割識別子対応表231~233を格納する構成で説明したが、分割識別子対応表231~233の配置場所に特に制限は無い。例えば、マスタサーバ11に分割識別子対応表231~233を配置して、スレーブサーバ12のメモリ管理部243が、マスタサーバ11から分割識別子対応表231~233を取得する構成であってもよい。 Here, in the above description, the partition identifier correspondence tables 231 to 233 are stored in the SSD 125 held by the slave server 12, but there is no particular restriction on the location of the partition identifier correspondence tables 231 to 233. For example, the split identifier correspondence tables 231 to 233 may be arranged in the master server 11 and the memory management unit 243 of the slave server 12 may obtain the split identifier correspondence tables 231 to 233 from the master server 11 .

次に、図17を参照して、実施例3に係るパラメータ識別子を用いた場合のMapReduce処理の概要を説明する。図17は、実施例3に係るMapReduce処理の概要を表す図である。ここでは、図17に記載された識別子付RDFデータ表611及び621のそれぞれが異なるMapReduce処理部124で処理される場合で説明する。 Next, with reference to FIG. 17, an overview of the MapReduce process when using the parameter identifier according to the third embodiment will be described. FIG. 17 is a diagram illustrating an overview of MapReduce processing according to the third embodiment. Here, a case where the RDF data tables 611 and 621 with identifiers shown in FIG. 17 are processed by different MapReduce processing units 124 will be described.

例えば、図17では、Mapタスク実行部241は、SPARQLクエリが「select ?s where{?s loves C.}という構文で表されるデータ抽出をSparkを用いて行うMapタスクを取得する。メモリ管理部243は、識別子付RDFデータ表611及び621、並びに、分割識別子対応表231をRDDに変換してメモリ126上に格納する。 For example, in FIG. 17, the Map task execution unit 241 acquires a Map task that uses Spark to extract data whose SPARQL query is represented by the syntax “select ?s where {?s loves C.}. Memory management The unit 243 converts the RDF data tables 611 and 621 with identifiers and the divided identifier correspondence table 231 into RDDs and stores them in the memory 126 .

Mapタスク実行部241は、RDDに変換されメモリ上に格納された分割識別子対応表231から、「loves C」に対応するパターン識別子として1002を取得する。そして、Mapタスク実行部241は、RDDに変換された識別子付RDFデータ表411又は421からMap処理を行う対象とするデータを取得してkey=value形式のデータに変換しそのデータを入力とする。ここでは、Mapタスク実行部241は、主語とkeyとし述語及び目的語の組み合わせのvalueパターンをvalueとするデータを入力とする。 The Map task execution unit 241 acquires 1002 as a pattern identifier corresponding to "loves C" from the divided identifier correspondence table 231 converted into RDD and stored on the memory. Then, the map task execution unit 241 acquires data to be subjected to map processing from the identifier-added RDF data table 411 or 421 converted to RDD, converts it to data in the key=value format, and uses the data as input. . Here, the Map task execution unit 241 receives data with a subject and a key and a value pattern of a combination of a predicate and an object as the value.

そして、各Mapタスク実行部241は、入力のデータからvalueを表すパターン識別子が1002であるデータ612又は622を抽出してメモリ126上に格納する。そして、各Mapタスク実行部241は、抽出したデータ612又は622に対してシャッフル及びソート処理を実行し処理結果をメモリ126上に格納する。ここでは、各Mapタスク実行部241は、keyがBであるデータを一方に集め、それ以外のデータを他方に集める。さらに、各Mapタスク実行部241は、keyを基準に収集したデータをソートしてデータ613又は623を生成しメモリ126上に格納する。 Then, each Map task execution unit 241 extracts data 612 or 622 whose pattern identifier representing value is 1002 from the input data and stores it in the memory 126 . Each Map task executing unit 241 executes shuffle and sort processing on the extracted data 612 or 622 and stores the processing result in the memory 126 . Here, each Map task execution unit 241 collects data whose key is B to one side, and collects other data to the other side. Furthermore, each Map task execution unit 241 sorts the collected data based on the key to generate data 613 or 623 and stores the data 613 or 623 in the memory 126 .

Reduceタスク実行部242は、データ613又は623の入力をメモリ126から取得する。次に、Reduceタスク実行部242は、取得したデータ613又は623から同じkeyを有するデータの数を集計する。そして、Reduceタスク実行部242は、Reduce処理の結果614又は624をメモリ126上に格納する。ここで、図17の結果614及び624におけるcはカウント値を表す。 The Reduce task execution unit 242 acquires input of data 613 or 623 from the memory 126 . Next, the Reduce task execution unit 242 tallies the number of data having the same key from the acquired data 613 or 623 . Then, the Reduce task execution unit 242 stores the result 614 or 624 of the Reduce process on the memory 126 . Here, c in results 614 and 624 in FIG. 17 represents the count value.

次に、図18を参照して、実施例3に係る識別子表及び識別子付RDFデータ表の生成処理の流れについて説明する。図18は、実施例3に係る識別子表及び識別子付RDFデータ表の生成処理のフローチャートである。以下では、HDFS111との間のデータの送受信におけるRDFコントローラ117の仲介動作を省略する。 Next, with reference to FIG. 18, the flow of processing for generating an identifier table and an identifier-attached RDF data table according to the third embodiment will be described. FIG. 18 is a flowchart of processing for generating an identifier table and an identifier-attached RDF data table according to the third embodiment. In the following, the intermediate operation of the RDF controller 117 in data transmission/reception with the HDFS 111 will be omitted.

第1生成部115は、RDFストア110に格納されたRDFデータから全ての主語、述語及び目的語の重複を除いて取得する。そして、第1生成部115は、取得した主語、述語及び目的語を2つずつ組み合わせて、valueパターンを抽出する(ステップS101)。 The first generating unit 115 obtains the RDF data stored in the RDF store 110 by excluding duplication of all subjects, predicates and objects. Then, the first generation unit 115 combines two each of the obtained subjects, predicates, and objects to extract a value pattern (step S101).

次に、第1生成部115は、抽出したvalueパターンの中にRDFストア110に格納された実際のRDFデータの中に存在しないvalueパターンがあるか否かを判定する(ステップS102)。実際には存在しないvalueパターンが無い場合(ステップS102:否定)、第1生成部115は、ステップS104へ進む。 Next, the first generator 115 determines whether or not the extracted value patterns include a value pattern that does not exist in the actual RDF data stored in the RDF store 110 (step S102). If there is no value pattern that does not actually exist (step S102: No), the first generator 115 proceeds to step S104.

実際には存在しないvalueパターンがある場合(ステップS102:肯定)、第1生成部115は、抽出したvalueパターンの中から実際には存在しないvalueパターンを除いて、実際に存在するvalueパターンを抽出する(ステップS103)。 If there is a value pattern that does not actually exist (step S102: YES), the first generation unit 115 extracts the value pattern that actually exists by removing the value pattern that does not actually exist from the extracted value patterns. (step S103).

次に、第1生成部115は、実際に存在するvalueパターンに識別子を割り当て、各valueパターンに対応するパターン識別子を表す識別子対応表を生成する(ステップS104)。 Next, the first generating unit 115 assigns identifiers to actually existing value patterns, and generates an identifier correspondence table representing pattern identifiers corresponding to each value pattern (step S104).

次に、第1生成部115は、生成した識別子対応表を主語基準の検索用、述語基準の検索用、目的語基準の検索用に分割して分割識別子対応表231~233を作成する。次に、第1生成部115は、分割識別子対応表231~233をRDFストア110に格納する(ステップS105)。さらに、第1生成部115は、分割識別子対応表231~233の生成完了を第2生成部116に通知する。 Next, the first generating unit 115 divides the generated identifier correspondence table into subject-based search, predicate-based search, and object-based search to create divided identifier correspondence tables 231 to 233 . Next, the first generator 115 stores the split identifier correspondence tables 231 to 233 in the RDF store 110 (step S105). Further, first generation unit 115 notifies second generation unit 116 of completion of generation of division identifier correspondence tables 231 to 233 .

分割識別子対表231~233の生成完了の通知を受けた第2生成部116は、RDFストア110に含まれる全てのRDFデータ及び識別子対応表をRDFストア110から取得する。次に、第2生成部116は、各RDFデータの主語と述語とを組み合わせたvalueパターン、述語と目的語とを組わせたvalueパターン及び主語と目的語とを組わせたvalueパターンを取得する。そして、第2生成部116は、取得したvalueパターンに対応するパターン識別子を分割識別子対応表231~233から取得する。次に、第2生成部116は、トリプルの対応を表す対応表における各RDFデータに取得したパターン識別子を付加して識別子付RDFデータ表を生成する(ステップS106)。 The second generation unit 116 that has received the notification of completion of generation of the divided identifier pair tables 231 to 233 acquires from the RDF store 110 all the RDF data and the identifier correspondence table contained in the RDF store 110 . Next, the second generation unit 116 acquires a value pattern that combines the subject and predicate of each RDF data, a value pattern that combines the predicate and object, and a value pattern that combines the subject and object. . Then, the second generating unit 116 acquires pattern identifiers corresponding to the acquired value patterns from the divided identifier correspondence tables 231 to 233. FIG. Next, the second generating unit 116 generates an RDF data table with identifier by adding the acquired pattern identifier to each piece of RDF data in the correspondence table representing triple correspondence (step S106).

ネームノード112は、識別子付RDFデータ表をRDFストア110から取得する。次に、ネームノード112は、識別子付RDFデータ表に登録されたデータを含む各ブロックを配置するデータノード121を決定する。そして、ネームノード112は、識別子付RDFデータ表の一部の行データを含む各ブロックを、配置先として決定したそれぞれのデータノード121へ送信し、データの分散配置を実行する(ステップS107)。 The NameNode 112 acquires the RDF data table with identifier from the RDF store 110 . Next, the namenode 112 determines the datanode 121 in which each block containing the data registered in the identifier-attached RDF data table is placed. Then, the namenode 112 transmits each block including a part of row data of the identifier-attached RDF data table to each of the datanodes 121 determined as allocation destinations, and executes data distribution allocation (step S107).

次に、図19を参照して、実施例3に係るMapReduce処理の流れについて説明する。図19は、実施例3に係るMapReduce処理のフローチャートである。 Next, a flow of MapReduce processing according to the third embodiment will be described with reference to FIG. 19 . FIG. 19 is a flowchart of MapReduce processing according to the third embodiment.

SPARQL処理部118は、SPARQLクエリの実行命令の入力をジョブクライアント30から受ける。そして、SPARQL処理部118は、SPARQLクエリを実行する(ステップS201)。 The SPARQL processing unit 118 receives an input of a SPARQL query execution command from the job client 30 . The SPARQL processing unit 118 then executes the SPARQL query (step S201).

次に、SPARQL処理部118は、SPARQLクエリをMapReduce処理のジョブへ変換する(ステップS202)。 Next, the SPARQL processing unit 118 converts the SPARQL query into a job for MapReduce processing (step S202).

次に、SPARQL処理部118は、HDFS111から識別子対応表を取得する。そして、SPARQL処理部118は、投入されたクエリを構文解析(パース)して識別子対応表に登録されたvalueパターンに該当するvalueパターンがあるか否かを判定する(ステップS203)。該当するvalueパターンが無い場合(ステップS203:否定)、SPARQL処理部118は、そのようなvalueパターンのマッチング結果は0件であるという検索結果をジョブクライアント30に返してSPARQLクエリの実行処理を終了する。 Next, the SPARQL processing unit 118 acquires the identifier correspondence table from the HDFS 111. FIG. Then, the SPARQL processing unit 118 parses the input query and determines whether or not there is a value pattern corresponding to the value patterns registered in the identifier correspondence table (step S203). If there is no corresponding value pattern (step S203: No), the SPARQL processing unit 118 returns to the job client 30 a search result indicating that the matching result for such a value pattern is 0, and ends the SPARQL query execution processing. do.

これに対して、該当するvalueパターンがある場合(ステップS203:肯定)、SPARQL処理部118は、MapReduce処理を実行する。Spark処理部131は、SPARQL処理部118からの指示を受けて、MapReduce処理の実行をジョブトラッカー114に指示する。ジョブトラッカー114は、メタデータDB113を確認し、MapReduce処理を行わせるスレーブサーバ12を選択する。そして、ジョブトラッカー114は、MapReduce処理をブロック単位のMapタスクに分割し、選択したスレーブサーバ12へ送信する。タスクトラッカー123は、Mapタスクをジョブトラッカー114から受信する。そして、タスクトラッカー123は、取得したMapタスクの実行をMapReduce処理部124に指示する。MapReduce処理部124は、Mapタスクの実行の指示をタスクトラッカー123から受ける。そして、メモリ管理部243は、分割識別子対応表231~233の中からMapタスクで実行する検索基準に応じた表を取得する(ステップS204)。ここでは、分割識別子対応表231を選択した場合で説明する。 On the other hand, if there is a corresponding value pattern (step S203: Yes), the SPARQL processing unit 118 executes MapReduce processing. The Spark processing unit 131 receives an instruction from the SPARQL processing unit 118 and instructs the job tracker 114 to execute MapReduce processing. The job tracker 114 confirms the metadata DB 113 and selects a slave server 12 to perform the MapReduce process. The job tracker 114 then divides the MapReduce process into block-based Map tasks and transmits them to the selected slave server 12 . The task tracker 123 receives Map tasks from the job tracker 114 . The task tracker 123 then instructs the MapReduce processing unit 124 to execute the acquired Map task. The MapReduce processing unit 124 receives an instruction to execute a Map task from the task tracker 123 . Then, the memory management unit 243 acquires a table corresponding to the search criteria to be executed by the Map task from among the division identifier correspondence tables 231 to 233 (step S204). Here, a case where the division identifier correspondence table 231 is selected will be described.

次に、メモリ管理部243は、選択した分割識別子対応表231及びHDFS122bに格納された識別子付RDFデータ表をRDDに変換してメモリ126上に展開する(ステップS205)。 Next, the memory management unit 243 converts the selected divided identifier correspondence table 231 and the identifier-attached RDF data table stored in the HDFS 122b into an RDD and develops it on the memory 126 (step S205).

Mapタスク実行部241は、メモリ126上に展開された分割識別子対応表231及び識別子付RDFデータ表を用いて、Mapタスクで指定されたMap処理を実行する(ステップS206)。 The Map task execution unit 241 uses the divided identifier correspondence table 231 and the identifier-attached RDF data table developed on the memory 126 to execute the Map process specified by the Map task (step S206).

次に、Mapタスク実行部241は、Map処理の処理結果をkey毎にまとまるようシャッフルして各スレーブサーバ12のMapタスク実行部241に振り分ける。さらに、Mapタスク実行部241は、シャッフルにより自装置に振り分けられたデータをkey毎にまとまるようにソートする(ステップS207)。そして、Mapタスク実行部241は、ソートしたデータをメモリ126に格納する。 Next, the Map task execution unit 241 shuffles the processing results of the Map processing so that they are collected for each key and distributes them to the Map task execution unit 241 of each slave server 12 . Furthermore, the Map task execution unit 241 sorts the data distributed to the own device by shuffling so that the data are collected for each key (step S207). The Map task execution unit 241 then stores the sorted data in the memory 126 .

Reduceタスク実行部242は、Mapタスク実行部241によりメモリ126に格納されたデータに対して予め指定されたReduce処理を実行する(ステップS208)。 The Reduce task execution unit 242 executes a designated Reduce process on the data stored in the memory 126 by the Map task execution unit 241 (step S208).

その後、Reduceタスク実行部242は、MapReduce処理の結果をメモリ126に格納する。メモリ管理部243は、メモリ126に格納されたMapReduce処理の実行結果を取得してHDFS111への格納用のデータ形式に変換してHDFS122に格納する。タスクトラッカー123は、HDFS122に格納されたMapReduce処理の実行結果をマスタサーバ11のジョブトラッカー114へ送信する。ジョブトラッカー114は、各スレーブサーバ12から送信されたMapReduce処理の実行結果を収集する。そして、ジョブトラッカー114は、MapReduce処理の実行結果を結合する。そして、ジョブトラッカー114は、結合したMapReduce処理の実行結果をMapReduce処理部119を介してSPARQL処理部118へ送信する。SPARQL処理部118は、結合されたMapReduce処理の実行結果を受信し、受信したデータをRDF形式に変換する(ステップS209)。その後、SPARQL処理部118は、RDF形式に変換したMapReduce処理の結果をSPARQLクエリの実行結果としてジョブクライアント30へ送信する。 After that, the Reduce task execution unit 242 stores the result of the MapReduce processing in the memory 126 . The memory management unit 243 acquires the execution result of the MapReduce process stored in the memory 126 , converts it into a data format for storage in the HDFS 111 , and stores it in the HDFS 122 . The task tracker 123 transmits the execution result of the MapReduce process stored in the HDFS 122 to the job tracker 114 of the master server 11 . The job tracker 114 collects the execution results of the MapReduce processing sent from each slave server 12 . The job tracker 114 then combines the execution results of the MapReduce process. The job tracker 114 then transmits the execution result of the combined MapReduce processing to the SPARQL processing unit 118 via the MapReduce processing unit 119 . The SPARQL processing unit 118 receives the execution result of the combined MapReduce process, and converts the received data into RDF format (step S209). After that, the SPARQL processing unit 118 transmits the result of the MapReduce process converted into the RDF format to the job client 30 as the execution result of the SPARQL query.

ここで、本実施例では、分散型のインメモリ処理としてSparkを用いる場合で説明したが、他の分散型のインメモリ処理を用いてもよい。また、情報処理システム1は、分散型のインメモリ処理を用いるMapReduce処理と実施例1で説明した分散型のインメモリ処理を用いないMapReduce処理とを選択的に実行できる構成にしてもよい。さらに、本実施例では、実施例1で説明したMapReduce処理に対してSparkを用いる構成で説明したが、実施例2の構成に適用することもできる。 Here, in the present embodiment, the case of using Spark as distributed in-memory processing has been described, but other distributed in-memory processing may be used. The information processing system 1 may be configured to selectively execute MapReduce processing using distributed in-memory processing and MapReduce processing not using distributed in-memory processing described in the first embodiment. Furthermore, in the present embodiment, the configuration using Spark for the MapReduce processing described in the first embodiment has been described, but the configuration of the second embodiment can also be applied.

以上に説明したように、本実施例に係るHadoopクラスタは、Sparkを用いたMapReduce処理を実行する際に、検索対象に応じて作成された識別子対応表のいずれかを用いる。これにより、メモリへの読み込み量を削減して処理に割り当てるメモリ容量を十分に確保することで、処理速度が低下を回避することができる。また、識別子対応表に含まれるエントリ数が少なくなるため、グラフデータの検索効率を向上させることができる。さらに、分散型のインメモリ処理によりMapReduce処理を実行することにより、MapReduce処理の効率を向上させることができる。 As described above, the Hadoop cluster according to this embodiment uses one of the identifier correspondence tables created according to the search target when executing the MapReduce process using Spark. As a result, a reduction in processing speed can be avoided by reducing the amount of data read into the memory and ensuring a sufficient memory capacity to be allocated to processing. In addition, since the number of entries included in the identifier correspondence table is reduced, it is possible to improve the efficiency of searching graph data. Furthermore, the efficiency of the MapReduce processing can be improved by executing the MapReduce processing by distributed in-memory processing.

上述してきた各実施例に係るマスタサーバ11及びスレーブサーバ12は、例えば図13に示すようなハードウェア構成を有するコンピュータで実現できる。Spark処理部131は、マスタサーバ11がコンピュータ90で実現される場合、CPU91及びメモリ92によりその機能が実現される。また、MapReduce処理部124は、スレーブサーバ12がコンピュータ90で実現される場合、CPU91及びメモリ92によりその機能が実現される。 The master server 11 and slave server 12 according to each of the embodiments described above can be realized by a computer having a hardware configuration as shown in FIG. 13, for example. The function of the Spark processing unit 131 is realized by the CPU 91 and the memory 92 when the master server 11 is realized by the computer 90 . Further, when the slave server 12 is implemented by the computer 90 , the MapReduce processing unit 124 is implemented by the CPU 91 and the memory 92 .

1 情報処理システム
10 Hadoopクラスタ
11 マスタサーバ
12 スレーブサーバ
20 HDFSクライアント
30 ジョブクライアント
111 HDFS
112 ネームノード
113 メタデータDB
114 ジョブトラッカー
115 第1生成部
116 第2生成部
117 RDFコントローラ
118 SPARQL処理部
119 MapReduce処理部
121 データノード
122 HDFS
123 タスクトラッカー
124 MapReduce処理部
125 SSD
126 メモリ
131 Spark処理部
241 Mapタスク実行部
242 Reduceタスク実行部
243 メモリ管理部
1 Information Processing System 10 Hadoop Cluster 11 Master Server 12 Slave Server 20 HDFS Client 30 Job Client 111 HDFS
112 name node 113 metadata DB
114 Job Tracker 115 First Generator 116 Second Generator 117 RDF Controller 118 SPARQL Processor 119 MapReduce Processor 121 Data Node 122 HDFS
123 Task Tracker 124 MapReduce Processing Unit 125 SSD
126 memory 131 Spark processing unit 241 Map task execution unit 242 Reduce task execution unit 243 Memory management unit

Claims (9)

3要素を有するデータのうち2要素を抽出し、抽出した前記2要素よりも小さいデータサイズの識別子を抽出した前記2要素に対応付けた第1の表を生成し、
前記3要素の表に対して前記識別子を付加した第2の表を生成し、
前記第2の表を複数の処理装置に分割して配置し、
検索する際に、前記第1の表を用いて前記識別子を取り出し、取り出した前記識別子を用いてそれぞれの前記処理装置において、各前記処理装置に配置された前記第2の表の一部に対して検索を行い、
前記検索により前記第2の表のうちの抽出される行を出力する
処理をコンピュータに実行させることを特徴とする検索処理プログラム。
Extracting two elements from data having three elements, generating a first table in which an identifier having a data size smaller than the extracted two elements is associated with the extracted two elements,
generating a second table in which the identifier is added to the three-element table;
dividing and arranging the second table in a plurality of processing devices;
When retrieving, the first table is used to retrieve the identifier, and the retrieved identifier is used in each of the processing units for a portion of the second table located in each of the processing units. to search,
A search processing program for causing a computer to execute a process of outputting rows extracted from the second table by the search.
前記第2の表は、前記3要素の対応表に前記識別子を付加した表であることを特徴とする請求項1に記載の検索処理プログラム。 2. The search processing program according to claim 1, wherein said second table is a table obtained by adding said identifier to said correspondence table of said three elements. 前記3要素の中から1要素ごとに前記識別子とを対応させた対応表を生成することを特徴とする請求項1に記載の検索処理プログラム。 2. The search processing program according to claim 1, wherein a correspondence table is generated in which each element out of the three elements is associated with the identifier. 前記3要素を有するデータはグラフデータであり、
前記検索は、key=value形式のデータを用いた検索である
ことを特徴とする請求項1~3のいずれか一つに記載の検索処理プログラム。
The data having the three elements is graph data,
4. The search processing program according to any one of claims 1 to 3, wherein the search is a search using data in key=value format.
前記出力された行を前記3要素のいずれか1つの要素を基準に集約して、基準毎に異なる前記処理装置に配置する処理をコンピュータにさらに実行させることを特徴とする請求項1~4のいずれか一つに記載の検索処理プログラム。 5. The method of claim 1, further causing the computer to perform a process of aggregating the output lines based on any one of the three elements and arranging them in different processing units according to the criteria. A search processing program according to any one of the above. 各前記処理装置において、集約された行に対して前記基準とした要素を基に予め決められた処理を実行することを特徴とする請求項5に記載の検索処理プログラム。 6. The search processing program according to claim 5, wherein each of said processing devices executes a predetermined process on the aggregated rows based on said reference elements. 前記第1の表を前記2要素の組み合わせ毎に分割し、
検索対象に応じて分割後の前記第1の表のいずれかを選択し、選択した分割後の前記第1の表を用いて分散型のインメモリ処理により前記検索を実行する
処理をコンピュータに実行させることを特徴とする請求項1~6のいずれか一つに記載の検索処理プログラム。
dividing the first table for each combination of the two elements;
Selecting one of the divided first tables according to a search target, and executing the search by distributed in-memory processing using the selected divided first table. 7. The search processing program according to any one of claims 1 to 6, characterized by:
3要素を有するデータのうち2要素を抽出し、抽出した前記2要素よりも小さいデータサイズの識別子を抽出した前記2要素に対応付けた第1の表を生成し、
前記3要素の表に対して前記識別子を付加した第2の表を生成し、
前記第2の表を複数の処理装置に分割して配置し、
検索する際に、前記第1の表を用いて前記識別子を取り出し、取り出した前記識別子を用いてそれぞれの前記処理装置において、各前記処理装置に配置された前記第2の表の一部に対して検索を行い、
前記検索により前記第2の表のうちの抽出される行を出力する
ことを特徴とする検索処理方法。
Extracting two elements from data having three elements, generating a first table in which an identifier having a data size smaller than the extracted two elements is associated with the extracted two elements,
generating a second table in which the identifier is added to the three-element table;
dividing and arranging the second table in a plurality of processing devices;
When retrieving, the first table is used to retrieve the identifier, and the retrieved identifier is used in each of the processing units for a portion of the second table located in each of the processing units. to search,
A search processing method, characterized by outputting a row extracted from the second table by the search.
3要素を有するデータのうち2要素を抽出し、抽出した前記2要素よりも小さいデータサイズの識別子を抽出した前記2要素に対応付けた第1の表を生成する第1生成部と、
前記3要素の表に対して前記識別子を付加した第2の表を生成する第2生成部と、
前記第2の表を複数の処理装置に分割して配置する配置部と、
検索する際に、前記第1の表を用いて前記識別子を取り出し、取り出した前記識別子を用いてそれぞれの前記処理装置において、各前記処理装置に配置された前記第2の表の一部に対して検索を行う検索部と、
前記検索部による前記検索により前記第2の表のうちの抽出される行を出力する出力部と
を備えたことを特徴とする情報処理装置。
a first generating unit that extracts two elements from data having three elements and generates a first table in which an identifier having a data size smaller than the extracted two elements is associated with the extracted two elements;
a second generation unit that generates a second table in which the identifier is added to the three-element table;
an arrangement unit that divides and arranges the second table in a plurality of processing devices;
When retrieving, the first table is used to retrieve the identifier, and the retrieved identifier is used in each of the processing units for a portion of the second table located in each of the processing units. a search unit that searches for
and an output unit that outputs a row extracted from the second table by the search performed by the search unit.
JP2019090011A 2018-08-31 2019-05-10 Search processing program, search processing method and information processing device Active JP7211255B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2018162963 2018-08-31
JP2018162963 2018-08-31

Publications (2)

Publication Number Publication Date
JP2020038610A JP2020038610A (en) 2020-03-12
JP7211255B2 true JP7211255B2 (en) 2023-01-24

Family

ID=69738092

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019090011A Active JP7211255B2 (en) 2018-08-31 2019-05-10 Search processing program, search processing method and information processing device

Country Status (1)

Country Link
JP (1) JP7211255B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140172914A1 (en) 2012-12-14 2014-06-19 Microsoft Corporation Graph query processing using plurality of engines

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6310532B1 (en) * 2016-11-24 2018-04-11 ヤフー株式会社 Generating device, generating method, and generating program

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140172914A1 (en) 2012-12-14 2014-06-19 Microsoft Corporation Graph query processing using plurality of engines

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
鈴木大地ほか,分散Key-Valueデータベースを用いたRDFストアの構築と評価,第4回データ工学と情報マネジメントに関するフォーラム論文集 (第10回日本データベース学会年次大会) [online],電子情報通信学会データ工学研究専門委員会 日本データベース学会 情報処理学会データベースシステム研究会,2012年,[検索日:2012.08.30], Internet<URL: http://db-event.jpn.org/deim2012/proceedings/final-pdf/b4-2.pdf>

Also Published As

Publication number Publication date
JP2020038610A (en) 2020-03-12

Similar Documents

Publication Publication Date Title
JP7130600B2 (en) Implementing semi-structured data as first-class database elements
US10521427B2 (en) Managing data queries
Zhang et al. EAGRE: Towards scalable I/O efficient SPARQL query evaluation on the cloud
US10963428B2 (en) Multi-range and runtime pruning
Yagoubi et al. Massively distributed time series indexing and querying
US11294861B2 (en) Data pruning based on metadata
JP2014194772A (en) Method and device for processing graph database query
Cheng et al. Scale-out processing of large RDF datasets
JPWO2017163393A1 (en) Data processing system
Theocharidis et al. SRX: efficient management of spatial RDF data
JP7211255B2 (en) Search processing program, search processing method and information processing device
Guzun et al. A two-phase mapreduce algorithm for scalable preference queries over high-dimensional data
Keawpibal et al. DistEQ: Distributed equality query processing on encoded bitmap index
Xu et al. Parallel top-k query processing on uncertain strings using mapreduce
Huang et al. A SPARQL query processing system using map-phase-multi join for big data in clouds
Lin et al. A Unified Graph Framework for Storage-Compute Coupled Cluster and High-Density Computing Cluster
Cao et al. Efficient and Flexible Index Access in MapReduce.
Shi et al. Distributed Knowledge Graph Query Acceleration Algorithm
Bagwari et al. Indexing optimizations on Hadoop
Trucksäß Evaluation of Distributed Semantic Databases
Wang et al. Research on the Optimization of Spark Big Table Equal Join
Gu Research Distributed Search Engine Based on Hadoop
JP5191441B2 (en) Index construction method and apparatus, information retrieval method, apparatus and program
Lu et al. Efficient Filter and Refinement for the Hadoop-Based Spatial Join
Vissapragada Optimizing SQL Query Execution over Map-Reduce

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220208

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20221213

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20221214

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20221226

R150 Certificate of patent or registration of utility model

Ref document number: 7211255

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150