Friday, 27 December 2013

Posts copied to http://www.orientechnologies.com/blog

London, December 27th 2013

Now the new web site www.orientechnologies.com is online, we've copied all the posts to the web site's Blog section:

http://www.orientechnologies.com/blog/

This blogger will not be updated anymore.

Luca Garulli
CEO at Orient Technologies
the Company behind OrientDB
http://about.me/luca.garulli

Friday, 20 December 2013

OrientDB: working with types

London, December 20th 2013

OrientDB Team is working on SQL language to provide more powerful functions to works against types. Since OrientDB can work in schema-less mode, it's hard to know the real type of a value. For example when you work with numbers, you could have different type stored. How to know if a number is a Long or an Integer?

.type() method (since 2.0)

Here comes the new type() method (all these methods are available on 2.0-SNAPSHOT, "develop" branch), that returns the OrientDB type of a value. Let's try it against the ROLES property of OUser class.

select roles.type() from ouser


@rid@versionroles
#-2:10LINKSET
It's an LINKSET!

NOTE: .type() method works on the SQL pipeline, so it doesn't access to the stored type, but the type loaded in memory and in case of SET, LIST and MAP sometimes can't distinguish between EMBEDDED types and LINK types.

.javaType() method (since 2.0)

When you want to know the respective Java class, you can use the method .javaType(), example:

select roles.javaType() from ouser

@rid@versionroles
#-2:10com.orientechnologies.orient.core.type.tree.OMVRBTreeRIDSet
Now we can access to the type it would be cool to convert values at the fly. OrientDB already has few methods to to this:
  • asBoolean()
  • asDate()
  • asDateTime()
  • asDecimal()
  • asFloat()
  • asInteger()
  • asList()
  • asLong()
  • asSet()
  • asString()
But we've implemented a generic convert(<type>) method to convert values dynamically.

.convert(<type>) method (since 2.0)



convert() accepts as unique, mandatory, parameter the OrientDB type (OType enumeration) or any Java type recognized by OrientDB. Example using the STRING OrientDB type:

select roles.convert(STRING) from ouser

@rid@versionroles
#-2:10[#4:0=#4:0]
And the same using the Java type:

select roles.convert(java.lang.String) from ouser


@rid@versionroles
#-2:10[#4:0=#4:0]
Since the type is an EMBEDDEDSET, the more interesting thing is converting into a list to get the first value. Example:


select roles.convert(EMBEDDEDLIST)[0] from ouser

@rid@versionroles
#-2:10#4:0

Happy Christmas!

Luca Garulli
CEO at Orient Technologies
the Company behind OrientDB
http://about.me/luca.garulli

Thursday, 19 December 2013

OrientDB: improved SQL filtering

London, December 19th 2013


The more developers use OrientDB, the more use case we receive. One of the most wanted requirements is improving filtering of results, specially on traversing.

The OrientDB SQL dialect is powerful enough to mix SELECT and TRAVERSE to create very complex queries, but sometimes such queries are pretty big and hard to read.

For this reason we developed the pipeline filtering using brackets, by extending current SQL engine.

Examples

Example 1: Get the first friend of mine

You can get it by using:

select expand( out ) from (
  select out('Friend') from Profile where name = 'Luca'
) limit 1
     
But now you can also do this:

select out('Friend')[0] from Profile where name = 'Luca'

Much easier and faster on execution!

Example 2: from GratefulDeadConcerts database traverse all the out() connection and get the first song called 'MONA'

select from (
  select expand( out() ) from V
) where name = 'MONA' and type = 'song' limit 1

@rid@version@classnamein_followed_bysong_typeperformancestypeout_followed_byout_sung_byout_written_by
#9:619VMONA[2]cover1song[2][1][1]
Executed in 0.455 seconds.

Now let's use the new way:

select expand( out()[name='MONA'][type='song'] ) from V

@rid@version@classnamein_followed_bysong_typeperformancestypeout_followed_byout_sung_byout_written_by
#9:619VMONA[2]cover1song[2][1][1]
Executed in 0.106 seconds.

Note last execution, in this case, is 4x faster!

Squared brackets [] allow to:
- filtering by one index, example out()[0]
- filtering by multiple indexes, example out()[0,2,4]
- filtering by ranges, example out()[0-9]
- filtering by equal conditions (only equals is supported), example out()[@class = 'Person']

Brackets [] can be chained, in this case it's like filtering by AND operator. Look at the Example 2.

For more information about the issue: https://github.com/orientechnologies/orientdb/issues/1888

This is available in "develop" branch right now and will be part of next release.


Luca Garulli
CEO at Orient Technologies
the Company behind OrientDB

Monday, 9 December 2013

Released OrientDB 1.6.2

London, December 9th, 2013


Orient Technologies has released OrientDB v1.6.2. This is a hot-fix for v1.6.1 containing fixes for 22 issues. This is the Change Log.

To download it go to http://www.orientdb.org/download.htm or update your Maven pom.xml to point to the version 1.6.2.

Next Online course

Do you wish to attendee a OrientDB course, but you can't get 2 entire days off? Well, we've created a new format for the Online course, the "A week in Graphs" course. about 2 hours each day for 5 days. Apply now to the December edition to get the Early Bird price at £ 250.00 for the entire course:


Have fun with Documents & Graphs.

Luca Garulli
CEO at Orient Technologies
the Company behind OrientDB

Wednesday, 27 November 2013

New survey, help us to improve OrientDB with your feedback!

London, November 27th 2013

The OrientDB Open Source project has been built following the users' needs. This survey will help OrientDB team to build a better product based on the received feedbacks. Thank you in advance for your time.

https://docs.google.com/forms/d/1sne36Nzf2hBPQU6rVy4HBRnd9-p-Ztu9-yeNQum5K2E/viewform


Luca Garulli
CEO at Orient Technologies
the Company behind OrientDB
http://about.me/luca.garulli

Thursday, 21 November 2013

Released OrientDB v 1.6.1: bugs fixed and some improvements in performance

Orient Technologies has released OrientDB v1.6.1. This is a hot-fix for v1.6 so this email will be shorter than usual.


What's new
  • Starting from 1.6.1 OrientDB is distributed in 2 ways:
    • TAR.GZ for Linux, MacOSX and Unix in general
    • ZIP for Windows users
  • Studio plugin is bundled in server/plugins directory
  • The build process now generates a 100% complete OrientDB installation, so get the source code from GitHub (https://github.com/orientechnologies/orientdb/tree/develop) and execute "ant clean install". Now the GratefulDeadConcerts database is automatically generated.
  • We've improved performance with SBTree indexes and plocal in general

Next Online course

Do you wish to attendee a OrientDB course, but you can't get 2 entire days off? Well, we've created a new format for the Online course, the "A week in Graphs" course. about 2 hours each day for 5 days. Apply now to the December edition to get the Early Bird price:


Have fun with Graphs,

Luca Garulli
CEO at Orient Technologies
the Company behind OrientDB

Tuesday, 19 November 2013

New online course: no more excuses to get skilled on OrientDB Graph Database!

After a lot of feedbacks, we've changed the online training program by providing it during 5 days (2 hours each day) instead of 2 days full immersion. This allows to the developers to:

- take the course even if they're working (no more days off or holidays)
- do more exercises between the course days

This is the link:


Hurry up to get the early-bird price!

Luca Garulli
CEO at Orient Technologies
the Company behind OrientDB
http://about.me/luca.garulli