|
||||||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||||
See:
Description
| Packages | |
|---|---|
| edu.upc.dama.dex.algorithms | Provides classes in order to run algorithms among graphs. |
| edu.upc.dama.dex.core | Provides the main DEX classes with all the basic but complete funcionality for graph and data manipulation. |
| edu.upc.dama.dex.io | Provides funcionality to load DEX node or edge types from relational databases or CSV files as data sources as well as utilities to dump data. |
| edu.upc.dama.dex.script | Provides classes and tools used to help to create schemas and load data. |
| edu.upc.dama.dex.shell | Provides a useful command-line tool to query the content of a DbGraph (a DEX graph database). |
| edu.upc.dama.dex.utils | It provides some utilities which can be useful. |
$JAVA_HOME/bin/java -cp ./dex/jdex.jar myprog
DEX instance is a graph database management
system that manages one or more graph databases. Each graph database
is managed by an instance of the GraphPool
class which is responsible for all the memory and I/O management of a
graph database.
The persistent graph database is stored in a single DEX data file.
Temporary data generated during the activity of a DEX application,
such as Objects, is stored in a different
temporary file which is destroyed when the
GraphPool is closed.
Thus, a new empty GraphPool can be
created (DEX.create(File, String)), or an
existing GraphPool can be open from a
persistent DEX data file (DEX.open(File)).
Moreover, all activity with the graph database must be done through a
user's sessions which is created with the
GraphPool.newSession() method.
A Session keeps and manages all temporary
data, which is exclusive for the session.
Session and
are valid just while its Session is
active, that is it has not been closed.
Also, the persistent DbGraph is a
specialization of the Graph class which
follows the logical graph model defined previously.
Graph
are typed (labeled). Each object (node or edge) type has a unique numeric
identifier and a unique type name.
Graph has the
following properties:
Graph has the
following properties:
Graph
can have attributes. An attribute has the following properties:
Value.BOOL,
Value.INT,
Value.LONG,
Value.DOUBLE,
Value.STRING, or
Value.TIMESTAMP, or
Value.TEXT.Value allows for setting or getting
attribute values of nodes and edges.
Global attributes are those defined for all node and edge types.
That is, all node or edge objects (no matters which type they belong to)
can set and get values from that attribute identifier. To do that,
Identifiers.GLOBAL_TYPE must be used when creating
the attribute.
DEX.create(File,String)GraphPool.DEX.open(File)GraphPool.GraphPool.newSession()Session.Session.getDbGraph()DbGraph.Graph.newNodeType(String)Graph.newEdgeType(String, boolean)Graph.newRestrictedEdgeType(String, int, int)Graph.newAttribute(int, String, short, short)Graph.newNode(int)Graph.newEdge(long, long, int)Graph.getAttribute(long, long, edu.upc.dama.dex.core.Value)Graph.setAttribute(long, long, edu.upc.dama.dex.core.Value)Graph.drop(long)
![[IMG]Graph-DB](resources/graph-db.jpg)
These operations can be grouped in different areas.
Graph.select(int)Graph.select(long, short, Value)Value. The attribute
must be indexed or unique.Graph.explode(long, int, short)Graph.neighbors(long, int, short)Objects class is used to manage collections
of object (node or edge) identifiers, which are the result
of most of query methods. These collections can be traversed by means of
Objects.Iterators.
Additionally, a user can build its own temporary collections to store object identifiers. These collections can be updated adding or removing elements from them or using different methods to combine them.
Collections consume important resources from the core memory and from the
temporary storage. Thus, it is important to close
(Objects.close())
unused collections as soon as possible to recover their memory and resources.
Objects.union(edu.upc.dama.dex.core.Objects)Objects.intersection(edu.upc.dama.dex.core.Objects)Objects.difference(edu.upc.dama.dex.core.Objects)DEXConfig for
extended info.DEX.Config.GraphPool. These methods are:
GraphPool.dumpData(Session, String)GraphPool.dumpStorage(Session, String)GraphPool.Statistics
by means of the method
GraphPool.getStatistics().
Graph to different
formats in order to visualize it. To do that it is necessary to implement
the Export interface and call the
Graph.export(PrintWriter, edu.upc.dama.dex.core.Export.Type, edu.upc.dama.dex.core.Export)
method.
Nowadays it is possible to export a Graph
to:
edu.upc.dama.dex.script allows to create and populate
a graph database from CSV files and by means of a scripting language.
This way it is not necessary to develop any piece of code.
edu.upc.dama.dex.io allows to easily create and populate
a graph database from CSV files or relational databases by means of a
set of classes. In this case it will be necessary to develop a piece of
code which uses classes from this package.
edu.upc.dama.dex.shell contains an interactive shell
to query an existing graph database, that is an image file where a
GraphPool was previously created.
edu.upc.dama.dex.algorithms allows to run useful
algorithms among graphs in order to solve the following known problems:
SinglePairShortestPathBFS:
to solve the single pair shortest problem in unweighted graphs.
SinglePairShortestPathDijkstra:
to solve the single pair shortest problem in weighted graphs.
TraversalBFS:
to traverse a graph using the BFS algorithm.
TraversalDFS:
to traverse a graph using the DFS algorithm.
WeakConnectivityDFS:
to find all the weakly connected components in an undirected
graph.
StrongConnectivityGabow:
to find all the strongly connected components in a directed
graph.
![[IMG]Architecture](resources/architecture.jpg)
DEX has been built using an architecture of two layers as shown if the figure above.
Java applications must be built on top of the JDEX Java public API. Also, the public library must be installed into the Java classpath (the native library is included into the JDEX Java public library and automatically loaded from there).
| Benchmark | #Nodes | #Edges | Raw (GB) | Dex (GB) | Load |
|---|---|---|---|---|---|
| IMDB | 13338793 | 22259869 | 1.5 | 2.4 | 21m 8s |
| Social network | 90873017 | 663546226 | 11 | 32 | 298m |
| Scopus | 15107484 | 113294315 | 7 | 8 | 115m 50s |
| Wikipedia | 19490489 | 180230453 | 5.5 | 7.6 | 129m 53s |
| Xmark_25 | 4970162 | 9848812 | 1.9 | 2 | 15m |
DEX dex = new DEX();
GraphPool gpool = dex.create("C:/image.dex");
Session sess = gpool.newSession();
DbGraph dbg = sess.getDbGraph();
...
...
sess.close();
gpool.close();
dex.close();
...
sess.beginTx();
DbGraph dbg = sess.getDbGraph();
int person = dbg.newNodeType("PERSON");
long name = dbg.newAttribute(person, "NAME", STRING);
long age= dbg.newAttribute(person, "AGE", INT);
long p1 = dbg.newNode(person);
dbg.setAttribute(p1, name, "JOHN");
dbg.setAttribute(p1, age, 18);
long p2 = dbg.newNode(person);
dbg.setAttribute(p2, name, "KELLY");
long p3 = dbg.newNode(person);
dbg.setAttribute(p3, name, "MARY");
sess.commitTx();
...
...
sess.beginTx();
DbGraph dbg = sess.getDbGraph();
int friend = dbg.newUndirectedEdgeType("FRIEND");
int since = dbg.newAttribute(friend, "SINCE", INT);
long e1 = dbg.newEdge(p1, p2, friend);
dbg.setAttribute(e1, since, 2000);
long e2 = dbg.newEdge(p2, p3, friend);
dbg.setAttribute(e2, since, 1995);
...
int loves = dbg.newEdgeType("LOVES");
long e3 = dbg.newEdge(p1, p3, loves);
sess.commitTx();
...
...
sess.beginTx();
DbGraph dbg = sess.getDbGraph();
int phones = dbg.newEdgeType("PHONES");
int when = dbg.newAttribute(phones, "WHEN", TIMESTAMP);
long e4 = dbg.newEdge(p1, p3, phones);
dbg.setAttribute(e4, when, 4pm);
long e5 = dbg.newEdge(p1, p3, phones);
dbg.setAttribute(e5, when, 5pm);
long e6 = dbg.newEdge(p3, p2, phones);
dbg.setAttribute(e6, when, 6pm);
sess.commitTx();
...
...
sess.beginTx();
DbGraph dbg = sess.getDbGraph();
Objects persons = dbg.select(person);
Objects.Iterator it = persons.iterator();
while (it.hasNext()) {
long p = it.next();
String name = dbg.getAttribute(p, name);
}
it.close();
persons.close();
sess.commitTx();
...
...
DbGraph dbg = sess.getDbGraph();
...
Objects objs1 = dbg.select(when, >=, 5pm);
...
...
Objects objs2 = dbg.explode(p1, phones, OUT);
...
...
Objects objs = Objects.intersection(sess, objs1, objs2);
...
objs.close();
objs1.close();
objs2.close();
...
Software end-user license agreement
===================================
NOTICE TO THE USER: BY COPYING, INSTALLING OR USING THIS SOFTWARE OR PART
OF THIS SOFTWARE, YOU AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT
AS IF IT WERE A WRITTEN AGREEMENT NEGOTIATED AND SIGNED BY YOU. THIS
AGREEMENT IS ENFORCEABLE AGAINST YOU AND ANY OTHER LEGAL PERSON ACTING ON
YOUR BEHALF.
IF, AFTER READING THE TERMS AND CONDITIONS HEREIN, YOU DO NOT AGREE TO
THEM, YOU MAY NOT INSTALL THIS SOFTWARE ON YOUR COMPUTER.
SPARSITY, S.L. (hereinafter "The licensor") IS A SPANISH SPIN-OUT COMPANY
OF UNIVERSITAT POLITECNICA DE CATALUNYA (UPC) AND IS THE EXCLUSIVE
LICENSOR OF ALL THE INTELLECTUAL PROPERTY OF THE SOFTWARE AND ONLY
AUTHORIZES YOU TO USE THE SOFTWARE IN ACCORDANCE WITH THE TERMS SET OUT
IN THIS AGREEMENT.
1. Definitions
==============
"Software" means (a) all the information provided in this agreement,
including but not limited to (i) software files and other computer
information belonging to the licensor or third parties; (ii) written material
and explanatory files ("Documentation"); and (b) any modified versions
and copies of this information, such as improvements, updates and
additions to the information provided to you by the licensor at any time,
insofar as it is not the object of another agreement (collectively,
"Updates").
"User" means the physical or legal person who accepts the terms and
conditions of this agreement.
"Computer" means a computer device that accepts information in digital
or similar form and processes that information to achieve a specific
result based on a sequence of instructions.
2. Intellectual Property
========================
The Software and the authorized copies are property of UPC and Sparsity S.L
is the exclusive licensor. This agreement shall not imply the waiver or
transfer, in whole or in part , of this ownership neither by UPC nor the
licensor. The Software is protected by law, including, but not limited to,
the laws of Spain and other countries on intellectual property, and by the
applicable international agreements.
Except to the extent expressly stipulated here, this agreement does not
grant the user any intellectual property rights over the Software. All
rights not expressly granted are reserved for the licensor.
3. License
==========
The licensor grants the user a free and non-exclusive license to use the
Software. The user may
1) Install and use a copy of the Software for personal evaluation use
2) Develop software using the Software licensed for personal evaluation use
This agreement does not authorize the user to do any of the following:
1) Use or copy the Software in any way other than that specified in
this agreement;
2) Disassemble, decompile or translate the Software, or modify it in
any way other than that permitted by the specific Spanish law on
intellectual property;
3) Sublicense, lease, rent, sell, transfer or transmit his or her
right to the use of the Software.
4) Authorize the total or partial copying of the Software onto the
computer of another natural or legal person;
5) Use the Software as the basis for software developed by third
parties.
Should the user wish to license software developed using the licensed
Software to third parties, he or she should contact the licensor.
4. Limited Guarantee
====================
The licensor does not guarantee the uninterrupted or error-free operation
of a program or that any defects that may occur will be corrected.
The user is responsible for the results obtained through the use of
the software.
5. Liability
============
The licensor shall not be liable for any claims for damages, including
partial or total noncompliance, negligence, falsification or any other
claim
6. Authorization for the use of personal data
=============================================
The user accepts that the licensor uses their personal data for the
following purposes only:
- Communication on DEX updates
- Information about the licensor courses, events and any other licensor
product updates
In order to withdraw the authorization, the user shall send an e-mail to
the following e-mail address: info@sparsity-technologies.com
7. Other Provisions
===================
7.1 No legally recognized rights of the user shall be subject to
elimination or limitation in virtue of this agreement.
7.2 The licensor may terminate this license if the user fails to comply with
the conditions of this agreement. If the licensor decides to terminate the
license, this decision also terminates the authorization of the user to
make use of the Software.
7.3 The user may not bring any action which may arise from this agreement
more than two years after the cause of said action, unless otherwise
established by Spanish law without the possibility of contractual waiver
or limitation.
7.4 This license is indefinite and failure to comply with it by the user
may give rise to legal action by the licensor at any time.
7.5 The licensor shall not be liable for noncompliance with their obligations
when said noncompliance is due to force majeure.
7.6 This agreement is governed by Spanish law and the courts of Barcelona
shall be the authority competent to resolve any conflicts that may arise
from this agreement.
Barcelona, October 1st 2010
|
||||||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||||