-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathdatabase.html
More file actions
executable file
·612 lines (601 loc) · 31.2 KB
/
database.html
File metadata and controls
executable file
·612 lines (601 loc) · 31.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
<div class="content">
<h1>The Sourcerer Database</h1>
<div class="content_item">
<p>The Sourcerer database is a relational database containing entity/relationship models of the projects from the Sourcerer Java Repository. These models are automatically generated by the extractor tool and then imported into a MySQL database. A database server serving this complete data is publicly accessible for read-only access.</p>
<p class="warning">If you are interested in exploring this database on our server, please contact us for credentials.</p>
<h1>Datasets and Schemas</h1>
<p>The sourcerer relational database is composed by 4 schemas, where 3 represent subsets and the last one represents their aggregation:</p>
<ul>
<li><strong>apache:</strong> A subset of sourcerer representing Apache projects (<a href="schema_apache_HTML/index.html" target="_blank">schema</a>)</li>
<li><strong>google:</strong> A subset of sourcerer representing projects from Google Code (<a href="schema_google_HTML/index.html" target="_blank">schema</a>)</li>
<li><strong>jdk:</strong> A subset of sourcerer representing projects from Java OpenJDK (<a href="schema_jdk_HTML/index.html" target="_blank">schema</a>)</li>
<li><strong>utilization:</strong> A subset of sourcerer representing the three subsets above (<a href="schema_utilization_HTML/index.html" target="_blank">schema</a>)</li>
<li><strong>sourcerer:</strong> deprecated database</li>
</ul>
The schemas presented here were extracted using the tool <a href="http://schemaspy.sourceforge.net/" target="_blank">SchemaSpy</a>.
<h2>Examples of Queries</h2>
<p>Source Lines of Code (SLOC) per project:</p>
<p class="command-line-block" >select * from project_metrics WHERE metric_type='CODE_LOC';</p>
<p>Number of classes per project:</p>
<p class="command-line-block" >select p.project_id, IFNULL(count(distinct entity_id),0) from entities as e right join projects as p on p.project_id=e.project_id where e.entity_type='CLASS' and p.project_type='CRAWLED' group by p.project_id;</p>
<p>Number of interfaces per project:</p>
<p class="command-line-block" >select p.project_id, IFNULL(count(distinct entity_id),0) from entities as e right join projects as p on p.project_id=e.project_id where e.entity_type='INTERFACE' and p.project_type='CRAWLED' group by p.project_id;</p>
<p>Number of methods per project:</p>
<p class="command-line-block" >select p.project_id, IFNULL(count(distinct entity_id),0) from entities as e right join projects as p on p.project_id=e.project_id where e.entity_type='METHOD' and p.project_type='CRAWLED' group by p.project_id;</p>
<p>Number of class methods per project:</p>
<p class="command-line-block" >select p.project_id, IFNULL(count(distinct m.entity_id),0) from entities as m inner join relations as r on m.entity_id=r.rhs_eid inner join entities as c on c.entity_id=r.lhs_eid right join projects as p on p.project_id=m.project_id where m.entity_type='METHOD' and r.relation_type='CONTAINS' and c.entity_type='CLASS' and p.project_type='CRAWLED' group by p.project_id;</p>
<p>Number of method calls per project:</p>
<p class="command-line-block" >select p.project_id, IFNULL(count(distinct relation_id),0) from relations as r right join projects as p on p.project_id=r.project_id where r.relation_type='CALLS' and p.project_type='CRAWLED' group by p.project_id;</p>
<p>Number of instanceof statements:</p>
<p class="command-line-block" >select p.project_id, IFNULL(count(distinct relation_id),0) from relations as r right join projects as p on p.project_id=r.project_id where r.relation_type='CHECKS' and p.project_type='CRAWLED' group by p.project_id;</p>
<p>Number of casts:</p>
<p class="command-line-block" >select p.project_id, IFNULL(count(distinct relation_id),0) from relations as r right join projects as p on p.project_id=r.project_id where r.relation_type='CASTS' and p.project_type='CRAWLED' group by p.project_id;</p>
<p>How many classes in each project extend a class? (that's not Object):</p>
<p class="command-line-block" >select p.project_id, ifnull(count(distinct child.entity_id),0) from entities as child inner join relations as r on r.lhs_eid=child.entity_id and r.rhs_eid != (select entity_id from entities where fqn='java.lang.Object') right join projects as p on p.project_id=r.project_id where child.entity_type='CLASS' and r.relation_type='EXTENDS' and p.project_type='CRAWLED' group by p.project_id;</p>
</div>
</div>
<div class="content">
<h1>Database Schema - A Quick Tutorial</h1>
<div class="content_item">
<p>The SourcererDB schema is a direct manifestation of the metamodel used by the
extractor. At its core, the metamodel represents entities in the code (such as
classes, methods and fields) and the relations between these entities (such
as containment and invocation). In addition to the entities and relations,
Sourcerer database contains tables for the projects, files and comments. Each
table will now be discussed in detail.</p>
<h1>Projects Table</h1>
<p>This table contains a listing of all the projects in the repository.</p>
<table cellspacing="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Nullable?</th>
<th>Indexed?</th>
<th>Description</th>
</tr>
<tr class="bga">
<td class="fixed bold">project_id</td>
<td class="fixed">SERIAL</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>A unique id assigned by the database.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">project_type</td>
<td class="fixed">ENUM(values)</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>The type of the project.</td>
</tr>
<tr class="bga">
<td class="fixed bold">name</td>
<td class="fixed">VARCHAR(1024)</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>The name of the project in the originating repository.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">description</td>
<td class="fixed">VARCHAR(4096)</td>
<td class="cent">Yes</td>
<td class="cent">No</td>
<td>Optional project description.</td>
</tr>
<tr class="bga">
<td class="fixed bold">version</td>
<td class="fixed">VARCHAR(1024)</td>
<td class="cent">Yes</td>
<td class="cent">No</td>
<td>Project version number. Only used for MAVEN projects.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">groop</td>
<td class="fixed">VARCHAR(1024)</td>
<td class="cent">Yes</td>
<td class="cent">Yes</td>
<td>Project's Maven group. Only used for MAVEN projects.</td>
</tr>
<tr class="bga">
<td class="fixed bold">path</td>
<td class="fixed">VARCHAR(1024)</td>
<td class="cent">Yes</td>
<td class="cent">No</td>
<td>The relative path of the project within the repository. Only used for JAVA_LIBRARY and CRAWLED projects.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">source</td>
<td class="fixed">VARCHAR(1024)</td>
<td class="cent">Yes</td>
<td class="cent">Yes</td>
<td>The original source of the project.</td>
</tr>
<tr class="bga">
<td class="fixed bold">hash</td>
<td class="fixed">VARCHAR(32)</td>
<td class="cent">Yes</td>
<td class="cent">Yes</td>
<td>The md5 hash of the project. Only used for JAR and MAVEN projects.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">has_source</td>
<td class="fixed">BOOLEAN</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>Does the project have source code? Will be false for some jar files.</td>
</tr>
</table>
<p>There are five different type of projects represented in this table:</p>
<div class="list">
<h4 class="fixed">SYSTEM</h4>
<p>These are two special projects not corresponding directly to anything from the repository.
The first system project contains the primitive types provided by the Java language. The second
system project contains all the unknown entities, which are the result of unresolved references.</p>
<h4 class="fixed">JAVA_LIBRARY</h4>
<p>These projects are the jar files included with distributions of Java. The largest is
<span class="fixed">rt.jar</span>, which contains the classes most associate with the Java Standard Library</p>
<h4 class="fixed">CRAWLED</h4>
<p>These are the projects aggregated from online repositories.</p>
<h4 class="fixed">JAR</h4>
<p>Each unique jar file from the CRAWLED projects is considered a project in its own right.</p>
<h4 class="fixed">MAVEN</h4>
<p>Each MAVEN project is a jar file downloaded from the <a href="http://central.sonatype.org/" target="_blank">Maven Central Repository</a>.</p>
<h1>Files Table</h1>
<p>This table contains a listing of the files in the projects.</p>
<table cellspacing="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Nullable?</th>
<th>Indexed?</th>
<th>Description</th>
</tr>
<tr class="bga">
<td class="fixed bold">file_id</td>
<td class="fixed">SERIAL</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>A unique id assigned by the database.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">file_type</td>
<td class="fixed">ENUM(valus)</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>The type of the file.</td>
</tr>
<tr class="bga">
<td class="fixed bold">name</td>
<td class="fixed">VARCHAR(1024)</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>The name of the file.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">path</td>
<td class="fixed">VARCHAR(1024)</td>
<td class="cent">Yes</td>
<td class="cent">No</td>
<td>The relative path of the file within the project. Only used for SOURCE and CLASS files.</td>
</tr>
<tr class="bga">
<td class="fixed bold">hash</td>
<td class="fixed">VARCHAR(32)</td>
<td class="cent">Yes</td>
<td class="cent">Yes</td>
<td>The md5 hash of the file. Only used for JAR files.</td>
<tr class="bgb">
<td class="fixed bold">project_id</td>
<td class="fixed">BIGINT UNSIGNED</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>The id of the project containing this file.</td>
</tr>
</table>
<p>There are three types of files represented in this table:</p>
<div class="list">
<h4 class="fixed">SOURCE</h4>
<p>These are files for which there was source code. Any project type,
except SYSTEM, can contain SOURCE files.</p>
<h4 class="fixed">CLASS</h4>
<p>These are files for which there was only byte code. Any project type,
except SYSTEM and CRAWLED, can contain CLASS files. Any <span class="fixed">.class</span>
files from CRAWLED projects not packaged into a jar file are ignored by the extractor.
<h4 class="fixed">JAR</h4>
<p>These are the jar files contained within CRAWLED projects. To find the details
of what is inside each jar file, simply find the JAR project with the matching md5
hash. JAR files from different projects may be copies (and hence have the same
md5 hash), while each JAR project is unique.</p>
<h1>Entities Table</h1>
<p>This table contains a listing of the entities extracted from the files.
<table cellspacing="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Nullable?</th>
<th>Indexed?</th>
<th>Description</th>
</tr>
<tr class="bga">
<td class="fixed bold">entity_id</td>
<td class="fixed">SERIAL</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>A unique id assigned by the database.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">entity_type</td>
<td class="fixed">ENUM(values)</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>The type of the entity.</td>
</tr>
<tr class="bga">
<td class="fixed bold">modifiers</td>
<td class="fixed">SET(values)</td>
<td class="cent">Yes</td>
<td class="cent">No</td>
<td>Java modifiers associated with the entity. Only valid for entity types that can have modifiers.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">fqn</td>
<td class="fixed">VARCHAR(8192)</td>
<td class="cent">Yes</td>
<td class="cent">Yes</td>
<td>The fully-qualified name (FQN) of the entity.</td>
</tr>
<tr class="bga">
<td class="fixed bold">params</td>
<td class="fixed">VARCHAR(8192)</td>
<td class="cent">Yes</td>
<td class="cent">Yes</td>
<td>The method parameters.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">raw_params</td>
<td class="fixed">VARCHAR(8192)</td>
<td class="cent">Yes</td>
<td class="cent">Yes</td>
<td>The raw method parameters (after type erasure).</td>
</tr>
<tr class="bga">
<td class="fixed bold">multi</td>
<td class="fixed">INT UNSIGNED</td>
<td class="cent">Yes</td>
<td class="cent">No</td>
<td>A multi-purpose column for storing additional information. Used by certain entity types.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">project_id</td>
<td class="fixed">BIGINT UNSIGNED</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>The id of the project that contains this entity.</td>
</tr>
<tr class="bga">
<td class="fixed bold">file_id</td>
<td class="fixed">BIGINT UNSIGNED</td>
<td class="cent">Yes</td>
<td class="cent">Yes</td>
<td>The id of the file that contains this entity. Some entities are not associated with specific files.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">offset</td>
<td class="fixed">INT UNSIGNED</td>
<td class="cent">Yes</td>
<td class="cent">No</td>
<td>The offset to the start of the entity in its originating file.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">length</td>
<td class="fixed">INT UNSIGNED</td>
<td class="cent">Yes</td>
<td class="cent">No</td>
<td>The length of the entity in its originating file.</td>
</tr>
</table>
<p>There are twenty one different types of entities represented in this table. Each entity
type, unless otherwise specified, may have a location associated with it. If it has a
location, then the file_id, offset and length will all be non-null. Any entity
derived from a CLASS file will not have a location.</p>
<table cellspacing="0">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr class="bga">
<td class="fixed">PACKAGE</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/packages.html" target="_blank">package</a>. Has no location or modifiers.</td>
</tr>
<tr class="bgb">
<td class="fixed">CLASS</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html" target="_blank">class</a> declaration.</td>
</tr>
<tr class="bga">
<td class="fixed">INTERFACE</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/interfaces.html" target="_blank">interface</a> declaration.</td>
</tr>
<tr class="bgb">
<td class="fixed">ENUM</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.9" target="_blank">enum</a> declaration.</td>
</tr>
<tr class="bga">
<td class="fixed">ANNOTATION</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/interfaces.html#9.6" target="_blank">annotation</a> type declaration.</td>
</tr>
<tr class="bgb">
<td class="fixed">INITIALIZER</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.6" target="_blank">initializer</a> declaration, both instance and static.</td>
</tr>
<tr class="bga">
<td class="fixed">FIELD</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.3" target="_blank">field</a> declaration.</td>
</tr>
<tr class="bgb">
<td class="fixed">ENUM_CONSTANT</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.9" target="_blank">enum constant</a> declaration.</td>
</tr>
<tr class="bga">
<td class="fixed">CONSTRUCTOR</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.8" target="_blank">constructor</a> declaration.</td>
</tr>
<tr class="bgb">
<td class="fixed">METHOD</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4" target="_blank">method</a> declaration.</td>
</tr>
<tr class="bga">
<td class="fixed">ANNOTATION_ELEMENT</td>
<td>A Java method <a href="http://java.sun.com/docs/books/jls/third_edition/html/interfaces.html#9.6" target="_blank">annotation type element</a> declaration.</td>
</tr>
<tr class="bgb">
<td class="fixed">PARAMETER</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.1" target="_blank">formal parameter</a> declaration.</td>
</tr>
<tr class="bga">
<td class="fixed">LOCAL_VARIABLE</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/statements.html#14.4" target="_blank">local variable</a> declaration. The FQN of a LOCAL_VARIABLE is just its name.</td>
</tr>
<tr class="bgb">
<td class="fixed">PRIMIVITE</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.2" target="_blank">primitive type</a>. Only contained in the primitives SYSTEM project. Has no modifiers or location.</td>
</tr>
<tr class="bga">
<td class="fixed">ARRAY</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/arrays.html#10.1" target="_blank">array type</a>. Has no modifiers or location.</td>
</tr>
<tr class="bgb">
<td class="fixed">TYPE_VARIABLE</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.4" target="_blank">type variable</a>. Has no modifiers or location.</td>
</tr>
<tr class="bga">
<td class="fixed">WILDCARD</td>
<td>A Java type <a href="http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.5.1" target="_blank">wildcard</a>. Has no modifiers or location.</td>
</tr>
<tr class="bgb">
<td class="fixed">PARAMETRIZED_TYPE</td>
<td>A Java <a href="http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.5" target="_blank">parametrized type</a>. Has no modifiers or location.</td>
</tr>
<tr class="bga">
<td class="fixed">DUPLICATE</td>
<td>An entity created when it is unclear exactly which type was referenced by a relation. Has no modifiers or location.</td>
</tr>
<tr class="bgb">
<td class="fixed">VIRTUAL_DUPLICATE</td>
<td>An entity created when it is unclear exactly which interface method was referenced by a virtual method call. Has no modifiers or location.</td>
</tr>
<tr class="bga">
<td class="fixed">UNKNOWN</td>
<td>An entity created when the type referenced by a relation is unknown. Has no modifiers or location.</td>
</tr>
</table>
<h1>Relations Table</h1>
<p>This table contains a listing of the relations extracted from the files and linking the entities.</p>
<table cellspacing="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Nullable?</th>
<th>Indexed?</th>
<th>Description</th>
</tr>
<tr class="bga">
<td class="fixed bold">relation_id</td>
<td class="fixed">SERIAL</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>A unique id assigned by the database.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">relation_type</td>
<td class="fixed">ENUM(values)</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>The type of the relation.</td>
</tr>
<tr class="bga">
<td class="fixed bold">relation_class</td>
<td class="fixed">ENUM(values)</td>
<td class="cent">No</td>
<td class="cent">No</td>
<td>The class of the relation.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">lhs_eid</td>
<td class="fixed">BIGINT UNSIGNED</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>The id of the source entity of the relation.</td>
</tr>
<tr class="bga">
<td class="fixed bold">rhs_eid</td>
<td class="fixed">BIGINT UNSIGNED</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>The id of the target entity of the relation.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">project_id</td>
<td class="fixed">BIGINT UNSIGNED</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>The id of the project containing the relation.</td>
</tr>
<tr class="bga">
<td class="fixed bold">file_id</td>
<td class="fixed">BIGINT UNSIGNED</td>
<td class="cent">Yes</td>
<td class="cent">Yes</td>
<td>The id of the file containing the relation. Some relations are not associated with specific files.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">offset</td>
<td class="fixed">INT UNSIGNED</td>
<td class="cent">Yes</td>
<td class="cent">Yes</td>
<td>The offset to the start of the relation in its originating file.</td>
</tr>
<tr class="bga">
<td class="fixed bold">length</td>
<td class="fixed">INT UNSIGNED</td>
<td class="cent">Yes</td>
<td class="cent">Yes</td>
<td>The length of the relation in its originating file.</td>
</tr>
</table>
<p>There are twenty-two different types of relations represented in this table. Each
relation type, unless otherwise specified, may have a location associated with it. If it
has a location, then the file_id, offset and length will all be non-null. Any entity
derived from a CLASS file with not have a location.</p>
<table cellspacing="0">
<tr>
<th>Type</th>
<th>Description</th>
</tr>
<tr class="bga">
<td class="fixed">CONTAINS</td>
<td>Physical containment. For example, a CLASS CONTAINS a METHOD.</td>
</tr>
<tr class="bgb">
<td class="fixed">EXTENDS</td>
<td>Class extension. For example, a CLASS EXTENDS a CLASS.</td>
</tr>
<tr class="bga">
<td class="fixed">IMPLEMENTS</td>
<td>Interface implementation and extension. For example, a CLASS IMPLEMENTS an INTERFACE or an INTERFACE IMPLEMENTS an INTERFACE.</td>
</tr>
<tr class="bgb">
<td class="fixed">HOLDS</td>
<td>Type of a field. For example, a FIELD HOLDS a CLASS.</td>
</tr>
<tr class="bga">
<td class="fixed">RETURNS</td>
<td>The return type of a method. For example, a METHOD RETURNS a CLASS.</td>
</tr>
<tr class="bgb">
<td class="fixed">READS</td>
<td>A field being read. For example, a METHOD READS a FIELD.</td>
</tr>
<tr class="bga">
<td class="fixed">WRITES</td>
<td>A field being written. For example, a METHOD WRITES a FIELD.</td>
</tr>
<tr class="bgb">
<td class="fixed">CALLS</td>
<td>Method invocation. For example, a METHOD CALLS a METHOD.</td>
</tr>
<tr class="bga">
<td class="fixed">INSANTIATES</td>
<td>Constructor invocation. For example, a METHOD INSTANTIATES a CONSTRUCTOR.</td>
</tr>
<tr class="bgb">
<td class="fixed">THROWS</td>
<td>A throws clause. For example, a METHOD THROWS a CLASS.</td>
</tr>
<tr class="bga">
<td class="fixed">CASTS</td>
<td>A cast expression. For example, a METHOD CASTS a CLASS.</td>
</tr>
<tr class="bgb">
<td class="fixed">CHECKS</td>
<td>An instanceof expression. For example, a METHOD CHECKS a CLASS.</td>
</tr>
<tr class="bga">
<td class="fixed">ANNOTATED_BY</td>
<td>A type is annotated. For example, a METHOD is ANNOTATED_BY a CLASS.</td>
</tr>
<tr class="bgb">
<td class="fixed">USES</td>
<td>A type is referenced. For example, a METHOD USES a CLASS.</td>
</tr>
<tr class="bga">
<td class="fixed">HAS_ELEMENTS_OF</td>
<td>The element type of an array. For example, an ARRAY HAS_ELEMENTS_OF a CLASS.</td>
</tr>
<tr class="bgb">
<td class="fixed">PARAMETRIZED_BY</td>
<td>A type has type parameters. For example, a METHOD is PARAMETRIZED_BY a TYPE_VARIABLE.</td>
</tr>
<tr class="bga">
<td class="fixed">HAS_BASE_TYPE</td>
<td>The base type of a parametrized type. For example, a PARAMETRIZED_TYPE HAS_BASE_TYPE of a CLASS.</td>
</tr>
<tr class="bgb">
<td class="fixed">HAS_TYPE_ARGUMENT</td>
<td>A type parameter is bound to a specific type. For example, a PARAMETRIZED_TYPE HAS_TYPE_ARGUMENT of a CLASS.</td>
</tr>
<tr class="bga">
<td class="fixed">HAS_UPPER_BOUND</td>
<td>The upper bound of a wildcard. For example, a WILDCARD HAS_UPPER_BOUND of a CLASS.</td>
</tr>
<tr class="bgb">
<td class="fixed">HAS_LOWER_BOUND</td>
<td>The lower bound of a wildcard. For example, a WILDCARD HAS_LOWER_BOUND of a CLASS.</td>
</tr>
<tr class="bga">
<td class="fixed">OVERRIDES</td>
<td>A method overrides a method. For example, a METHOD OVERRIDES a METHOD.</td>
</tr>
<tr class="bgb">
<td class="fixed">MATCHES</td>
<td>A duplicate type matches a number of types. For example, a DUPLICATE MATCHES a CLASS.</td>
</tr>
</table>
<p>There are five different relation classes. A relation's class tries to capture
the relationship between the source and the target of the relation.</p>
<div class="list">
<h4 class="fixed">JAVA_LIBRARY</h4>
<p>The relation's target is an entity from a JAVA_LIBRARY project.</p>
<h4 class="fixed">INTERNAL</h4>
<p>The relation's target is an entity from the same project.</p>
<h4 class="fixed">EXTERNAL</h4>
<p>The relation's target is an entity in some external project.</p>
<h4 class="fixed">UNKNOWN</h4>
<p>It is unknown where the relation's target is.</p>
<h4 class="fixed">NOT_APPLICABLE</h4>
<p>It does not make sense to classify this relation type as internal or external.</p>
<h1>Comments Table</h1>
<p>This table contains a listing of the comments extracted from the files.</p>
<table cellspacing="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Nullable?</th>
<th>Indexed?</th>
<th>Description</th>
</tr>
<tr class="bga">
<td class="fixed bold">comment_id</td>
<td class="fixed">SERIAL</td>
<td class="cent">No</td>
<td class="cent">Yes</td>
<td>A uniqueid assigned by the database.</td>
</tr>
<tr class="bgb">
<td class="fixed bold">comment_type</td>
<td class="fixed">ENUM(values)</td>
<td class="cent">No</td>
<td class="cent">No</td>
<td>The type of the comment.</td>
</tr>
</table>
</div>
</div>