第11回 SWAP約定のFIBOへのマッピングをやってみました!

 

第9回でFIBOの簡易版に関する日本語訳を掲示しましたがやはりわかりにくいのでサマリーしました。

Agreement, Autonomous Agent, Servicce, Commitment等が中心となっていますのでそれらの関係を一つの図にまとめました。

1.FIBO全体サマリー

f:id:William0105:20200601150814p:plain

以上のそれぞれの部品をArrowという作画ツールを使って主な関係をまとめました。FIBOの全体概要がよくわかります。

f:id:William0105:20200601153100p:plain

結局、契約を中心にして、契約者(Autonomous Agent)と契約によって形成されるCommitmentとで構成されているということがわかります。契約の内容はContractual Elementとして詳細が記述され、記述された内容に基づいてコミットメントが定義されることになります。

 

特定の金融商品に的を絞ってさらに分析を進めました。デリバティブ取引の金利SWAPです。

分析方法は

(1)ProtegeのツールOntoGrafを利用してEntityをたどる

f:id:William0105:20200712121532p:plain

 

(2)ProtegeのEntityから金利スワップの全体像を把握

たどった結果を全体像が分かるようにExcel上に再現しました。

f:id:William0105:20200712121622p:plain

(3)Arrowを使って簡易モデルを作成

Excelの結果をArrowを使ってFIBOの簡易モデルを作成

f:id:William0105:20200712121940p:plain

(4)実際のSWAP約定を上記(3)で作った簡易モデルにマッピング

   Quantlibというオープンソースを利用してSWAP約定を入力するとExcel上で固定サイドと変動サイドのCashflowを生成してくれる。 それからNeo4j上で上記(2)のマッピングを基にCSVデータをNeo4JのFIBOへimport

f:id:William0105:20200712122246p:plain


(5)FIBOにMapping

Neo4Jのontology関数を利用すると簡単にマッピングができます。

以下です。

with [{ neoSchemaElem : "Swap", publicSchemaElem: "swap" },
{ neoSchemaElem : "swap_id",publicSchemaElem:"UniqueSwapIdentifier"},
{ neoSchemaElem : "paying_agent",publicSchemaElem:"SwapPayingParty"},
{ neoSchemaElem : "receiving_agent",publicSchemaElem:"SwapReceivingParty"},
{ neoSchemaElem : "notional_amount",publicSchemaElem:"MonetaryAmount"},
{ neoSchemaElem : "fx_business_center",publicSchemaElem:"BusinessCenter"},
{ neoSchemaElem : "fx_notional_amount",publicSchemaElem:"MonetaryAmount"},
{ neoSchemaElem : "fl_reference_ccy",publicSchemaElem:"CurrencyIdentifier"},
{ neoSchemaElem : "fl_tenor",publicSchemaElem: "CalendarPeriod"},
{ neoSchemaElem : "fl_business_center",publicSchemaElem:"BusinessCenter"},
{ neoSchemaElem : "fl_notional_amount",publicSchemaElem:"MonetaryAmount"},
{ neoSchemaElem : "fl_index_benchmark",publicSchemaElem:"InterestRateBenchmark"}
] as mappings,
"https://spec.edmcouncil.org/fibo/ontology/" AS schx
CALL n10s.nsprefixes.add("schx",schx) YIELD namespace
UNWIND mappings as m
CALL n10s.mapping.add(schx + m.publicSchemaElem,m.neoSchemaElem) YIELD schemaElement
RETURN count(schemaElement) AS mappingsDefined

 以下がマッピング結果。

f:id:William0105:20200713045335p:plain

f:id:William0105:20200713045409p:plain

  RDFへのマッピング手順は以下のURLを参照しました。

neo4j.com

 

以上