<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">RDB2Graph: A Generic Framework for Modeling Relational Databases as Graphs</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author role="corresp">
							<persName><forename type="first">Min</forename><surname>Kang</surname></persName>
							<email>kangminyoo@europa.snu.ac.kr</email>
							<affiliation key="aff0">
								<orgName type="laboratory">Intelligent Data Systems Laboratory</orgName>
								<orgName type="institution">Seoul National University</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Sungchan</forename><surname>Yoo</surname></persName>
							<affiliation key="aff0">
								<orgName type="laboratory">Intelligent Data Systems Laboratory</orgName>
								<orgName type="institution">Seoul National University</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Sang-Goo</forename><surname>Park</surname></persName>
							<affiliation key="aff0">
								<orgName type="laboratory">Intelligent Data Systems Laboratory</orgName>
								<orgName type="institution">Seoul National University</orgName>
							</affiliation>
						</author>
						<author>
							<persName><surname>Lee</surname></persName>
							<affiliation key="aff0">
								<orgName type="laboratory">Intelligent Data Systems Laboratory</orgName>
								<orgName type="institution">Seoul National University</orgName>
							</affiliation>
						</author>
						<title level="a" type="main">RDB2Graph: A Generic Framework for Modeling Relational Databases as Graphs</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">527FE97A242907B4802E5490F5BEFAA8</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-23T23:31+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>relational database</term>
					<term>graph</term>
					<term>graph modeling</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Graph data mining is highly versatile, as it applies not only to graph data but to relational data, as long as it can be represented as pairs of relationships. However, modeling RDBs as graphs using existing methods is limited in describing semantics of the relational data. In this paper, we propose a two-phased graph-modeling framework that converts any RDB to a directed graph with richer semantics than previously allowed. We implemented the framework and used it for analyzing medical records of diabetes patients. 1</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>Graph data mining is a well-studied area of research because of numerous applications in fields such as social data mining and biochemical analysis <ref type="bibr" target="#b0">[1]</ref>. Recently, there has been a growing interest in applying graph mining techniques to relational databases, as viewing them as graph data exposes inherent semantics <ref type="bibr">[3] [4]</ref>. Since relational databases are a de facto standard in data warehousing, applying graph mining techniques to mine latent information from the massive relational data seems even more attractive.</p><p>However, modeling relational databases as graphs is not straight-forward, because it is challenging to devise appropriate models that expose underlying semantics. W3C formalized the graph-modeling process by defining a new language, R2RML <ref type="bibr" target="#b1">[2]</ref>, but the language is limited in describing some semantic aspects of graph conversion. For example, it cannot used to describe a vertex that combines several attributes (fig. <ref type="figure" target="#fig_1">1</ref>). It also fails at describing semantics not apparent in relational schemata, such as events that could be connected in chronological order (fig. <ref type="figure" target="#fig_2">2</ref>).</p><p>We propose a new framework to solve the current problem of modeling RDBs as graphs. The framework converts any RDB into a directed graph given some conversion rules (sec. 2). We have also implemented a program based on RDB2Graph (R2G) to analyze medicals records of diabetes patients.</p><p>Given a relational database D and a set of modeling rules, the framework generates a directed graph. The output of the framework is edge set E and vertex set V . Each vertex is a set of key-values, i.e. {(k 1 , l 1 ), (k 2 , l 2 ), . . . , (k n , l n )}, where each key in k 1 , . . . , k n corresponds to some attribute and each l in l 1 , . . . , l n is some value in D. An edge e is directed and denoted by (v s , v t ), where v s is the source vertex and v t is the target vertex. Both v s and v t are in V . Given some rule set Γ and D, framework must return E and V such that elements satisfy the specifications of Γ .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1">The Two-Phase Conversion</head><p>The conversion takes place in two phases -the first phase discovers relationships within each tuple, while the second phase establishes additional relationships among the vertices constructed from the first phase. Thus, Γ is an union of Γ 1 and Γ 2 , the rules for both phases respectively. Splitting in two phases is necessary because it allows incorporation of implicit relationships not apparent from the relational database itself. For each c in C s or C t , the corresponding value u in each tuple is paired with the corresponding k in K s or K t to form a key-value pair (k, u), which is added to the generated source or target vertex. An example of edge generation is presented in figure 2.1. The purpose of specifying the alias sets K s and K t is to combine semantically identical attributes together. For example, consider a case where relation r 1 has a foreign key constraint that references a primary key of another relation r 2 . Their attribute names might be different, but they are identical semantically. By having the ability to give a common key for the attributes, we are able to generate common vertices. It is apparent from figure 2.1 that some vertices have common key configurations (e.g. {id, date}). We call such key configurations vertex schemata.</p><p>Selection predicate p is similar to the counterpart of relational algebra. It can be directly used in SQL queries to filter out tuples. For each rule, the framework retrieves a set of tuples from T that satisfy the predicate and produces exactly one edge of (v s , v t ), which is added to E. The framework will also attempt to add v s and v t into V , if they do not exist already. At the end of phase I, E and V are generated and passed to phase II.</p><p>Phase II: Vertices to Edges Given the graph constructed from the previous phase, E and V , and phase II rules Γ 2 , the framework constructs additional edges that satisfy Γ 2 . In this phase, each rule of Γ 2 specifies the followings.</p><p>1. two sets of vertex schema (K s , K t ) 2. a bit (b) to indicate whether the generated edge is bidirectional or not 3. a vertex selection predicate (q) to filter vertices For each rule in Γ 2 , vertices with schema K s or K t are considered as source or target vertices of an additional edge. Given the vertices, the framework further filters them using vertex selection predicate q. An example of such edge generation is shown in figure <ref type="figure" target="#fig_2">2</ref>.1. q is different from p of Γ 1 -in p, left-hand side variables are references to some attributes of a relation; in q, left-hand side variables are references to some keys of either K s or K t . Phase II produces E and V as well, but with additional edges that satisfy Γ 2 . </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2">Implementation</head><p>Our implementation of the framework, SRCGraphModeler (SGM), is written in C#, and it connects to Oracle 11g based RDB. SGM converts each rule into PL/SQL procedures in order to run them on the database server, improving runtime efficiency. Using SGM, we converted medical records of diabetes patients into various graph models, then we applied graph analysis on the graphs to extract correlation among medications and symptoms.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">Conclusion</head><p>We have presented a graph-modeling framework that enables semantically richer conversions than that attempted by previous works. As future works, we plan to study how transformation of RDB data to graph data affects the information contained in it.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head></head><label></label><figDesc>Phase I: Tuples to Edges In order to create new vertices and edges from the relational database, a set of rules Γ 1 must specify the followings: 1. a target relation (r) 2. two sets of attributes (C s , C t ) from relation r to indicate which values of each tuple in r are stored as l in key-value pairs of source or target vertices 3. two sets of key aliases (K s , K t ) to indicate k in key-value pairs of source or target vertices. 4. a bit (b) to indicate whether the edge is bidirectional or not 5. a selection predicate (p) to filter tuples.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Fig. 1 .</head><label>1</label><figDesc>Fig. 1. Phase I edge construction based on the rule Cs = {p id, enter date}, Ct = {building no, duration}, Ks = {id, date}, Kt = {no, dur}, and b = 0.</figDesc><graphic coords="2,193.34,569.60,225.60,59.20" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Fig. 2 .</head><label>2</label><figDesc>Fig. 2. Phase II edge construction based on the rule Ks = {id, date}, Kt = {id, date}, b = 0, and q selects source and target vertices such that values of id are equal but the target date is the nearest later date to the source date.</figDesc><graphic coords="3,189.26,484.27,233.76,62.40" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head>Fig. 3 .</head><label>3</label><figDesc>Fig. 3. SRCGraphModeler is an implementation of RDB2Graph. It was used to analyze medical records of diabetes patients.</figDesc><graphic coords="4,174.16,115.84,263.96,144.47" type="bitmap" /></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">This work was supported by the National Research Foundation of Korea(NRF) grant funded by the Korea Government(MSIP) (No.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" xml:id="foot_1">20110030812).</note>
		</body>
		<back>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Managing and Mining Graph Data</title>
		<author>
			<persName><forename type="first">C</forename><surname>Charu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Haixun</forename><surname>Aggarwal</surname></persName>
		</author>
		<author>
			<persName><surname>Wang</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Advances in Database Systems</title>
				<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2010">2010</date>
			<biblScope unit="volume">40</biblScope>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<monogr>
		<title level="m" type="main">R2RML: RDB to RDF Mapping Language</title>
		<author>
			<persName><forename type="first">Souripriya</forename><surname>Das</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Seema</forename><surname>Sundara</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Richard</forename><surname>Cyganiak</surname></persName>
		</author>
		<ptr target="http://www.w3.org/TR/r2rml" />
		<imprint>
			<date type="published" when="2012-09">September 2012</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<monogr>
		<title level="m" type="main">A Graph-based Framework for Processing Keyword Queries over Relational Databases</title>
		<author>
			<persName><forename type="first">Jaehui</forename><surname>Park</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2012">2012</date>
		</imprint>
		<respStmt>
			<orgName>Seoul National University</orgName>
		</respStmt>
	</monogr>
	<note type="report_type">PhD thesis</note>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Modeling Relational Data as Graphs for Mining</title>
		<author>
			<persName><forename type="first">Sharma</forename><surname>Subhesh Pradhan</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Aditya</forename><surname>Chakravarthy</surname></persName>
		</author>
		<author>
			<persName><surname>Telang</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Management of Data</title>
				<imprint>
			<date type="published" when="2009">2009</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
