Skip to content

Commit

Permalink
add IBM Anti Money Laundering (aml) dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
rderbier committed Jan 15, 2025
1 parent 6a37b68 commit 89cf9c1
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
37 changes: 37 additions & 0 deletions data/aml/AML_Trans.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<Account.bank>: uid .
<Account.id>: string @index(hash) .
<Bank.id>: string @index(hash) .
<Transaction.amount_paid>: float @index(float) .
<Transaction.amount_received>: float @index(float) .
<Transaction.from>: uid @reverse .
<Transaction.payment_currency>: string .
<Transaction.payment_type>: string @index(hash) .
<Transaction.receiving_currency>: string .
<Transaction.to>: uid @reverse .
<Transaction.timestamp>: datetime @index(day) .
<Transaction.laundering>: bool @index(bool) .
<Transaction.id>: string @index(hash) .

<xid>: string @index(exact) @upsert .

type <Bank> {
<Bank.id>
}

type <Account> {
<Account.id>
<Account.bank>
}

type <Transaction> {
<Transaction.id>
<Transaction.timestamp>
<Transaction.amount_paid>
<Transaction.amount_received>
<Transaction.from>
<Transaction.payment_currency>
<Transaction.payment_type>
<Transaction.receiving_currency>
<Transaction.to>
<Transaction.laundering>
}
3 changes: 3 additions & 0 deletions data/aml/HI-Small_Trans.rdf.gz
Git LFS file not shown
23 changes: 23 additions & 0 deletions data/aml/HI-Small_Trans.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Timestamp,From Bank,Account,To Bank,Account,Amount Received,Receiving Currency,Amount Paid,Payment Currency,Payment Format,Is Laundering

<_:Bank_[From Bank]> <dgraph.type> "Bank" .
<_:Bank_[From Bank]> <Bank.id> "[From Bank]" .
<_:Bank_[To Bank]> <dgraph.type> "Bank" .
<_:Bank_[To Bank]> <Bank.id> "[To Bank]" .
<_:A_[From Account]> <dgraph.type> "Account" .
<_:A_[From Account]> <Account.id> "[From Account]" .
<_:A_[From Account]> <Account.bank> <_:Bank_[From Bank]> .
<_:A_[To Account]> <dgraph.type> "Account" .
<_:A_[To Account]> <Account.id> "[To Account]" .
<_:A_[To Account]> <Account.bank> <_:Bank_[To Bank]> .
<_:T_[LINENUMBER]> <Transaction.id> "[Timestamp],[From Bank],[From Account]" .
<_:T_[LINENUMBER]> <dgraph.type> "Transaction" .
<_:T_[LINENUMBER]> <Transaction.from> <_:A_[From Account]> .
<_:T_[LINENUMBER]> <Transaction.to> <_:A_[To Account]> .
<_:T_[LINENUMBER]> <Transaction.timestamp> "=datetime([Timestamp],%Y/%m/%d %H:%M)" .
<_:T_[LINENUMBER]> <Transaction.amount_received> "[Amount Received]" .
<_:T_[LINENUMBER]> <Transaction.receiving_currency> "[Receiving Currency]" .
<_:T_[LINENUMBER]> <Transaction.amount_paid> "[Amount Paid]" .
<_:T_[LINENUMBER]> <Transaction.payment_currency> "[Payment Currency]" .
<_:T_[LINENUMBER]> <Transaction.payment_type> "[Payment Format]" .
<_:T_[LINENUMBER]> <Transaction.laundering> "[Is Laundering]" .
14 changes: 14 additions & 0 deletions data/aml/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

IBM Transactions for Anti Money Laundering (AML)
from
https://www.kaggle.com/datasets/ealtman2019/ibm-transactions-for-anti-money-laundering-aml

The folder contains a schema file and RDF files created from
HI-Small_Trans.csv

RDF file has been created using [csv_to_rdf](https://github.com/hypermodeinc/dgraph-experimental/blob/main/data-import/csv-to-rdf/csv_to_rdf.py) python script from
dgraph experimental repository, using the template file provided in this folder.

See the corresponding HI_Small_Patterns.tx file for generated fraudulent transactions. These transactions are labeled as Transaction.laundering true in the dataset.


0 comments on commit 89cf9c1

Please sign in to comment.