Fork me on GitHub

Kategorie: GraphDB

Today we added a plug-in to the 2.1 ver­sion of the com­mu­nity edi­tion of GraphDB which is called “FastIm­port”. It’s basi­cally a bulk import plug-in which takes a pro­pri­etary XML for­mat as input and imports ver­tices and edges into a run­ning GraphDB instance.

In order to use this new plug-in and import fea­ture you need to know that an import basi­cally splits into a two-stage process:

  1. scheme setup
  2. fast-import

So first you’ll have to define which ver­tex and edge types get imported by the fol­low­ing step 2 – you nor­mally do this using the GraphQL and spec­i­fy­ing sev­eral ver­tex types. For demon­stra­tion pur­poses we take a small social net­work with only one ver­tex type:

CREATE VERTEX TYPE User ATTRIBUTES (String Name, Int64 Age, Set<User> Friends)

After hav­ing set-up the scheme the only thing left is to actu­ally call the import plug-in using another short GraphQL query:

IMPORT FROM ‘file:\\100k_import.xml’ FORMAT FastImport

This will, for exam­ple, take the 100.000 user dataset and import it into the cur­rent GraphDB instance. Of course we did that already for you so here are the com­par­i­son results between a GraphQL and FastIm­port and the per­sis­tent and In-Memory ver­sion of GraphDB:

in-Memory_import

persistent_import

 

Of course you can also down­load the data-sets used in this small bench­mark here:

10.000 Users / 592.374 edges : GraphQL Import , FastIm­port

100.000 Users / 5.944.332 edges : GraphQL Import, FastIm­port

In the course of our work at sones GraphDB 2.1 we refac­tored our index inter­faces to make them more suit­able for our needs. Fur­ther­more, we wanted to make it eas­ier for the com­mu­nity to imple­ment cus­tom index struc­tures for their spe­cial needs. For the lat­ter rea­son we set up a tuto­r­ial and pub­lished a sam­ple imple­men­ta­tion on github.

The inter­faces are explained in our devel­oper wiki, the tuto­r­ial can also be found there. The source code regard­ing the tuto­r­ial is located at github.

Source 1: Index Inter­faces at devel­oper wiki
Source 2: Inte­gra­tion tuto­r­ial at devel­oper wiki
Source 3: Source code at github

We always think about new ways to inte­grate GraphDB into exist­ing envi­ron­ments. And one of those envi­ron­ments our users are work­ing with right now are the sev­eral Enter­prise Ser­vice Busses which are avail­able right now.

One big player in the ESB envi­ron­ment is the Mule Open Source ESB:

Mule is a light­weight enter­prise ser­vice bus (ESB) and inte­gra­tion frame­work. It can han­dle ser­vices and appli­ca­tions using dis­parate trans­port and mes­sag­ing tech­nolo­gies. The plat­form is Java-based, but can bro­ker inter­ac­tions between other plat­forms such as .NET using web ser­vices or sockets.

The archi­tec­ture is a scal­able, highly-distributable object bro­ker that can seam­lessly han­dle inter­ac­tions across legacy sys­tems, in-house appli­ca­tions and almost all mod­ern trans­ports and protocols.”

In order to show how a GraphDB inte­grates into those typ­i­cal ESB envi­ron­ments we cre­ated a small example.

The archi­tec­ture of this exam­ple is like this:

mule-esb

The idea behind this is that an exam­ple Message-WebApp is post­ing a mes­sage to the Mule ESB and then this mes­sage gets trans­formed and in the last con­se­quence con­sumed by a sones REST­ful web­ser­vice hosted by a GraphDB.

You can read more in this tuto­r­ial here and you can down­load the source­code here.

Source 1: http://www.mulesoft.org/
Source 2: https://github.com/sones/sones-mule
Source 3: http://developers.sones.de/wiki/doku.php?id=tutorials:muleexampleapp

With ver­sion 2.0 of sones GraphDB we intro­duced an enhanced graph model we call Prop­erty Hyper­graph.


In this Prop­erty Hyper­graph model there are some stan­dard edge types:

  • single-edge: an edge between two vertices
  • multi-edge: an edge split­ting up into single-edges of the same edge type point­ing towards the same ver­tex type.
  • hyper-edge: an edge to a sub­graph made up by all pos­si­ble types of vertices

In order to cre­ate dif­fer­ent ver­tex types since ver­sion 1.0 of sones GraphDB the GraphQL com­mand “CREATE VERTEX TYPE” is avail­able to users. In ver­sion 2.0 we intro­duced edge types but those were only use­able if you would use the API to inter­act with the GraphDB instance.

In ver­sion 2.1 we’ve now added a full edge type man­age­ment to be used either through GraphDBs new edge-type API and of course through the new GraphQL exten­sions which add edge-type handling.

So for exam­ple let’s say you want to cre­ate an edge type “User” and insert a bunch of those. And you want those users to be con­nected by a spe­cific edge type which comes with it’s own attrib­utes – some­thing like this:

The GraphQL Queries to cre­ate the above scheme would be these:

CREATE EDGE TYPE User­Link ATTRIBUTES (Dou­ble weight, String pri­or­ity, LIST<String> tags) COMMENT = ‘This is my edge type named User­Link.’
CREATE VERTEX TYPE User ATTRIBUTES (String name, SET<User(UserLink)> friends)
INSERT INTO User VALUES (name = ‘UserA’)
INSERT INTO User VALUES (name = ‘UserB’, friends = SETOF(name = ‘UserA’ : (weight = 15.5, pri­or­ity = ‘high’, tags = LISTOF(‘best friend’, ‘mate’))))

As you can see it’s easy to actu­ally cre­ate edge types and add attrib­utes to the rela­tion­ships these edges rep­re­sent. It even gets bet­ter: you can also use the inher­i­tance mech­a­nisms you are already used to on ver­tex types as well as unde­fined (scheme­less) attributes.

If you want to dive deeper into edge types you won’t have to wait until the release of GraphDB 2.1 at the end of this year. You can just grab the cur­rent source code on github and get started.

Addi­tional doc­u­men­ta­tion and exam­ples are avail­able in our doc­u­men­ta­tion wiki. Here are some places you will find more information:

As you might have noticed by the check-ins on the source code repos­i­tory we are well on the way towards ver­sion 2.1 of sones GraphDB. Besides the many new fea­tures and fixes we just merged a fea­ture branch into the main repos­i­tory which con­tains the first steps of a sim­ple but already pow­er­ful visualization.

For some time now we are look­ing into ways to visu­al­ize the data stored in GraphDB and since todays web browsers come with HTML5 fea­tures the idea was born to inte­grate a future visu­al­iza­tion into the exist­ing inte­grated Web­Shell and the future web admin­is­tra­tion tool.

The Web­Shell is an inte­grated mod­ule of GraphDB which allows the user to access sones GraphDB by just log­ging in using a web browser.

 

With the abil­ity to run queries and use plug-ins to deter­mine how the out­put will look like the Web­Shell is a per­fect place to enhance user expe­ri­ence. Since there are sev­eral out­put plug-ins avail­able with ver­sion 2.0 already (JSON, XML, Text, HTML,…) we thought it would be a great idea to have a sim­ple visu­al­iza­tion imple­mented just by adding a new out­put plug-in to GraphDB.

And that’s what we did in the first step: We added an addi­tional out­put plug-in called “bar­chart”. This first new out­put plug-in uses the great D3.js library to draw nice charts, plots and graphs in HTML5 and the GraphQL ALIAS fea­ture to map x and y coordinate-axes of those visualizations.

A bit tricky is how multi-level map­pings of x– and y-axes are han­dled, we are still work­ing on that. But cur­rently if your data is in the same level you can already out­put nice graphs like this one:

Just by switch­ing to the bar­chart for­mat using the FORMAT Web­Shell com­mand and then chang­ing a query like this:

FROM Simp­son­Char­ac­ter SELECT Friend.Name, Friend.Friend.Count() WHERE Name = “Homer Simpson”

into

FROM Simp­son­Char­ac­ter SELECT Friend.Name AS x, Friend.Friend.Count() AS y WHERE Name = “Homer Simpson”

Since the cur­rent state is only the begin­ning we will add more visu­al­iza­tion options and fea­tures for the release of GraphDB ver­sion 2.1 at the end of this year.

For many sce­nar­ios it’s impor­tant to know how a data­base per­forms. Espe­cially these days when the num­ber of data­bases seem to grow by the day and a choice is hard to make.

To demon­strate how sones GraphDB per­forms at given use-cases we cre­ated a bench­mark frame­work and tool which basi­cally divides bench­mark­ing into two steps:

  1. Gen­er­ate and/or Import use-case spe­cific data and mea­sure the performance

  2. Exe­cute use-case spe­cific algo­rithms on the graph and mea­sure the performance

Because there are many dif­fer­ent use-cases these both steps are made up by plug-ins which can be adressed using the com­man­d­line which is inte­grated into the bench­mark tool.

The frame­work, tool and plug-ins are released as AGPLv3 licensed Open­Source soft­ware and can be down­loaded here.

We dis­trib­ute the source code mainly because it’s the best way for you to repro­duce the results and take a look at what actu­ally is being tested, the other main cause is that we want every­body to be able to bench­mark and test their own algo­rithms on GraphDB.

fetch

Source 1: https://github.com/sones/benchmark
Source 2: http://developers.sones.de/wiki/doku.php?id=benchmarks

We want to build the GraphDB com­mu­nity a home – a home they meet to dis­cuss, track, code and have all sorts of gra­phy fun. This is why we just launched our forum and our bug­track­ing tool. Those both tools com­ple­ment the already exist­ing GitHub pres­ence by adding the func­tion­al­ity to dis­cuss and get/give support.

forum.sones.de

It’s a way to com­mu­ni­cate with GraphDB users and devel­op­ers, either those work­ing at sones or those out in the community.

 

forum

jira.sones.de

In order to make a wish, to report bugs, to track the progress of the GraphDB devel­op­ment the bug­track­ing tool Jira (made by Atlass­ian) is used.

jira

You can always go to those new tools and just read – but we encour­age you to jump in and reg­is­ter your­self an account to write what you think about GraphDB, what your expe­ri­ence was while using it and what cool projects you are work­ing on currently.

 

Source 1: http://github.com/sones/sones
Source 2: http://forum.sones.de
Source 3: http://jira.sones.de
Source 4: http://forum.sones.de/register

There is a new exam­ple avail­able for all the devel­op­ers out there who want to start using GraphDB.

This tuto­r­ial describes and shows the sim­plic­ity of set­ting up a GraphDB by using the sones GraphDB Com­mu­ni­tyEdi­tion. It shows  how to cre­ate your own data­base by using the sones GraphDB C# API and how to use GraphDB to cre­ate your own graph scheme (in not one but two dif­fer­ent approaches).

  1. by using GraphDB API Requests
  2. by using GraphQL queries

Beside the tuto­r­ial itself there is source code avail­able here.

If you are using the GraphQL please read our GraphQL Cheat­sheet there you can find the descrip­tion of all avail­able state­ments and some addi­tional examples.

The tuto­r­ial itself will show you how to:

  1. cre­ate user defined types, add struc­tured prop­er­ties, add unknown/schemeless properties
  2. cre­ate out­go­ing and incom­ing edges on a ver­tex type
  3. cre­ate an index on a spec­i­fied prop­erty in 3 dif­fer­ent ways
  4. set con­straints on prop­er­ties (like “unique” and “mandatory”)
  5. set up queries and ana­lyze them
  6. use func­tion and aggre­gates in a query

Source 1: C# TagEx­am­ple Tuto­r­ial
Source 2: C# TagEx­am­ple Source Code

As you already know the Com­mu­nity Edi­tion of sones GraphDB was always released under the GNU Affero Gen­eral Pub­lic License ver­sion 3. All Lan­guage Bind­ings and Client Libraries we (sones) released so far were also released under that cer­tain AGPLv3 license.

We got quite a lot inter­est­ing feed­back on that mat­ter and decided that from now on the GraphDB Lan­guage Bind­ings, Client Libraries and Tal­end Open­Stu­dio com­po­nent will be released under the GNU Lesser Gen­eral Pub­lic License ver­sion 3.

lgplv3-147x51

From now on you can link to the library in your project, no mat­ter what license your project uses, your code will not become GPL’d. That’s basi­cally the only rea­son for that change.

Cur­rently the fol­low­ing libraries are available:

Besides that the soft­ware itself can also be licensed using a pro­pri­etary com­mer­cial license. Just ask for it.

 

Link 1: http://www.gnu.org/licenses/agpl.html
Link 2: http://www.gnu.org/licenses/lgpl.html
Link 3: http://www.sones.com/kontakt

The final ver­sion of the tech­ni­cal datasheet for the newly released GraphDB 2.0 can be down­loaded now:

technical-data-sheet