JP6112978B2 - RDF expression generation method, program, and system - Google Patents

RDF expression generation method, program, and system Download PDF

Info

Publication number
JP6112978B2
JP6112978B2 JP2013117629A JP2013117629A JP6112978B2 JP 6112978 B2 JP6112978 B2 JP 6112978B2 JP 2013117629 A JP2013117629 A JP 2013117629A JP 2013117629 A JP2013117629 A JP 2013117629A JP 6112978 B2 JP6112978 B2 JP 6112978B2
Authority
JP
Japan
Prior art keywords
class
program
annotation
api
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.)
Expired - Fee Related
Application number
JP2013117629A
Other languages
Japanese (ja)
Other versions
JP2014235631A (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.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
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 International Business Machines Corp filed Critical International Business Machines Corp
Priority to JP2013117629A priority Critical patent/JP6112978B2/en
Publication of JP2014235631A publication Critical patent/JP2014235631A/en
Application granted granted Critical
Publication of JP6112978B2 publication Critical patent/JP6112978B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Description

この発明は、コンピュータの処理により、所定のデータからRDF表現を生成するための技法に関するものである。   The present invention relates to a technique for generating an RDF expression from predetermined data by computer processing.

近年、特開2005−242934号公報、あるいは特開2006−302085号公報に記載されているように、ウェブ上にあるリソースを記述する仕組みとして、RDF(Resource Description Framework)形式が採用されている。また、Christian Bizer, Tom Heath, Tim Berners-Lee, Linked Data-The Story So Far, International Journal on Semantic Web and Information Systems, 5(3), 2009には、RDF形式のデータをウェブの仕組みの上で連携させて使用するLinked Dataが、グローバルな情報公開の仕組みとして記述されている。さらに、Open Services for Lifecycle Collaboration (OSLC), http://open-services.net/には、企業内の情報連携としてLinked Dataを活用することが記述されている。   In recent years, as described in Japanese Patent Application Laid-Open No. 2005-242934 or Japanese Patent Application Laid-Open No. 2006-302085, an RDF (Resource Description Framework) format has been adopted as a mechanism for describing resources on the web. In addition, Christian Bizer, Tom Heath, Tim Berners-Lee, Linked Data-The Story So Far, International Journal on Semantic Web and Information Systems, 5 (3), 2009 Linked Data used in conjunction is described as a global information disclosure mechanism. Furthermore, Open Services for Lifecycle Collaboration (OSLC), http://open-services.net/ describes that Linked Data is used as information linkage within a company.

Linked Dataを提供するツールには、RDFデータを格納しておいて提供するツールと、既存ツールが管理する、RDFになっていないデータをRDFに変換して提供するツールがある。   There are two types of tools that provide Linked Data: tools that store and provide RDF data, and tools that convert non-RDF data managed by existing tools into RDF.

また、Linked Dataを使用するツールには、ユーザ要求に従ってリンクを辿ってデータを得るツールと、データ・アクセスの効率化のために、予めLinked Data提供ツールをクロールしてインデックスを作成しておくツールとがある。   In addition, tools that use Linked Data include tools that follow links according to user requests and obtain data, and tools that crawl linked data provision tools and create indexes in advance to improve data access efficiency. There is.

図1は、このようなツールを利用するための、複数のコンピュータをネットワーク接続した構成の例を示す図である。すなわち、典型的にはLANまたはWANであるネットワーク102には、コンピュータ104、106、108、110、112、114、116、及び118が接続されている。コンピュータ104とコンピュータ110にはRDFデータを格納しておいて提供するツールが格納されている。   FIG. 1 is a diagram showing an example of a configuration in which a plurality of computers are connected to a network in order to use such a tool. That is, computers 104, 106, 108, 110, 112, 114, 116, and 118 are connected to a network 102 that is typically a LAN or WAN. The computer 104 and the computer 110 store tools that store and provide RDF data.

コンピュータ116には、ユーザ要求に従ってリンクを辿ってデータを得るツールが格納されている。コンピュータ118には、データ・アクセスの効率化のために、予めLinked Data提供ツールをクロールしてインデックスを作成しておくツールが格納されている。   The computer 116 stores a tool for obtaining data by following a link in accordance with a user request. The computer 118 stores a tool for creating an index by crawling a linked data providing tool in advance for efficient data access.

さて、図1に示すように、多数のアプリケーションをLinked Dataに対応させるためには、各アプリケーションのオブジェクトを、RDFとして変換する必要がある。   As shown in FIG. 1, in order to make many applications correspond to Linked Data, it is necessary to convert the objects of each application as RDF.

このため知られている従来技術の1つとして、図2に概要を示す構成がある。このような構成では、オブジェクト・レポジトリ202の全体が一括して静的にRDF204に変換され、Linked Data使用ツール206からのURI208による問い合わせに応答して、この構成は、対応するRDF210を返す。しかし、このような構成では、オブジェクト・レポジトリ202の一部でも更新があると、オブジェクト・レポジトリ202の全体のRDF204への変換をやり直す必要があるので、非効率であった。   For this reason, there is a configuration shown in FIG. 2 as one of known prior arts. In such a configuration, the entire object repository 202 is collectively and statically converted to RDF 204, and in response to a query by URI 208 from Linked Data usage tool 206, this configuration returns a corresponding RDF 210. However, in such a configuration, if even a part of the object repository 202 is updated, it is necessary to redo the conversion of the entire object repository 202 into the RDF 204, which is inefficient.

そこで、これを改良する従来技術として、図3に示す構成が知られている。このような構成では、Linked Data使用ツール302からURI304を受け取って、API呼び出し306を行い、オブジェクト・レポジトリ308にアクセスするコード310が存在する。そして、このようなコード310の働きにより、オブジェクト・レポジトリ308からオブジェクト312が抽出され、RDF変換器314はマッピング・ファイル316を参照して、RDF318を生成し、Linked Data使用ツール302に渡す。なお、このようなAPI呼び出し306は例えば、http://jena.sourceforge.net/tutorial/RDF_API/に記述がある。また、マッピング・ファイルとは、RDF変換の依存関係や階層などのルールを規定するファイルである。しかし、このような構成では、RDFの仕様が変わって、必要なオブジェクトが変更になると、必然的にレポジトリにアクセスするためのコード310を変更する必要がある。このとき、オブジェクトのプロパティの数が多いなど、オブジェクトが複雑であると、コード310の変更にバグが入り込みやすいなどの問題がある。   Therefore, a configuration shown in FIG. 3 is known as a conventional technique for improving this. In such a configuration, there is a code 310 that receives the URI 304 from the Linked Data usage tool 302, makes an API call 306, and accesses the object repository 308. The code 312 extracts the object 312 from the object repository 308, and the RDF converter 314 refers to the mapping file 316 to generate the RDF 318 and passes it to the Linked Data usage tool 302. Such an API call 306 is described in, for example, http://jena.sourceforge.net/tutorial/RDF_API/. The mapping file is a file that defines rules such as dependency and hierarchy of RDF conversion. However, in such a configuration, when the RDF specification changes and a necessary object is changed, the code 310 for accessing the repository inevitably needs to be changed. At this time, if the object is complicated, for example, the number of properties of the object is large, there is a problem that it is easy to introduce a bug in the code 310 change.

本願出願人に係る特願2012−162030号明細書に記載されている技術は、上記従来技術の改良に係るものであって、Linked Data使用ツールなどからURIを受け取り、URIからシードとなるオブジェクトを特定し、次に、そのオブジェクトの型から適切なマッピング・ファイルを特定し、そこから(部分)型情報を生成し、生成した型情報を参照して、シードから再帰的にたどってオブジェクトを収集し、次にシステムは、収集したオブジェクトのグラフをRDF変換器に渡し、RDF変換器は、マッピング・ファイルを参照して、オブジェクトのグラフをRDFに変換して出力する技法を記述する。しかし、この技法の制約として、データがオブジェクトとそのプロパティ値として個々に直接アクセスできる細粒度のアプリケーション・プログラミング・インタフェース(API)を仮定していて、構造データを一度に返すような一般的なAPIを持つアプリケーションには対応していないということがあった。すなわち、API呼出・結果解釈とマッピングの仕組みが一体化しているため、たとえば値を集計する、条件で選択する、値を再フォーマットするなどのデータ処理を、あらかじめ定義して固定された範囲でしか行えない。   The technique described in the specification of Japanese Patent Application No. 2012-162030 relating to the applicant of the present application is related to the improvement of the above-described conventional technique, and receives a URI from a tool that uses Linked Data, etc. Identify, then identify the appropriate mapping file from the object's type, generate (partial) type information from it, refer to the generated type information, and recurse from the seed to collect objects The system then passes the collected object graph to the RDF converter, which refers to the mapping file to describe the technique of converting the object graph to RDF and outputting it. However, a limitation of this technique is that it assumes a fine-grained application programming interface (API) where the data can be directly accessed individually as objects and their property values, and a general API that returns structural data at once. There was a case that it doesn't correspond to the application you have. In other words, the API call / result interpretation and mapping mechanism are integrated, so data processing such as summing up values, selecting by conditions, and reformatting values can be done only within a predefined and fixed range. I can't.

特開2005−242934号公報JP 2005-242934 A 特開2006−302085号公報JP 2006-302085 A 特願2012−162030号明細書Japanese Patent Application No. 2012-162030

Christian Bizer, Tom Heath, Tim Berners-Lee, Lined Data-The Story So Far, International Journal on Semantic Web and Information Systems, 5(3), 2009Christian Bizer, Tom Heath, Tim Berners-Lee, Lined Data-The Story So Far, International Journal on Semantic Web and Information Systems, 5 (3), 2009 Open Services for Lifecycle Collaboration (OSLC), http://open-services.net/Open Services for Lifecycle Collaboration (OSLC), http://open-services.net/ http://jena.sourceforge.net/tutorial/RDF_API/http://jena.sourceforge.net/tutorial/RDF_API/

従って、この発明の目的は、構造データを返すような一般的なAPIを持つアプリケーションにも適用できる、RDFの生成技法を提供することにある。   Therefore, an object of the present invention is to provide an RDF generation technique that can be applied to an application having a general API that returns structure data.

この発明は、コンピュータ・プログラミング言語のクラスに付与したアノテーションよるルールを再帰的に遅延評価することで、アプリケーションのオブジェクト集合の取得とユーザ定義クラスのオブジェクトへの変換、さらにRDFへの変換を行うことにより、上記課題を解決する。   The present invention performs recursive lazy evaluation of rules based on annotations assigned to classes in a computer programming language, thereby obtaining an application object set, converting it into a user-defined class object, and further converting it into RDF. Thus, the above problem is solved.

ここで使用される好適なコンピュータ・プログラミング言語はJava(R)であり、アノテーションは、Java(R)のクラスに付与されるアノテーションである。この発明において、アノテーションは、次の3つの目的に使われる。
− 言語要素に対応して呼び出す外部アプリケーションのAPIとパラメータを指定する。
− APIで取得したアプリケーションのデータからJava(R)オブジェクトへの対応付けを指定する。
− Java(R)オブジェクトからRDF表現への対応付けを指定する。
The preferred computer programming language used here is Java (R), and the annotation is an annotation attached to a Java (R) class. In the present invention, annotation is used for the following three purposes.
-Specify the API and parameters of the external application to be called corresponding to the language element.
-Specify the mapping from the application data obtained by API to the Java (R) object.
-Specify the mapping from Java (R) objects to RDF expressions.

この発明に従うシステムは、RDF表現を生成するために、以下のステップを実行する。
・受け取ったURIを解析し、ルートクラス名とAPIのパラメータを得るステップ。
・ルートクラスのオブジェクトを一つ生成するステップ。
・オブジェクトのクラスのアノテーションのうちで、外部アプリケーションAPIとパラメータを指定するものを抽出してAPI呼び出しを構成し、それを実行してデータを取得するステップ。
・オブジェクトのクラスのアノテーションのうちで、アプリケーションのデータからJavaオブジェクトへの対応付けを指定するものを抽出して、それにしたがって必要に応じてオブジェクトを生成してローカル変数をセットするステップ。このとき、生成したオブジェクトのクラスのアノテーションに外部アプリケーションAPIを指定するものがある場合、データを取得するステップに戻る。
・生成したオブジェクトに対して、そのクラスのオブジェクトからRDFへの対応付けのアノテーションにしたがってRDF表現を生成するステップ。
The system according to the present invention performs the following steps to generate an RDF representation.
-Parsing the received URI and obtaining the root class name and API parameters.
A step of generating one root class object.
-Extracting object class annotations that specify external application APIs and parameters, configuring API calls, and executing them to obtain data.
Extracting object class annotations that specify mapping to Java objects from the application data, generating objects as needed, and setting local variables accordingly. At this time, if there is an annotation specifying the external application API in the annotation of the generated object class, the process returns to the data acquisition step.
A step of generating an RDF expression for the generated object according to an annotation for mapping from an object of the class to RDF.

この発明によれば、APIで取得したアプリケーションのデータに対して、構造体はJavaオブジェクトに、テーブルはオブジェクトの配列に、ツリー状データは複合オブジェクトに対応付けるなどで、さまざまな形態のデータに対応することができる。   According to the present invention, a structure corresponds to a Java object, a table corresponds to an array of objects, a tree-like data corresponds to a composite object, etc., with respect to application data acquired by the API. be able to.

また、ローカル変数をセットするsetterメソッドの本体を、値を集計する、条件で選択する、値を再フォーマットするなどの、プログラミング言語による任意のデータ処理に置き換えることができる。   In addition, the body of the setter method that sets a local variable can be replaced with arbitrary data processing using a programming language, such as aggregating values, selecting by condition, and reformatting values.

さらに、アプリケーション特有のAPIについて依存性を分離してデータの対応を記述できるようにすることで、必要に応じてプログラム言語によるデータ処理をマッピングの途中に自由に挿入することができる。   Furthermore, by making it possible to describe the data correspondence by separating the dependency of the application-specific API, data processing in a programming language can be freely inserted in the middle of mapping as necessary.

Linked Data変換/提供ツールと、Linked Data使用ツールを含む、ネットワーク接続された複数のコンピュータからなるシステム構成の概要図である。1 is a schematic diagram of a system configuration including a plurality of computers connected to a network including a Linked Data conversion / providing tool and a Linked Data using tool. FIG. URIに対応してRDFを提供するための従来技術を示す図である。It is a figure which shows the prior art for providing RDF corresponding to URI. URIに対応してRDFを提供するための別の従来技術を示す図である。It is a figure which shows another prior art for providing RDF corresponding to URI. 本発明を実施するためのハードウェア構成のブロック図である。It is a block diagram of the hardware constitutions for carrying out the present invention. 本発明を実施するための機能要素のブロック図である。It is a block diagram of the functional element for implementing this invention. 本発明のRDF表現生成プログラムの処理のフローチャートを示す図である。It is a figure which shows the flowchart of a process of the RDF expression production | generation program of this invention. クライアント・コンピュータからのAPIによるデータ要求に対して、サーバからデータが送られる様子を示す図である。It is a figure which shows a mode that data are sent from a server with respect to the data request by API from a client computer. 動作例における、ルートクラスのオブジェクトを示す図である。It is a figure which shows the object of a root class in an operation example. サーバから取得したデータの構造を示す図である。It is a figure which shows the structure of the data acquired from the server. 生成された、階層付けられたクラスのオブジェクトを示す図である。It is a figure which shows the produced | generated object of the class by which the hierarchy was carried out. 生成された、階層付けられたクラスのオブジェクトを示す図である。It is a figure which shows the produced | generated object of the class by which the hierarchy was carried out. 生成された、階層付けられたクラスのオブジェクトを示す図である。It is a figure which shows the produced | generated object of the class by which the hierarchy was carried out. 別の処理例での、ルートクラスのオブジェクトを示す図である。It is a figure which shows the object of a root class in another process example. 別の処理例での、生成された、階層付けられたクラスのオブジェクトを示す図である。It is a figure which shows the object of the produced | generated hierarchy class in another process example. 別の処理例での、生成された、階層付けられたクラスのオブジェクトを示す図である。It is a figure which shows the object of the produced | generated hierarchy class in another process example. 別の処理例での、生成された、階層付けられたクラスのオブジェクトを示す図である。It is a figure which shows the object of the produced | generated hierarchy class in another process example. 別の処理例での、生成された、階層付けられたクラスのオブジェクトを示す図である。It is a figure which shows the object of the produced | generated hierarchy class in another process example. 別の処理例での、生成された、階層付けられたクラスのオブジェクトを示す図である。It is a figure which shows the object of the produced | generated hierarchy class in another process example. 別の処理例での、生成された、階層付けられたクラスのオブジェクトを示す図である。It is a figure which shows the object of the produced | generated hierarchy class in another process example.

以下、図面に従って、本発明の実施例を説明する。これらの実施例は、本発明の好適な態様を説明するためのものであり、発明の範囲をここで示すものに限定する意図はないことを理解されたい。また、以下の図を通して、特に断わらない限り、同一符号は、同一の対象を指すものとする。   Embodiments of the present invention will be described below with reference to the drawings. It should be understood that these examples are for the purpose of illustrating preferred embodiments of the invention and are not intended to limit the scope of the invention to what is shown here. Further, throughout the following drawings, the same reference numerals denote the same objects unless otherwise specified.

図4は、本発明を実施するためのコンピュータのハードウェアの一例を示すブロック図である。図4の構成は、クライアント・コンピュータ400と、ネットワーク420と、ネットワーク420を介してクライアント・コンピュータ400と接続されたサーバ430とからなる。   FIG. 4 is a block diagram showing an example of computer hardware for carrying out the present invention. 4 includes a client computer 400, a network 420, and a server 430 connected to the client computer 400 via the network 420.

クライアント・コンピュータ400において、システム・バス402には、CPU404と、主記憶(RAM)406と、ハードディスク・ドライブ(HDD)408と、キーボード410と、マウス412と、ディスプレイ414が接続されている。CPU404は、好適には、32ビットまたは64ビットのアーキテクチャに基づくものであり、例えば、例えば、インテル社のCore(商標) i3、Core(商標) i5、Core(商標) i7、Xeon(R)、AMD社のAthlon(商標)、Phenom(商標)、Sempron(商標)などを使用することができる。主記憶406は、好適には、8GB以上の容量、より好ましくは、32GB以上の容量をもつものである。   In the client computer 400, a CPU 404, a main memory (RAM) 406, a hard disk drive (HDD) 408, a keyboard 410, a mouse 412, and a display 414 are connected to the system bus 402. The CPU 404 is preferably based on a 32-bit or 64-bit architecture, for example, Intel Core (TM) i3, Core (TM) i5, Core (TM) i7, Xeon (R), AMD's Athlon (TM), Phenom (TM), Sempron (TM), etc. can be used. The main memory 406 preferably has a capacity of 8 GB or more, and more preferably has a capacity of 32 GB or more.

ハードディスク・ドライブ408には、オペレーティング・システムが、格納されている。オペレーティング・システムは、Linux(商標)、マイクロソフト社のWindows(商標) 7、Windows 8(商標)、Windows(商標)2008サーバ、アップルコンピュータのMac OS X(商標)などの、CPU404に適合する任意のものでよい。この実施例ではさらに、ハードディスク・ドライブ408に、Java(R)仮想マシン(JVM)を実現するためのJava(R) Runtime Environmentプログラムが格納されている。   The hard disk drive 408 stores an operating system. The operating system can be any compatible with the CPU 404, such as Linux (trademark), Microsoft Windows (trademark) 7, Windows 8 (trademark), Windows (trademark) 2008 server, Apple Mac OS X (trademark), etc. Things can be used. In this embodiment, the hard disk drive 408 further stores a Java® Runtime Environment program for realizing a Java® virtual machine (JVM).

ハードディスク・ドライブ408にはさらに、図5に関して後で説明する、メイン・プログラム502、URI入力ルーチン504、アノテーション付Java(R)クラス定義のファイル506、RDF表現生成プログラム508などが保存されている。   The hard disk drive 408 further stores a main program 502, a URI input routine 504, an annotated Java (R) class definition file 506, an RDF expression generation program 508, and the like, which will be described later with reference to FIG.

メイン・プログラム502、URI入力ルーチン504及びRDF表現生成プログラム508は、C、C++、Java(R)などの既存のプログラミング言語処理系により、CPU404に適合する実行可能形式のコードを生成し得るコンパイラによって作成することができる。   The main program 502, the URI input routine 504, and the RDF expression generation program 508 are executed by a compiler that can generate an executable code suitable for the CPU 404 by an existing programming language processing system such as C, C ++, or Java (R). Can be created.

キーボード410及びマウス412は、オペレーティング・システムが提供するグラフィック・ユーザ・インターフェースに従い、ディスプレイ414に表示されたアイコン、タスクバー、テキストボックスなどのグラフィック・オブジェクトを操作するために使用される。   The keyboard 410 and the mouse 412 are used to operate graphic objects such as icons, task bars, and text boxes displayed on the display 414 in accordance with a graphic user interface provided by the operating system.

ディスプレイ414は、これには限定されないが、好適には、1024×768以上の解像度をもち、32ビットtrue colorのLCDモニタである。ディスプレイ414は例えば、RDF変換処理を操作する画面等を表示するために使用される。   The display 414 is preferably, but not limited to, a 32-bit true color LCD monitor with a resolution of 1024 × 768 or higher. The display 414 is used, for example, to display a screen for operating the RDF conversion process.

通信インターフェース416は、好適には、イーサネット(R)プロトコルにより、ネットワーク420と接続されている。ネットワーク420には、アプリケーションのデータ全体514を格納したサーバ430が接続され、クライアント・コンピュータ400は、RDF表現生成のため、所定のAPIに従い、サーバ430にデータを要求する。なお、ネットワーク420は、インターネット、LAN、WANなどの任意のネットワークであってよい。   The communication interface 416 is preferably connected to the network 420 by the Ethernet (R) protocol. A server 430 storing the entire application data 514 is connected to the network 420, and the client computer 400 requests data from the server 430 in accordance with a predetermined API for generating an RDF expression. Note that the network 420 may be an arbitrary network such as the Internet, a LAN, or a WAN.

次に、図5を参照して、本発明の処理を実行するための機能要素につて説明する。図5において、メイン・プログラム502は、通信モジュール516を介してサーバ430にデータを要求したり、その他全体の処理を統合する機能を有する。   Next, functional elements for executing the processing of the present invention will be described with reference to FIG. In FIG. 5, the main program 502 has a function of requesting data from the server 430 via the communication module 516 and integrating other overall processing.

URI入力ルーチン504は、クライアント・コンピュータ400でローカルに動作するアプリケーションあるいは、ネットワーク420を介して接続された、遠隔のコンピュータ・システムから、URIを受け取る。   The URI input routine 504 receives a URI from an application operating locally on the client computer 400 or a remote computer system connected via the network 420.

アノテーション付Java(R)クラス定義のファイル506は、予めこの発明の処理のためにユーザなどによって作成されたものであり、好適にはハードディスク・ドライブ408に保存される。
Java(R)クラスにアノテーションを付加するメソッドは、JavaBeans命名規則に沿ったものとなる。すなわち:
Getterメソッド
public
名前はgetで始まり、先頭文字を大文字にしたプロパティ名が続く。
パラメータを持たない
戻り型は、対応するプロパティの型
Setterメソッド
public
名前はsetで始まり、先頭文字を大文字にしたプロパティ名が続く。
パラメータは、対応するプロパティの型
戻り型はvoid
プロパティ
privateフィールド変数
そのGetterメソッドとSetterメソッドを通じてのみアクセスできる。
さらにアノテーションを付与するJava(R)のクラス定義のプロパティには、プロパティの型は、具象クラスか、具象クラスの配列でなければならないという制約がある。Java(R)のクラスに対するアノテーションの付与は、好適には、Eclipse(商標)などの統合開発環境を使用して行うことができる。尚、アノテーション付Java(R)クラスの例は後述する。
The annotated Java (R) class definition file 506 is created in advance by the user or the like for the processing of the present invention, and is preferably stored in the hard disk drive 408.
The method for adding annotations to Java (R) classes follows the JavaBeans naming convention. Ie:
Getter method
public
The name starts with get followed by the property name with the first letter capitalized.
The return type with no parameters is the type of the corresponding property
Setter method
public
The name begins with set followed by the property name with the first letter capitalized.
Parameter is the type of the corresponding property return type is void
The property
private field variables Accessible only through its Getter and Setter methods.
Furthermore, Java (R) class definition properties to which annotations are added have a restriction that the property type must be a concrete class or an array of concrete classes. Annotation to a Java (R) class can be preferably performed using an integrated development environment such as Eclipse (trademark). An example of an annotated Java (R) class will be described later.

RDF表現生成プログラム508は、URI入力ルーチン504から受け取ったURIに基づき、アノテーション付Java(R)クラス定義に従い、アノテーション付Java(R)クラスのJavaオブジェクトを生成し、そのアノテーションに従い構成したAPI呼び出しにより、通信インターフェース416を介してAPI呼び出しによりサーバ430から、そこに格納されているアプリケーションのデータ全体514の一部を取得する。そして、処理のためクライアント・コンピュータ400の主記憶406に、取得したアプリケーションのデータの一部510として保持する。RDF表現生成プログラム508は、アプリケーションに従ってJava(R)オブジェクトを生成し、それに取得したアプリケーションのデータの一部から変数をセットする。RDF表現生成プログラム508は、このような処理によって得られた複合Java(R)オブジェクトに基づき、RDF表現512を生成し、好適にはハードディスク・ドライブ408に保存する。このような処理の詳細は、図6のフローチャートを参照して後で説明する。   Based on the URI received from the URI input routine 504, the RDF expression generation program 508 generates a Java object of the annotated Java (R) class in accordance with the annotated Java (R) class definition, and executes an API call configured according to the annotation. Then, a part of the entire application data 514 stored therein is acquired from the server 430 by an API call via the communication interface 416. Then, it is stored in the main memory 406 of the client computer 400 as a part 510 of the acquired application data for processing. The RDF expression generation program 508 generates a Java (R) object according to the application, and sets a variable from a part of the acquired application data. The RDF expression generation program 508 generates an RDF expression 512 based on the composite Java (R) object obtained by such processing, and preferably stores it in the hard disk drive 408. Details of such processing will be described later with reference to the flowchart of FIG.

サーバ430は、クライアント・コンピュータ400から受け取ったAPIの、API処理ルーチン516と、API処理ルーチン516の処理に従い、アプリケーションのデータ全体514から一部のデータを抽出してクライアント・コンピュータ400にデータを送信するデータ送信ルーチン518を含む。なお、一例では、サーバ430に格納された外部アプリケーションはSAP ERPであり、APIは、SAP BAPIである。   The server 430 extracts part of the data from the entire application data 514 and transmits the data to the client computer 400 in accordance with the API processing routine 516 and API processing routine 516 of the API received from the client computer 400. A data transmission routine 518 is included. In one example, the external application stored in the server 430 is SAP ERP, and the API is SAP BAPI.

次に、図6のフローチャートを参照して、RDF表現生成プログラム508の処理を説明する。   Next, processing of the RDF expression generation program 508 will be described with reference to the flowchart of FIG.

図6のステップ602では、RDF表現生成プログラム508は、URI入力ルーチン504から受け取ったURIを解析し、ルートクラス名と、APIパラメータを生成する。   In step 602 of FIG. 6, the RDF expression generation program 508 analyzes the URI received from the URI input routine 504, and generates a root class name and an API parameter.

ステップ604で、RDF表現生成プログラム508は、生成したルートクラス名と、APIパラメータに基づき、アノテーション付Java(R)クラス定義に従い、ルートクラスのJava(R)オブジェクトを生成する。   In step 604, the RDF expression generation program 508 generates a Java (R) object of the root class according to the annotated Java (R) class definition based on the generated root class name and API parameter.

ステップ606で、RDF表現生成プログラム508は、生成したJava(R)オブジェクトのアノテーションに従い、API呼び出しを行い、サーバ430のアプリケーションのデータ全体514からデータの一部を取得する。   In step 606, the RDF expression generation program 508 calls an API according to the generated Java (R) object annotation, and acquires a part of the data from the entire application data 514 of the server 430.

ステップ608で、RDF表現生成プログラム508は、生成したJava(R)オブジェクトのアノテーションに従い、データの一部からJava(R)オブジェクトを生成し、ローカル変数をセットする。   In step 608, the RDF expression generation program 508 generates a Java (R) object from a part of the data according to the annotation of the generated Java (R) object, and sets a local variable.

ステップ610で、RDF表現生成プログラム508は、ステップ608で生成したJava(R)オブジェクトのクラスのアノテーションに外部アプリケーションAPIを指定するものがあるかどうは判断し、もしそうなら、ステップ606に戻る。   In step 610, the RDF expression generation program 508 determines whether there is any that specifies the external application API in the annotation of the Java (R) object class generated in step 608, and if so, returns to step 606.

ステップ608で生成したJava(R)オブジェクトのクラスのアノテーションに外部アプリケーションAPIを指定するものがないなら、RDF表現生成プログラム508は、ステップ612で、ここまでに生成された複数のJava(R)オブジェクトのアノテーションに従い、RDF表現を生成する。なお、ユーザ定義クラスのオブジェクトをRDF表現に変換する技術として、ELMO(http://www.openrdf.org/doc/elmo/1.4)、Jenabean(http://code.google.com/p/jenabean/)、OSLC4J(http://wiki.eclipse.org/Lyo/LyoOSLC4J)などがあり、ステップ612では、これら既存の技術の任意の技術を使用することができる。   If there is no specification of the external application API in the annotation of the class of the Java (R) object generated in step 608, the RDF expression generation program 508 causes the plurality of Java (R) objects generated so far in step 612. RDF expression is generated according to the annotation. In addition, ELMO (http://www.openrdf.org/doc/elmo/1.4), Jenabean (http://code.google.com/p/jenabean) are technologies for converting user-defined class objects into RDF expressions. /), OSLC4J (http://wiki.eclipse.org/Lyo/LyoOSLC4J), etc., and in step 612, any of these existing technologies can be used.

次に、この発明を実施する、一例のアプリケーションにおける、アノテーション付Java(R)クラス定義と、その処理について説明する。   Next, an annotated Java (R) class definition and its processing in an example application implementing the present invention will be described.

ここで使用されるクラスは、PurchaseOrder、POHeader、POItem、Vendor、VCardの5個であり、その内容は次のとおりである。   The classes used here are PurchaseOrder, POHeader, POItem, Vendor, and VCard, and the contents are as follows.

// クラス PurchaseOrder
@ApiCall(name="BAPI_PO_GETDETAIL1", params={"PURCHASEORDER"})
@OslcNamespace("http://yourcompany.com/ns/sap#")
public final class PurchaseOrder {
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
private POHeader poHeader;
@FieldName("POHEADER")
@OslcValueType(ValueType.LocalResource)
@OslcPropertyDefinition("http://yourcompany.com/ns/sap#" + "poHeader")
public POHeader getPoHeader() {
return poHeader;
}
public void setPoHeader(POHeader poheader) {
this.poHeader = poheader;
}
private POItem poItem[];
@FieldName("POITEM")
@OslcValueType(ValueType.LocalResource)
@OslcPropertyDefinition("http://yourcompany.com/ns/sap#" + "poItem")
public POItem[] getPoItem() {
return poItem;
}
public void setPoItem(POItem[] poitem) {
this.poItem = poitem;
}
}
// class PurchaseOrder
@ApiCall (name = "BAPI_PO_GETDETAIL1", params = {"PURCHASEORDER"})
@OslcNamespace ("http://yourcompany.com/ns/sap#")
public final class PurchaseOrder {
private String id;
public String getId () {
return id;
}
public void setId (String id) {
this.id = id;
}
private POHeader poHeader;
@FieldName ("POHEADER")
@OslcValueType (ValueType.LocalResource)
@OslcPropertyDefinition ("http://yourcompany.com/ns/sap#" + "poHeader")
public POHeader getPoHeader () {
return poHeader;
}
public void setPoHeader (POHeader poheader) {
this.poHeader = poheader;
}
private POItem poItem [];
@FieldName ("POITEM")
@OslcValueType (ValueType.LocalResource)
@OslcPropertyDefinition ("http://yourcompany.com/ns/sap#" + "poItem")
public POItem [] getPoItem () {
return poItem;
}
public void setPoItem (POItem [] poitem) {
this.poItem = poitem;
}
}

// クラス POHeader
@OslcNamespace("http://yourcompany.com/ns/sap#")
public final class POHeader {
private Vendor vendor;
@FieldName("VENDOR")
@OslcPropertyDefinition("http://yourcompany.com/ns/sap#" + "vendor")
@OslcValueType(ValueType.LocalResource)
public Vendor getVendor() {
return vendor;
}
public void setVendor(Vendor vendor) {
this.vendor = vendor;
}
private Date created;
@FieldName("CREAT_DATE")
@OslcPropertyDefinition("http://yourcompany.com/ns/sap#" + "created")
@OslcValueType(ValueType.DateTime)
public Date getCreated() {
return created;
}
public void setCreated(final Date created) {
this.created = created;
}
}
// class POHeader
@OslcNamespace ("http://yourcompany.com/ns/sap#")
public final class POHeader {
private Vendor vendor;
@FieldName ("VENDOR")
@OslcPropertyDefinition ("http://yourcompany.com/ns/sap#" + "vendor")
@OslcValueType (ValueType.LocalResource)
public Vendor getVendor () {
return vendor;
}
public void setVendor (Vendor vendor) {
this.vendor = vendor;
}
private Date created;
@FieldName ("CREAT_DATE")
@OslcPropertyDefinition ("http://yourcompany.com/ns/sap#" + "created")
@OslcValueType (ValueType.DateTime)
public Date getCreated () {
return created;
}
public void setCreated (final Date created) {
this.created = created;
}
}

// クラスPOItem
@OslcNamespace("http://yourcompany.com/ns/sap#")
public final class POItem {
String materialNumber;
@FieldName("MATERIAL")
@OslcPropertyDefinition("http://yourcompany.com/ns/sap#" + "materialNumber")
@OslcValueType(ValueType.String)
public String getMaterialNumber() {
return materialNumber;
}
public void setMaterialNumber(String materialNumber) {
this.materialNumber = materialNumber;
}
BigDecimal netPrice;
@FieldName("NET_PRICE")
@OslcPropertyDefinition("http://yourcompany.com/ns/sap#" + "netPrice")
@OslcValueType(ValueType.Decimal)
public BigDecimal getNetPrice() {
return netPrice;
}
public void setNetPrice(BigDecimal netPrice) {
this.netPrice = netPrice;
}
String description;
@FieldName("SHORT_TEXT")
@OslcPropertyDefinition("http://purl.org/dc/terms/" + "description")
@OslcValueType(ValueType.String)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
// class POItem
@OslcNamespace ("http://yourcompany.com/ns/sap#")
public final class POItem {
String materialNumber;
@FieldName ("MATERIAL")
@OslcPropertyDefinition ("http://yourcompany.com/ns/sap#" + "materialNumber")
@OslcValueType (ValueType.String)
public String getMaterialNumber () {
return materialNumber;
}
public void setMaterialNumber (String materialNumber) {
this.materialNumber = materialNumber;
}
BigDecimal netPrice;
@FieldName ("NET_PRICE")
@OslcPropertyDefinition ("http://yourcompany.com/ns/sap#" + "netPrice")
@OslcValueType (ValueType.Decimal)
public BigDecimal getNetPrice () {
return netPrice;
}
public void setNetPrice (BigDecimal netPrice) {
this.netPrice = netPrice;
}
String description;
@FieldName ("SHORT_TEXT")
@OslcPropertyDefinition ("http://purl.org/dc/terms/" + "description")
@OslcValueType (ValueType.String)
public String getDescription () {
return description;
}
public void setDescription (String description) {
this.description = description;
}
}

// クラス Vendor
@ApiCall(name="BAPI_VENDOR_GETDETAIL", params={"VENDORNO"})
@OslcNamespace("http://yourcompany.com/ns/sap#")
public final class Vendor {
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
private VCard detail;
@FieldName("GENERALDETAIL")
@OslcValueType(ValueType.LocalResource)
@OslcPropertyDefinition("http://yourcompany.com/ns/sap#" + "detail")
public VCard getDetail() {
return detail;
}
public void setDetail(VCard detail) {
this.detail = detail;
}
}
// class Vendor
@ApiCall (name = "BAPI_VENDOR_GETDETAIL", params = {"VENDORNO"})
@OslcNamespace ("http://yourcompany.com/ns/sap#")
public final class Vendor {
private String id;
public String getId () {
return id;
}
public void setId (String id) {
this.id = id;
}
private VCard detail;
@FieldName ("GENERALDETAIL")
@OslcValueType (ValueType.LocalResource)
@OslcPropertyDefinition ("http://yourcompany.com/ns/sap#" + "detail")
public VCard getDetail () {
return detail;
}
public void setDetail (VCard detail) {
this.detail = detail;
}
}

// クラス VCard
@OslcNamespace("http://www.w3.org/2006/vcard/ns#")
public final class VCard {
String name;
@FieldName("NAME")
@OslcPropertyDefinition("http://www.w3.org/2006/vcard/ns#" + "fn")
@OslcValueType(ValueType.String)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
String city;
@FieldName("CITY")
@OslcPropertyDefinition("http://www.w3.org/2006/vcard/ns#" + "adr")
@OslcValueType(ValueType.String)
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
}
// class VCard
@OslcNamespace ("http://www.w3.org/2006/vcard/ns#")
public final class VCard {
String name;
@FieldName ("NAME")
@OslcPropertyDefinition ("http://www.w3.org/2006/vcard/ns#" + "fn")
@OslcValueType (ValueType.String)
public String getName () {
return name;
}
public void setName (String name) {
this.name = name;
}
String city;
@FieldName ("CITY")
@OslcPropertyDefinition ("http://www.w3.org/2006/vcard/ns#" + "adr")
@OslcValueType (ValueType.String)
public String getCity () {
return city;
}
public void setCity (String city) {
this.city = city;
}
}

上記のアノテーション付クラス定義において、
@ApiCallは、外部アプリケーションのAPIとパラメータを指定する。
@FieldNameは、取得データのフィールド値からJava(R)オブジェクトへの対応付けである。
@OslcNamespace
@OslcValueType
@OslcPropertyDefinition
は、Java(R)オブジェクトからRDF表現への対応付けであり、OSLC4Jのアノテーションを使用するものである。
In the class definition with annotation above,
@ApiCall specifies the API and parameters of the external application.
@FieldName is a correspondence from the field value of the acquired data to the Java (R) object.
@OslcNamespace
@OslcValueType
@OslcPropertyDefinition
Is a mapping from Java (R) objects to RDF expressions, and uses OSLC4J annotations.

この実施例で前提とするAPIは、複数の構造体(Structure)やテーブル(Table)がサーバ430からクライアント・コンピュータ400に一度に返され、その後クライアント側でレコードやテーブルのデータをアクセスすることを可能ならしめるものである。なお、好適には、ここで構造体とは、個々の要素が基本データの連想配列である。また、テーブルとは、個々の要素が基本データの連想配列の配列である。図7は、APIを用いてクライアント・コンピュータ400がサーバ430からデータを取得する様子を示す図である。   The API premised in this embodiment is that a plurality of structures and tables are returned to the client computer 400 from the server 430 at a time, and then the records and table data are accessed on the client side. If possible. Preferably, the structure here is an associative array of basic data. A table is an associative array of basic data. FIG. 7 is a diagram illustrating how the client computer 400 acquires data from the server 430 using the API.

このとき、APIへのパラメータの渡し方は、次のとおりである。
(1)フィールド名に関するコンベンションを使用する
下記のコードで、フィールドid, id2, id3, .. の値を、paramsで指定した引数の値としてAPI呼出に渡す。
@ApiCall(name="BAPI_PO_GETDETAIL1", params={"PURCHASEORDER”, “ITEMNO”})
public final class PurchaseOrder {
private String id;
private String id2;
}
idとid2の値がそれぞれ4500017172と0010の場合、BAPI_PO_GETDETAIL1(PURCHASEORDER=4500017172、ITEMNO=0010)を生成して呼び出す。なお、パラメータ名でなく順番で引数が指定されるAPIの場合、アノテーションでparamsは使われない。
At this time, how to pass parameters to the API is as follows.
(1) Use conventions related to field names In the following code, pass the values of fields id, id2, id3, .. to the API call as argument values specified in params.
@ApiCall (name = "BAPI_PO_GETDETAIL1", params = {"PURCHASEORDER”, “ITEMNO”})
public final class PurchaseOrder {
private String id;
private String id2;
}
If the values of id and id2 are 4500017172 and 0010, respectively, BAPI_PO_GETDETAIL1 (PURCHASEORDER = 4500017172, ITEMNO = 0010) is generated and called. In the case of an API in which arguments are specified in order instead of parameter names, params is not used in the annotation.

(2)フィールド名にアノテーションを付加して、API呼出の実引として使われることを指定する
@ApiCall(name="BAPI_PO_GETDETAIL1", params={"PURCHASEORDER”, “ITEMNO”})
public final class PurchaseOrder {
@ApiArgument(1)
private String po_num;
@ApiArgument(2)
private String item_num;
}
(2) Annotate the field name and specify that it will be used as an API call
@ApiCall (name = "BAPI_PO_GETDETAIL1", params = {"PURCHASEORDER”, “ITEMNO”})
public final class PurchaseOrder {
@ApiArgument (1)
private String po_num;
@ApiArgument (2)
private String item_num;
}

(3)アノテーションがないときフィールド名に関するコンベンションを利用する - (1)と(2)の組み合わせ (3) Use convention regarding field names when there is no annotation-Combination of (1) and (2)

以上の構成において、具体的な処理例を説明する。
RDF表現生成プログラム508が、図6のステップ602において、URI http://example.com/purchaseOrders/4500017172 を受け取ると仮定する。これを解析して、RDF表現生成プログラム508は、ルートクラス名PurchaseOrderと、パラメータ4500017172を得る。
In the above configuration, a specific processing example will be described.
Assume that the RDF expression generation program 508 receives the URI http://example.com/purchaseOrders/4500017172 in step 602 of FIG. By analyzing this, the RDF expression generation program 508 obtains a root class name PurchaseOrder and a parameter 4500017172.

次に、RDF表現生成プログラム508が、ステップ604において、ルートクラスのJava(R)オブジェクトである、PurchaseOrderのオブジェクトを図8に示すように生成する。   Next, in step 604, the RDF expression generation program 508 generates a PurchaseOrder object, which is a Java (R) object of the root class, as shown in FIG.

次に、RDF表現生成プログラム508が、ステップ606において、クラスPurchaseOrderのアノテーションで、外部アプリケーションAPIの名前とパラメータを指定する@ApiCallをつかって、API 呼び出しを以下のように作る。
BAPI_PO_GETDETAIL1(PURCHASEORDER=4500017172)
これを実行した結果がサーバ430から返される。
BAPI_PO_GETDETAIL1の返値は2個のStructure(フィールド名と値の組の集合)と22個のTable(フィールド名と値の組の集合の配列)である。各値はStructure名とフィールド名、またはTable名と行番号とフィールド名を指定することで一意に取り出すことができる。
こうして得られるデータは、図9に示すとおりである。
Next, in step 606, the RDF expression generation program 508 makes an API call using @ApiCall that specifies the name and parameters of the external application API with the annotation of the class PurchaseOrder as follows.
BAPI_PO_GETDETAIL1 (PURCHASEORDER = 4500017172)
The result of executing this is returned from the server 430.
The return value of BAPI_PO_GETDETAIL1 is two Structures (a set of field name / value pairs) and 22 Tables (an array of field name / value pair sets). Each value can be uniquely retrieved by specifying the Structure name and field name, or the Table name, row number, and field name.
The data thus obtained is as shown in FIG.

次に、RDF表現生成プログラム508が、ステップ608において、クラスPurchaseOrderのpoHeaderに @FieldName(“POHEADER”)が付加されているので、現在の対象SAP Structure を POHEADERに設定する。そして、poHeaderのクラスであるPOHeaderのオブジェクトを生成する。次に、クラスPOHeaderのフィールドのアノテーション@FieldName(“VENDOR”) と@FieldName(“CREAT_DATE”)にしたがってPOHEADERのエントリ値をアクセスする。そして、得られた値をPOHederの各フィールドの型に変換して、Setterメソッドを使って代入する。次に、POHeaderオブジェクトを PurchseOrderオブジェクトの poHeaderフィールド値として代入する。こうして得られるオブジェクトは図10に示すとおりである。   Next, in step 608, the RDF expression generation program 508 adds @FieldName (“POHEADER”) to the poHeader of class PurchaseOrder, and sets the current target SAP Structure to POHEADER. Then, an object of POHeader that is a class of poHeader is generated. Next, the entry value of POHEADER is accessed according to the field annotations @FieldName (“VENDOR”) and @FieldName (“CREAT_DATE”) of the class POHeader. Then, convert the obtained value to the type of each field of POHeder and substitute it using the Setter method. Next, the POHeader object is assigned as the poHeader field value of the PurchseOrder object. The objects obtained in this way are as shown in FIG.

次に、RDF表現生成プログラム508が、クラスPurchaseOrderのpoItemに@FieldName(“POITEM”)が付加されているので、現在の対象SAP Table を POITEMに設定(TableかStructureかは、配列か否かで判断)し、poItem のクラスであるPOItemのオブジェクトを生成する。そして、クラスPOItemのフィールドのアノテーション@FieldName("MATERIAL"),@FieldName("NET_PRICE"), @FieldName("SHORT_TEXT")にしたがってPOITEMのエントリ値をアクセスする。 得られた値をPOItemの各フィールドの型に変換して、Setterメソッドを使って代入する。そして、POItemオブジェクトを PurchseOrderオブジェクトのpoItemフィールド値として代入する。こうして得られるオブジェクトは図11に示すとおりである。   Next, since the RDF expression generation program 508 adds @FieldName (“POITEM”) to the poItem of the class PurchaseOrder, the current target SAP table is set to POITEM (whether the table or structure is an array) And generate a POItem object that is a class of poItem. Then, the POITEM entry value is accessed according to the field annotations @FieldName ("MATERIAL"), @FieldName ("NET_PRICE"), and @FieldName ("SHORT_TEXT") of the class POItem. Convert the obtained value to the type of each field of POItem and assign it using the Setter method. Then, the POItem object is assigned as the poItem field value of the PurchseOrder object. The objects obtained in this way are as shown in FIG.

次に、RDF表現生成プログラム508は、まだ処理されていないクラスのアノテーションが、生成されたオブジェクトのクラスVendorにあるので、ステップ606に戻って、アノテーションで指定される、以下のAPI呼出を行う。
BAPI_VENDOR_GETDETAIL1(VENDORNO=0005)
RDF表現生成プログラム508は、API呼出実行によって、得られるStructure GENERALDETAILに対して、クラスVCardのフィールドのアノテーションを使ってエントリ値を取り出してフィールドに代入する。こうして得られるオブジェクトは図12に示すとおりである
Next, since the annotation of the class that has not yet been processed exists in the class Vendor of the generated object, the RDF expression generation program 508 returns to step 606 and performs the following API call specified by the annotation.
BAPI_VENDOR_GETDETAIL1 (VENDORNO = 0005)
The RDF expression generation program 508 extracts an entry value using the annotation of the field of the class VCard for the Structure GENERALDETAIL obtained by executing the API call, and substitutes it into the field. The objects obtained in this way are as shown in FIG.

こうしてRDF表現生成プログラム508は、ステップ610で、生成したオブジェクトのクラスのアノテーションに外部アプリケーションAPIを指定するものはないと判断して、ステップ612で、図12に示すオブジェクト・グラフをトラバースして、オブジェクトからRDF表現への対応付けのアノテーションにしたがってRDF表現を生成する。   In this way, the RDF expression generation program 508 determines in step 610 that there is no specification of the external application API in the annotation of the generated object class, and in step 612, traverses the object graph shown in FIG. RDF expression is generated according to the annotation of mapping from object to RDF expression.

このようにして生成されたRDF表現は以下のとおりである。
<rdf:RDF
xmlns:sap="http://yourcompany.com/ns/oslcbridge/sap#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dcterms=“http://purl.org/dc/terms/”
xmlns:v=“http://www.w3.org/2006/vcard/ns#”>
<sap:PurchaseOrder rdf:about="http://example.com/purchaseOrder/4500017172">
<sap:poHeader>
<sap:POHeader>
<dcterms:created>2006-10-26T00:00:00.000+09:00</dcterms:created>
<sap:vendor>
<sap:Vendor>
<sap:detail>
<v:VCard>
<v:fn>Safety Clean Inc.</v:fn>
<v:adr>New York</v:adr>
</v:VCard>
</sap:detail>
</sap:Vendor>
</sap:vendor>
</sap:POHeader>
</sap:poHeader>
<sap:poItem>
<sap:POItem>
<dcterms:description>Hydroxide Sludge</dcterms:description>
<sap:materialNumber>IDES_WA_0001</sap:materialNumber>
<sap:netPrice>250</sap:netPrice>
</sap:POItem>
</sap:poItem>
</sap:PurchaseOrder>
</rdf:RDF>
The RDF representation generated in this way is as follows.
<rdf: RDF
xmlns: sap = "http://yourcompany.com/ns/oslcbridge/sap#"
xmlns: rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns: dcterms = “http://purl.org/dc/terms/”
xmlns: v = “http://www.w3.org/2006/vcard/ns#”>
<sap: PurchaseOrder rdf: about = "http://example.com/purchaseOrder/4500017172">
<sap: poHeader>
<sap: POHeader>
<dcterms: created> 2006-10-26T00: 00: 00.000 + 09: 00 </ dcterms: created>
<sap: vendor>
<sap: Vendor>
<sap: detail>
<v: VCard>
<v: fn> Safety Clean Inc. </ v: fn>
<v: adr> New York </ v: adr>
</ v: VCard>
</ sap: detail>
</ sap: Vendor>
</ sap: vendor>
</ sap: POHeader>
</ sap: poHeader>
<sap: poItem>
<sap: POItem>
<dcterms: description> Hydroxide Sludge </ dcterms: description>
<sap: materialNumber> IDES_WA_0001 </ sap: materialNumber>
<sap: netPrice> 250 </ sap: netPrice>
</ sap: POItem>
</ sap: poItem>
</ sap: PurchaseOrder>
</ rdf: RDF>

次に、実行時の状況で挙動を変える例を示す。
先ず、クラス定義が、以下のとおりとする。
@ApiCall(name="BAPI_VENDOR_GETDETAIL", params={"VENDORNO"})
public final class Vendor {
private String id;
@FieldName("GENERALDETAIL")
private VCard detail;
}
public final class VCard {
@FieldName("NAME")
String name;
@FieldName("CITY")
String city;
@FieldName(“SUPPLIER")
Vendorsupplier;
}
Next, an example of changing the behavior in the situation at the time of execution is shown.
First, the class definition is as follows.
@ApiCall (name = "BAPI_VENDOR_GETDETAIL", params = {"VENDORNO"})
public final class Vendor {
private String id;
@FieldName ("GENERALDETAIL")
private VCard detail;
}
public final class VCard {
@FieldName ("NAME")
String name;
@FieldName ("CITY")
String city;
@FieldName (“SUPPLIER”)
Vendorsupplier;
}

ここで初期オブジェクトが図13のとおりだとする。すると、RDF表現生成プログラム508は、初期オブジェクトのクラスVendorの@ApiCallのパラメータを参照して、呼出BAPI_VENDOR_GETDETAIL(VENDORNO=0005)を生成して実行する。結果として図14に示すStructureが返される。   Here, it is assumed that the initial object is as shown in FIG. Then, the RDF expression generation program 508 generates and executes a call BAPI_VENDOR_GETDETAIL (VENDORNO = 0005) with reference to the parameter of @ApiCall of the class Vendor of the initial object. As a result, the Structure shown in FIG. 14 is returned.

次にRDF表現生成プログラム508は、@FieldName(“GENERALDETAIL”)によって、Vendorオブジェクトのプロパティdetailと返されたSAP Structure GENERALDETAILを関連付ける。そして、プロパティdetailのクラスVCardのオブジェクトを生成する。結果は図15に示すようになる。   Next, the RDF expression generation program 508 associates the property detail of the Vendor object with the returned SAP Structure GENERALDETAIL by @FieldName (“GENERALDETAIL”). Then, an object of class VCard of property detail is generated. The result is as shown in FIG.

次にRDF表現生成プログラム508は、クラスVCardのアノテーションにしたがって値をセットする。このときVendorは@ApiCallの付いたクラスなので、まずVendorオブジェクトを生成し、次に値0013を生成したVendorにセットする。結果は図16に示すようになる。   Next, the RDF expression generation program 508 sets a value according to the annotation of the class VCard. At this time, since Vendor is a class with @ApiCall, first create a Vendor object, and then set the value 0013 to the created Vendor. The result is as shown in FIG.

次にRDF表現生成プログラム508は、新たなオブジェクトのクラスVendorの@ApiCallのパラメータを参照して、呼出BAPI_VENDOR_GETDETAIL(VENDORNO=0013)を生成して実行する。結果として図17に示すStructureが返される。   Next, the RDF expression generation program 508 generates and executes a call BAPI_VENDOR_GETDETAIL (VENDORNO = 0013) with reference to the @ApiCall parameter of the new object class Vendor. As a result, the Structure shown in FIG. 17 is returned.

次にRDF表現生成プログラム508は、@FieldName(“GENERALDETAIL”)によって、Vendorオブジェクトのプロパティdetailと返されたSAP Structure GENERALDETAILを関連付ける。そして、プロパティdetailのクラスVCardのオブジェクトを生成する。結果は図18に示すようになる。   Next, the RDF expression generation program 508 associates the property detail of the Vendor object with the returned SAP Structure GENERALDETAIL by @FieldName (“GENERALDETAIL”). Then, an object of class VCard of property detail is generated. The result is as shown in FIG.

次にRDF表現生成プログラム508は、クラスVCardのアノテーションにしたがって値をセットする。このときSUPPLIERの値がないので、Vendorオブジェクトは生成しない。未処理のアノテーションがないので、停止する。結果は図19に示すようになる。   Next, the RDF expression generation program 508 sets a value according to the annotation of the class VCard. At this time, since there is no SUPPLIER value, no Vendor object is created. Stop because there is no unprocessed annotation. The result is as shown in FIG.

以上、特定の実施例に従い本発明の処理を説明してきたが、本発明はこの特定の構成あるいは実施例に限定して解釈されるべきではない。例えば、アノテーション付Java(R)定義は、一例であって、C++などアノテーション付記述を許容する任意のプログラミング言語を使用可能である。   Although the processing of the present invention has been described according to a specific embodiment, the present invention should not be construed as being limited to this specific configuration or embodiment. For example, the Java (R) definition with annotation is an example, and any programming language that allows annotated description such as C ++ can be used.

400・・・クライアント・コンピュータ
404・・・CPU
406・・・主記憶
408・・・ハードディスク・ドライブ
416・・・通信インターフェース
430・・・サーバ
506・・・アノテーション付Javaクラス定義
508・・・RDF表現生成プログラム
400: Client computer 404: CPU
406 ... Main memory 408 ... Hard disk drive 416 ... Communication interface 430 ... Server 506 ... Annotated Java class definition 508 ... RDF expression generation program

Claims (11)

コンピュータの処理により、URIをRDF表現に変換する方法であって、
URIを受け取るステップと、
前記URIを解析して、ルートクラス名と、APIのパラメータを取得するステップと、
前記ルートクラス名に基づき、プログラムのアノテーション付きクラス定義により、ルートクラスのオブジェクトを生成するステップと、
前記ルートクラスのアノテーションに従いAPIを呼び出し、データを取得するステップと、
前記アノテーションに従って前記データから前記プログラムのオブジェクトを生成して、ローカル変数をセットするステップと、
前記生成したオブジェクトのクラスのアノテーションにAPIを指定するコードが含まれているかどうか判断し、もしそうなら前記アノテーションに従いAPIを呼び出し、データを取得するステップに戻る、ステップと、
前記生成したオブジェクトのクラスのアノテーションにAPIを指定するコードが含まれていないなら、前記アノテーションに従って、前記プログラムのオブジェクトからRDF表現を生成するステップを有する、
方法。
A method of converting a URI into an RDF representation by computer processing,
Receiving a URI;
Analyzing the URI to obtain a root class name and API parameters;
Generating a root class object based on the root class name and annotated class definition of the program;
Calling the API according to the annotation of the root class and obtaining data;
Generating a program object from the data according to the annotation and setting a local variable;
Determining whether a code specifying an API is included in the annotation of the generated object class, and if so, calling the API according to the annotation and returning to the step of acquiring data; and
If the generated object class annotation does not include a code for specifying an API, an RDF expression is generated from the program object according to the annotation.
Method.
前記プログラムが、クラスとメソッドにアノテーションが付加できるクラスベースのプログラム言語で書かれたものである、請求項1に記載の方法。   The method of claim 1, wherein the program is written in a class-based programming language that allows annotations to be added to classes and methods. 前記プログラムがJava(R)である、請求項2に記載の方法。   The method according to claim 2, wherein the program is Java®. 前記RDF表現を生成するステップは、クライアント・コンピュータ上で実行され、前記APIによるデータ取得は、前記クライアント・コンピュータと異なるサーバから取得される、請求項1に記載の方法。   The method of claim 1, wherein generating the RDF representation is performed on a client computer, and data acquisition by the API is acquired from a different server than the client computer. コンピュータの処理により、URIをRDF表現に変換するプログラムであって、
前記コンピュータに、
URIを受け取るステップと、
前記URIを解析して、ルートクラス名と、APIのパラメータを取得するステップと、
前記ルートクラス名に基づき、プログラムのアノテーション付きクラス定義により、ルートクラスのオブジェクトを生成するステップと、
前記ルートクラスのアノテーションに従いAPIを呼び出し、データを取得するステップと、
前記アノテーションに従って前記データから前記プログラムのオブジェクトを生成して、ローカル変数をセットするステップと、
前記生成したオブジェクトのクラスのアノテーションにAPIを指定するコードが含まれているかどうか判断し、もしそうなら前記アノテーションに従いAPIを呼び出し、データを取得するステップに戻る、ステップと、
前記生成したオブジェクトのクラスのアノテーションにAPIを指定するコードが含まれていないなら、前記アノテーションに従って、前記プログラムのオブジェクトからRDF表現を生成するステップを実行させる、
プログラム。
A program that converts URIs into RDF expressions by computer processing,
In the computer,
Receiving a URI;
Analyzing the URI to obtain a root class name and API parameters;
Generating a root class object based on the root class name and annotated class definition of the program;
Calling the API according to the annotation of the root class and obtaining data;
Generating a program object from the data according to the annotation and setting a local variable;
Determining whether a code specifying an API is included in the annotation of the generated object class, and if so, calling the API according to the annotation and returning to the step of acquiring data; and
If code that specifies an API is not included in the annotation of the generated object class, the step of generating an RDF expression from the object of the program according to the annotation is executed.
program.
前記プログラムが、クラスとメソッドにアノテーションが付加できるクラスベースのプログラム言語で書かれたものである、請求項5に記載のプログラム。   The program according to claim 5, wherein the program is written in a class-based programming language that allows annotations to be added to classes and methods. 前記プログラムがJava(R)である、請求項6に記載のプログラム。   The program according to claim 6, wherein the program is Java®. 前記RDF表現を生成するステップは、クライアント・コンピュータ上で実行され、前記APIによるデータ取得は、前記クライアント・コンピュータと異なるサーバから取得される、請求項5に記載のプログラム。   6. The program according to claim 5, wherein the step of generating the RDF representation is executed on a client computer, and the data acquisition by the API is acquired from a server different from the client computer. コンピュータの処理により、URIをRDF表現に変換するシステムであって、
記憶手段と、
前記記憶手段に保存された、プログラムのアノテーション付きクラス定義のデータと、
URIを受け取る手段と、
前記URIを解析して、ルートクラス名と、APIのパラメータを取得する手段と、
前記ルートクラス名に基づき、前記プログラムのアノテーション付きクラス定義により、ルートクラスのオブジェクトを生成する手段と、
前記ルートクラスのアノテーションに従いAPIを呼び出し、データを取得する手段と、
前記アノテーションに従って前記データから前記プログラムのオブジェクトを生成して、ローカル変数をセットする手段と、
前記生成したオブジェクトのクラスのアノテーションにAPIを指定するコードが含まれているかどうか判断し、もしそうなら前記アノテーションに従いAPIを呼び出し、データを取得するステップに戻る、手段と、
前記生成したオブジェクトのクラスのアノテーションにAPIを指定するコードが含まれていないなら、前記アノテーションに従って、前記プログラムのオブジェクトからRDF表現を生成する手段を有する、
システム。
A system that converts URIs into RDF expressions by computer processing,
Storage means;
Data of annotated class definition of the program stored in the storage means;
A means of receiving a URI;
Means for analyzing the URI and obtaining a root class name and API parameters;
Means for generating an object of a root class based on the root class name and by annotated class definition of the program;
Means for calling the API according to the annotation of the root class and acquiring data;
Means for generating an object of the program from the data according to the annotation and setting a local variable;
Determining whether the annotation of the generated object class includes a code specifying an API, and if so, calling the API according to the annotation and returning to the step of acquiring data;
If the generated object class annotation does not include a code for specifying an API, the device has means for generating an RDF expression from the program object according to the annotation.
system.
前記プログラムが、クラスとメソッドにアノテーションが付加できるクラスベースのプログラム言語で書かれたものである、請求項9に記載のシステム。   The system of claim 9, wherein the program is written in a class-based programming language that allows annotations to be added to classes and methods. 前記プログラムがJava(R)である、請求項10に記載のシステム。   The system according to claim 10, wherein the program is Java®.
JP2013117629A 2013-06-04 2013-06-04 RDF expression generation method, program, and system Expired - Fee Related JP6112978B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013117629A JP6112978B2 (en) 2013-06-04 2013-06-04 RDF expression generation method, program, and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013117629A JP6112978B2 (en) 2013-06-04 2013-06-04 RDF expression generation method, program, and system

Publications (2)

Publication Number Publication Date
JP2014235631A JP2014235631A (en) 2014-12-15
JP6112978B2 true JP6112978B2 (en) 2017-04-12

Family

ID=52138272

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013117629A Expired - Fee Related JP6112978B2 (en) 2013-06-04 2013-06-04 RDF expression generation method, program, and system

Country Status (1)

Country Link
JP (1) JP6112978B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008123425A (en) * 2006-11-15 2008-05-29 Ntt Resonant Inc Web document data providing device, method, and system
CN101901234A (en) * 2009-05-27 2010-12-01 国际商业机器公司 Method and system for converting XML data into resource description framework data

Also Published As

Publication number Publication date
JP2014235631A (en) 2014-12-15

Similar Documents

Publication Publication Date Title
US9910640B2 (en) Modeling representational state transfer application programming interfaces
US20090119675A1 (en) Extensible Framework for Managing UI State in a Composite AJAX Application
US20080320441A1 (en) Extensible rapid application development for disparate data sources
US8458672B2 (en) Facilitating the utilization of complex data objects
US20150339337A1 (en) Service registry for saving and restoring a faceted selection
US8621092B2 (en) Remote portlet consumer with enhanced resource URL processing
US20140157154A1 (en) Managing business objects
JP6016808B2 (en) Method and server system for implementing web access
US20130318160A1 (en) Device and Method for Sharing Data and Applications in Peer-to-Peer Computing Environment
JP5677319B2 (en) Web-based diagram visual extensibility
US20060156277A1 (en) System and method for utilizing non-EMF based objects in an EMF environment
CN102566984A (en) Method and device for configuring parameters
US8862637B2 (en) Generating data access operations based on a data model using a data services model
Elaasar et al. Integrating modeling tools in the development lifecycle with oslc: A case study
Tran et al. Lifecycle-support in architectures for ontology-based information systems
Altamimi et al. Performance analysis roundtrip: automatic generation of performance models and results feedback using cross-model trace links
JP6112978B2 (en) RDF expression generation method, program, and system
Dunka et al. Simplifying Web Application Development Using-Mean Stack Technologies
Wenzel Ontology-driven application architectures with KOMMA
Sun OSLN: An Object-Oriented Semantic Link Network language for complex object description and operation
JP2014021869A (en) Method, program and system for generating rdf expressions
Borjigin et al. Dataspace and its application in digital libraries
Jiang et al. UML-level analysis and comparison of Web service descriptions
JP5871700B2 (en) RDF expression generation method, program, and system
Himschoot et al. Efficient communication with gRPC

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160524

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170215

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: 20170221

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170314

R150 Certificate of patent or registration of utility model

Ref document number: 6112978

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees