Re: [Neo4j] An attempt at documenting the internals and architecture of Neo

2010-10-19 Thread Chris Gioran
On Mon, Oct 18, 2010 at 11:57 PM, Peter Neubauer
peter.neuba...@neotechnology.com wrote:
 Chris,
 great reading your blogs on this! Did you get on with the transaction
 piece yet? In case you need info, don't hesitate to ask here on the
 list, there are a number of folks that have disected the area before
 :)

 Also, when it comes to Neo4j working with other TX managers in a JTA
 environment like JOTM and Atomikos, I hope we will be able at least to
 start with failing tests in these environments in the next iteration
 and beginning with that, start working around the issues that JTA is
 leaving for non-relational stores like Neo4j. There might be some
 details that you are interested in when digging there :)

 Cheers,

 /peter neubauer

Peter, thanks for your input.
The transaction handling code is the aspect of a db that I am least
familiar with from an implementation standpoint, so it took a bit more
time than I had planned. I have come through, however, wiser and ready
to write about it in what will in all probability be more than one
post. Soon :)

As for JTA support, it is one of the reasons I started my
documentation efforts and I would like to see neo working in a JTA/JTS
environment.

But first I have to write about XALogicalLog and its friends. Stay tuned.

cheers,
CG
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] More PHP and REST goodness on the way

2010-10-19 Thread Todd Chaffee
Hi Peter,

I'll see if I can get me, Jake, and Olle all on board to finish the
refactoring and merge back with the original branch.  Functionally the PHP
client works and is ready.  We'd like to add unit tests and better organize
the code.

How about the REST api?  Any word on whether the path algos will be included
in an upcoming release?  That and traversals are probably the most useful
parts of the PHP client.

Thanks,
Todd

-- 

MIKAMAI | Making Media Social
http://mikamai.com
+447868260229
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] unit testing

2010-10-19 Thread nikola sijakinjic
Hello,

   I am interested in neo4j unit testing. I founded this conversation in
archive, and this looks interesting, but I failed to find function setup()
to override.
What class should i look for ?

best,
Nikola

You can also create the graph on a temp folder and remove it
overriding setup() on a base class.
That's how we do it for our unit tests.

2010/2/10 Thomas Andersson greddbul...@gmail.com:
 Hi,

 Is it possible to run neo4j in memory only, that is, without a
 directory in the file system?

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] unit testing

2010-10-19 Thread Andreas Kollegger
Hi Nikola,

I happen to be adding an example unit-test to the next release. Hold on a 
minute and I'll pass along a sneak preview.

Cheers,
Andreas

On Oct 19, 2010, at 2:39 PM, nikola sijakinjic wrote:

 Hello,
 
   I am interested in neo4j unit testing. I founded this conversation in
 archive, and this looks interesting, but I failed to find function setup()
 to override.
 What class should i look for ?
 
 best,
 Nikola
 
 You can also create the graph on a temp folder and remove it
 overriding setup() on a base class.
 That's how we do it for our unit tests.
 
 2010/2/10 Thomas Andersson greddbul...@gmail.com:
 Hi,
 
 Is it possible to run neo4j in memory only, that is, without a
 directory in the file system?
 
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] An attempt at documenting the internals and architecture of Neo

2010-10-19 Thread Toby Matejovsky
Chris, I've really enjoyed those posts on neo4j internals. Looking forward
to the next.

--
Toby Matejovsky


On Tue, Oct 19, 2010 at 6:10 AM, Chris Gioran chris.gio...@gmail.comwrote:

 On Mon, Oct 18, 2010 at 11:57 PM, Peter Neubauer
 peter.neuba...@neotechnology.com wrote:
  Chris,
  great reading your blogs on this! Did you get on with the transaction
  piece yet? In case you need info, don't hesitate to ask here on the
  list, there are a number of folks that have disected the area before
  :)
 
  Also, when it comes to Neo4j working with other TX managers in a JTA
  environment like JOTM and Atomikos, I hope we will be able at least to
  start with failing tests in these environments in the next iteration
  and beginning with that, start working around the issues that JTA is
  leaving for non-relational stores like Neo4j. There might be some
  details that you are interested in when digging there :)
 
  Cheers,
 
  /peter neubauer

 Peter, thanks for your input.
 The transaction handling code is the aspect of a db that I am least
 familiar with from an implementation standpoint, so it took a bit more
 time than I had planned. I have come through, however, wiser and ready
 to write about it in what will in all probability be more than one
 post. Soon :)

 As for JTA support, it is one of the reasons I started my
 documentation efforts and I would like to see neo working in a JTA/JTS
 environment.

 But first I have to write about XALogicalLog and its friends. Stay tuned.

 cheers,
 CG
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] unit testing

2010-10-19 Thread Andreas Kollegger
Hi Nikola,

Below is a baseline for unit testing neo4j. Please let me know if you have any 
ideas for helpers that would make writing tests easier. It might be useful to 
pull together a package of base classes and maybe hamcrest matchers that are 
common to all testing. 

Cheers,
Andreas

package org.neo4j.examples;

import org.junit.*;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Transaction;
import org.neo4j.kernel.EmbeddedGraphDatabase;

import java.io.File;

import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

/**
 * An example of unit testing with Neo4j.
 */
public class Neo4jBaseTest
{
/**
 * Base directory for temporary database.
 */
protected File testDirectory = new File( target/var );

/**
 * Full path to the temporary database.
 */
protected File testDatabasePath = new File( testDirectory, testdb );
protected GraphDatabaseService graphDb;


/**
 * Create temporary database for each unit test.
 * p/
 * This will delete any existing database prior to creating a new one.
 */
@Before
public void prepareTestDatabase()
{
deleteFileOrDirectory( testDatabasePath );
graphDb = new EmbeddedGraphDatabase( testDatabasePath.getAbsolutePath() 
);
}

/**
 * Shutdown the database.
 */
@After
public void destroyTestDatabase()
{
graphDb.shutdown();
}

protected void deleteFileOrDirectory( File path )
{
if ( path.exists() )
{
if ( path.isDirectory() )
{
for ( File child : path.listFiles() )
{
deleteFileOrDirectory( child );
}
}
path.delete();
}
}


@Test
public void shouldCreateNode()
{
Transaction tx = graphDb.beginTx();
Node n = null;
try
{
n = graphDb.createNode();
n.setProperty( name, Nancy );
tx.success();
} catch ( Exception e )
{
tx.failure();
} finally
{
tx.finish();
}

// The node should have an id greater than 0, which is the id of the 
reference node.
assertThat( n.getId(), is( greaterThan( 0l ) ) );

// Retrieve a node by using the id of the created node. The id's and 
property should match.
Node foundNode = graphDb.getNodeById( n.getId() );
assertThat( foundNode.getId(), is( n.getId() ) );
assertThat( (String) foundNode.getProperty( name ), is( Nancy ) );

}

}



On Oct 19, 2010, at 2:39 PM, nikola sijakinjic wrote:

 Hello,
 
   I am interested in neo4j unit testing. I founded this conversation in
 archive, and this looks interesting, but I failed to find function setup()
 to override.
 What class should i look for ?
 
 best,
 Nikola
 
 You can also create the graph on a temp folder and remove it
 overriding setup() on a base class.
 That's how we do it for our unit tests.
 
 2010/2/10 Thomas Andersson greddbul...@gmail.com:
 Hi,
 
 Is it possible to run neo4j in memory only, that is, without a
 directory in the file system?
 
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Questions about Neo4j vs Hadoop

2010-10-19 Thread Erik Holstad
After reading the article on highscalability I have a few questions about
it:

1. You're saying that matching data on the client side in for example Java
would be slow. Are you just talking about skipping multiple round trips to
the server, since the matching should take as long on the server as on the
client, no?

2. If that is the case could you solve the same problem by implementing a
server side method, in for example HBase, that did something similar so you
only would need one round trip?

3. For the billions of entries mentioned in the post, what kind of hardware
are you guys using?


Thanks Erik
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] hi.

2010-10-19 Thread Alastair James
hi!
I find a good website:www.ebisri.com
On this website ,you can find many new and origianl electronic
products .Now they are holding sales promotion activity, all the
product are sold at a
low cost and good quality ,and the delivery is on time .
It is a good chance that you should not lose.
If you need some, visit this website .
Let us enjoy the happiness of shopping.
Greetings!
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] unit testing

2010-10-19 Thread nikola sijakinjic
Hi Andreas,

thank you for your effort ! But I am looking for a way to detach neo4j
completely from file system. What I understood from thread below, there is a
way to start neo4j so it works only in memory, creating no files, so there
is no need to delete db files with every test run.

Best,
Nikola


On Tue, Oct 19, 2010 at 4:25 PM, Andreas Kollegger 
andreas.kolleg...@neotechnology.com wrote:

 Hi Nikola,

 Below is a baseline for unit testing neo4j. Please let me know if you have
 any ideas for helpers that would make writing tests easier. It might be
 useful to pull together a package of base classes and maybe hamcrest
 matchers that are common to all testing.

 Cheers,
 Andreas

 package org.neo4j.examples;

 import org.junit.*;
 import org.neo4j.graphdb.GraphDatabaseService;
 import org.neo4j.graphdb.Node;
 import org.neo4j.graphdb.Transaction;
 import org.neo4j.kernel.EmbeddedGraphDatabase;

 import java.io.File;

 import static org.hamcrest.Matchers.greaterThan;
 import static org.hamcrest.Matchers.is;
 import static org.junit.Assert.assertThat;

 /**
  * An example of unit testing with Neo4j.
  */
 public class Neo4jBaseTest
 {
/**
 * Base directory for temporary database.
 */
protected File testDirectory = new File( target/var );

/**
 * Full path to the temporary database.
 */
protected File testDatabasePath = new File( testDirectory, testdb );
protected GraphDatabaseService graphDb;


/**
 * Create temporary database for each unit test.
 * p/
 * This will delete any existing database prior to creating a new one.
 */
@Before
public void prepareTestDatabase()
{
deleteFileOrDirectory( testDatabasePath );
graphDb = new EmbeddedGraphDatabase(
 testDatabasePath.getAbsolutePath() );
}

/**
 * Shutdown the database.
 */
@After
public void destroyTestDatabase()
{
graphDb.shutdown();
}

protected void deleteFileOrDirectory( File path )
{
if ( path.exists() )
{
if ( path.isDirectory() )
{
for ( File child : path.listFiles() )
{
deleteFileOrDirectory( child );
}
}
path.delete();
}
}


@Test
public void shouldCreateNode()
{
Transaction tx = graphDb.beginTx();
Node n = null;
try
{
n = graphDb.createNode();
n.setProperty( name, Nancy );
tx.success();
} catch ( Exception e )
{
tx.failure();
} finally
{
tx.finish();
}

// The node should have an id greater than 0, which is the id of the
 reference node.
assertThat( n.getId(), is( greaterThan( 0l ) ) );

// Retrieve a node by using the id of the created node. The id's and
 property should match.
Node foundNode = graphDb.getNodeById( n.getId() );
assertThat( foundNode.getId(), is( n.getId() ) );
assertThat( (String) foundNode.getProperty( name ), is( Nancy )
 );

}

 }



 On Oct 19, 2010, at 2:39 PM, nikola sijakinjic wrote:

  Hello,
 
I am interested in neo4j unit testing. I founded this conversation
 in
  archive, and this looks interesting, but I failed to find function
 setup()
  to override.
  What class should i look for ?
 
  best,
  Nikola
 
  You can also create the graph on a temp folder and remove it
  overriding setup() on a base class.
  That's how we do it for our unit tests.
 
  2010/2/10 Thomas Andersson greddbul...@gmail.com:
  Hi,
 
  Is it possible to run neo4j in memory only, that is, without a
  directory in the file system?
 
  ___
  Neo4j mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user

 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] unit testing

2010-10-19 Thread Andreas Kollegger
Hi Nikola,

Ah, I see. Unfortunately there is no way to avoid any file creation. The lowest 
file access would be to never commit a transaction.

Are you interested in easier unit-testing, or are you interested in in-memory 
to have all the graph semantics without being persistent?

Cheers,
Andreas

On Oct 19, 2010, at 4:55 PM, nikola sijakinjic wrote:

 Hi Andreas,
 
 thank you for your effort ! But I am looking for a way to detach neo4j
 completely from file system. What I understood from thread below, there is a
 way to start neo4j so it works only in memory, creating no files, so there
 is no need to delete db files with every test run.
 
 Best,
 Nikola
 
 
 On Tue, Oct 19, 2010 at 4:25 PM, Andreas Kollegger 
 andreas.kolleg...@neotechnology.com wrote:
 
 Hi Nikola,
 
 Below is a baseline for unit testing neo4j. Please let me know if you have
 any ideas for helpers that would make writing tests easier. It might be
 useful to pull together a package of base classes and maybe hamcrest
 matchers that are common to all testing.
 
 Cheers,
 Andreas
 
 package org.neo4j.examples;
 
 import org.junit.*;
 import org.neo4j.graphdb.GraphDatabaseService;
 import org.neo4j.graphdb.Node;
 import org.neo4j.graphdb.Transaction;
 import org.neo4j.kernel.EmbeddedGraphDatabase;
 
 import java.io.File;
 
 import static org.hamcrest.Matchers.greaterThan;
 import static org.hamcrest.Matchers.is;
 import static org.junit.Assert.assertThat;
 
 /**
 * An example of unit testing with Neo4j.
 */
 public class Neo4jBaseTest
 {
   /**
* Base directory for temporary database.
*/
   protected File testDirectory = new File( target/var );
 
   /**
* Full path to the temporary database.
*/
   protected File testDatabasePath = new File( testDirectory, testdb );
   protected GraphDatabaseService graphDb;
 
 
   /**
* Create temporary database for each unit test.
* p/
* This will delete any existing database prior to creating a new one.
*/
   @Before
   public void prepareTestDatabase()
   {
   deleteFileOrDirectory( testDatabasePath );
   graphDb = new EmbeddedGraphDatabase(
 testDatabasePath.getAbsolutePath() );
   }
 
   /**
* Shutdown the database.
*/
   @After
   public void destroyTestDatabase()
   {
   graphDb.shutdown();
   }
 
   protected void deleteFileOrDirectory( File path )
   {
   if ( path.exists() )
   {
   if ( path.isDirectory() )
   {
   for ( File child : path.listFiles() )
   {
   deleteFileOrDirectory( child );
   }
   }
   path.delete();
   }
   }
 
 
   @Test
   public void shouldCreateNode()
   {
   Transaction tx = graphDb.beginTx();
   Node n = null;
   try
   {
   n = graphDb.createNode();
   n.setProperty( name, Nancy );
   tx.success();
   } catch ( Exception e )
   {
   tx.failure();
   } finally
   {
   tx.finish();
   }
 
   // The node should have an id greater than 0, which is the id of the
 reference node.
   assertThat( n.getId(), is( greaterThan( 0l ) ) );
 
   // Retrieve a node by using the id of the created node. The id's and
 property should match.
   Node foundNode = graphDb.getNodeById( n.getId() );
   assertThat( foundNode.getId(), is( n.getId() ) );
   assertThat( (String) foundNode.getProperty( name ), is( Nancy )
 );
 
   }
 
 }
 
 
 
 On Oct 19, 2010, at 2:39 PM, nikola sijakinjic wrote:
 
 Hello,
 
  I am interested in neo4j unit testing. I founded this conversation
 in
 archive, and this looks interesting, but I failed to find function
 setup()
 to override.
 What class should i look for ?
 
 best,
 Nikola
 
 You can also create the graph on a temp folder and remove it
 overriding setup() on a base class.
 That's how we do it for our unit tests.
 
 2010/2/10 Thomas Andersson greddbul...@gmail.com:
 Hi,
 
 Is it possible to run neo4j in memory only, that is, without a
 directory in the file system?
 
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
 
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
 
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Lucene result sorting

2010-10-19 Thread Balazs E. Pataki
Hi,

Is it possible to do get sorted results form LuceneIndex#query()?

It would be really helpful if results would be sorted at lucene time 
according to one or more indexed fields rather than loading the actual 
neo4j nodes and than iterating over them for sorting.

Currently, it seems that sorting is not supported by LuceneIndex, but 
are there plans regarding this?

Thanks for any hints,
---
balazs
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] unit testing

2010-10-19 Thread Andreas Kollegger
For easier unit testing, I could imagine two approaches: 1) providing a few 
base classes that provide methods for creating/shutting down a temporary graph 
database, and maybe @Before/@After type annotation; 2) a 
TemporaryGraphDatabaseService which manages itself. 

For #2, I'm imagining use like:

@Test public void shouldUseATemporaryGraph() {
GraphDatabaseService graphdb = new TemporaryGraphDatabaseService();

// do stuff with the graph, including managing transactions

...

// that's it. No explicit shutdown. The TemporaryGraphDatabaseService() 
should politely clean up after itself during finalization. 
}

Initial implementations for both approaches would use the system temp area to 
create files. 

Not too bad, right?

Cheers,
Andreas

On Oct 19, 2010, at 5:43 PM, nikola sijakinjic wrote:

 Are you interested in easier unit-testing, or are you interested in
 in-memory to have all the graph semantics without being persistent?
 
 
 I want it all :))  at this moment I am more interested in easy unit testing,
 but looking forward to see neo4j in-memory release. Thank you for your fast
 reply.
 
 Cheers,
 Nikola
 
 Cheers,
 Andreas
 
 On Oct 19, 2010, at 4:55 PM, nikola sijakinjic wrote:
 
 Hi Andreas,
 
 thank you for your effort ! But I am looking for a way to detach neo4j
 completely from file system. What I understood from thread below, there
 is a
 way to start neo4j so it works only in memory, creating no files, so
 there
 is no need to delete db files with every test run.
 
 Best,
 Nikola
 
 
 On Tue, Oct 19, 2010 at 4:25 PM, Andreas Kollegger 
 andreas.kolleg...@neotechnology.com wrote:
 
 Hi Nikola,
 
 Below is a baseline for unit testing neo4j. Please let me know if you
 have
 any ideas for helpers that would make writing tests easier. It might be
 useful to pull together a package of base classes and maybe hamcrest
 matchers that are common to all testing.
 
 Cheers,
 Andreas
 
 package org.neo4j.examples;
 
 import org.junit.*;
 import org.neo4j.graphdb.GraphDatabaseService;
 import org.neo4j.graphdb.Node;
 import org.neo4j.graphdb.Transaction;
 import org.neo4j.kernel.EmbeddedGraphDatabase;
 
 import java.io.File;
 
 import static org.hamcrest.Matchers.greaterThan;
 import static org.hamcrest.Matchers.is;
 import static org.junit.Assert.assertThat;
 
 /**
 * An example of unit testing with Neo4j.
 */
 public class Neo4jBaseTest
 {
  /**
   * Base directory for temporary database.
   */
  protected File testDirectory = new File( target/var );
 
  /**
   * Full path to the temporary database.
   */
  protected File testDatabasePath = new File( testDirectory, testdb );
  protected GraphDatabaseService graphDb;
 
 
  /**
   * Create temporary database for each unit test.
   * p/
   * This will delete any existing database prior to creating a new one.
   */
  @Before
  public void prepareTestDatabase()
  {
  deleteFileOrDirectory( testDatabasePath );
  graphDb = new EmbeddedGraphDatabase(
 testDatabasePath.getAbsolutePath() );
  }
 
  /**
   * Shutdown the database.
   */
  @After
  public void destroyTestDatabase()
  {
  graphDb.shutdown();
  }
 
  protected void deleteFileOrDirectory( File path )
  {
  if ( path.exists() )
  {
  if ( path.isDirectory() )
  {
  for ( File child : path.listFiles() )
  {
  deleteFileOrDirectory( child );
  }
  }
  path.delete();
  }
  }
 
 
  @Test
  public void shouldCreateNode()
  {
  Transaction tx = graphDb.beginTx();
  Node n = null;
  try
  {
  n = graphDb.createNode();
  n.setProperty( name, Nancy );
  tx.success();
  } catch ( Exception e )
  {
  tx.failure();
  } finally
  {
  tx.finish();
  }
 
  // The node should have an id greater than 0, which is the id of
 the
 reference node.
  assertThat( n.getId(), is( greaterThan( 0l ) ) );
 
  // Retrieve a node by using the id of the created node. The id's
 and
 property should match.
  Node foundNode = graphDb.getNodeById( n.getId() );
  assertThat( foundNode.getId(), is( n.getId() ) );
  assertThat( (String) foundNode.getProperty( name ), is( Nancy
 )
 );
 
  }
 
 }
 
 
 
 On Oct 19, 2010, at 2:39 PM, nikola sijakinjic wrote:
 
 Hello,
 
 I am interested in neo4j unit testing. I founded this conversation
 in
 archive, and this looks interesting, but I failed to find function
 setup()
 to override.
 What class should i look for ?
 
 best,
 Nikola
 
 You can also create the graph on a temp folder and remove it
 overriding setup() on a base class.
 That's how we do it for our unit tests.
 
 2010/2/10 Thomas Andersson greddbul...@gmail.com:
 Hi,
 
 Is it possible to run neo4j in memory only, that is, without a
 directory in the file system?
 
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 

Re: [Neo4j] Lucene result sorting

2010-10-19 Thread Andres Taylor
Hi Balazs,

We've been working on a new lucene-index module just these last days. The
new index module allows sorting, through the QueryContext-class. You can
look in svn https://svn.neo4j.org/components/lucene-index/trunk/, if you
are so inclined, or wait for the next milestone release (Thursday).

HTH,

Andrés

On Tue, Oct 19, 2010 at 5:41 PM, Balazs E. Pataki pat...@dsd.sztaki.huwrote:

 Hi,

 Is it possible to do get sorted results form LuceneIndex#query()?

 It would be really helpful if results would be sorted at lucene time
 according to one or more indexed fields rather than loading the actual
 neo4j nodes and than iterating over them for sorting.

 Currently, it seems that sorting is not supported by LuceneIndex, but
 are there plans regarding this?

 Thanks for any hints,
 ---
 balazs
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Lucene result sorting

2010-10-19 Thread Mattias Persson
2010/10/19 Andres Taylor andres.tay...@neotechnology.com

 Hi Balazs,

 We've been working on a new lucene-index module just these last days. The
 new index module allows sorting, through the QueryContext-class. You can
 look in svn https://svn.neo4j.org/components/lucene-index/trunk/, if you
 are so inclined, or wait for the next milestone release (Thursday).


Exactly, an example could be:

   IndexNode myNodeIndex = ...
   for ( Node hit : myNodeIndex.query(
  new QueryContext( name:Balazs ).sort( name ) ) ) {
  System.out.println( hit.getProperty( name ) );
   }


 HTH,

 Andrés

 On Tue, Oct 19, 2010 at 5:41 PM, Balazs E. Pataki pat...@dsd.sztaki.hu
 wrote:

  Hi,
 
  Is it possible to do get sorted results form LuceneIndex#query()?
 
  It would be really helpful if results would be sorted at lucene time
  according to one or more indexed fields rather than loading the actual
  neo4j nodes and than iterating over them for sorting.
 
  Currently, it seems that sorting is not supported by LuceneIndex, but
  are there plans regarding this?
 
  Thanks for any hints,
  ---
  balazs
  ___
  Neo4j mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Neo4j-rdf and Jpype

2010-10-19 Thread Karen Nomorosa
Hi all,

Relatively new to Jpype, and encountering some issues.

I'm trying to make Neo4j a triple store by loading some RDF data.  Looked at 
some documentation and found the following Java example to initialize the store:
GraphDatabaseService graphDb = new EmbeddedGraphDatabase(target/var/examples 
);
IndexService indexService = new LuceneIndexService( graphDb );
RdfStore rdfStore = new VerboseQuadStore( graphDb, indexService );
Sail sail = new GraphDatabaseSail( graphDb, rdfStore );

Transforming it into JPype, I came up with the following:

import jpype
import os

JAVA_EXT_DIRS = os.path.join(os.path.abspath('.'), 'lib') #folder lib 
contains all jars, including jars I created for neo4j-rdf, neo4j-rdf-sail and 
neo4j-rdf-sparql
jpype.startJVM(jpype.getDefaultJVMPath(), -Djava.ext.dirs=%s % JAVA_EXT_DIRS)

EmbeddedGraphDatabase = jpype.JClass(org.neo4j.kernel.EmbeddedGraphDatabase)
LuceneIndexService = jpype.JClass(org.neo4j.index.lucene.LuceneIndexService)
VerboseQuadStore = jpype.JClass(org.neo4j.rdf.store.VerboseQuadStore)

-- This is where I run into trouble.  When I try to run the 
VerboseQuadStore command, I run into a Class Not Found exception.  I tried 
creating different classes from the same JAR (like Uri, or RDFStoreImpl) and I 
do not encounter the same issues. Only with VerboseQuadStore.

Wondering what I am doing wrong (or if there is a standard / known way of doing 
this using JPype).

Thanks much!
Karen


Karen Joy Nomorosa
Semantic Analyst
REARDEN COMMERCE
1051 E Hillsdale Blvd, Sixth Floor
Foster City CA 94404

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4j-rdf and Jpype

2010-10-19 Thread Vasco Pedro
Hi Karen,

   Have you looked into neo4j.py?
   It abstracts a lot of the stuff away and should get you up an
running fairly quick.

   Cheers,

Vasco
Bueda, Inc

On Tue, Oct 19, 2010 at 3:25 PM, Karen Nomorosa
karen.nomor...@reardencommerce.com wrote:
 Hi all,

 Relatively new to Jpype, and encountering some issues.

 I'm trying to make Neo4j a triple store by loading some RDF data.  Looked at 
 some documentation and found the following Java example to initialize the 
 store:
 GraphDatabaseService graphDb = new 
 EmbeddedGraphDatabase(target/var/examples );
 IndexService indexService = new LuceneIndexService( graphDb );
 RdfStore rdfStore = new VerboseQuadStore( graphDb, indexService );
 Sail sail = new GraphDatabaseSail( graphDb, rdfStore );

 Transforming it into JPype, I came up with the following:

 import jpype
 import os

 JAVA_EXT_DIRS = os.path.join(os.path.abspath('.'), 'lib')         #folder lib 
 contains all jars, including jars I created for neo4j-rdf, neo4j-rdf-sail and 
 neo4j-rdf-sparql
 jpype.startJVM(jpype.getDefaultJVMPath(), -Djava.ext.dirs=%s % 
 JAVA_EXT_DIRS)

 EmbeddedGraphDatabase = jpype.JClass(org.neo4j.kernel.EmbeddedGraphDatabase)
 LuceneIndexService = jpype.JClass(org.neo4j.index.lucene.LuceneIndexService)
 VerboseQuadStore = jpype.JClass(org.neo4j.rdf.store.VerboseQuadStore)

 -- This is where I run into trouble.  When I try to run the 
 VerboseQuadStore command, I run into a Class Not Found exception.  I tried 
 creating different classes from the same JAR (like Uri, or RDFStoreImpl) and 
 I do not encounter the same issues. Only with VerboseQuadStore.

 Wondering what I am doing wrong (or if there is a standard / known way of 
 doing this using JPype).

 Thanks much!
 Karen

 
 Karen Joy Nomorosa
 Semantic Analyst
 REARDEN COMMERCE
 1051 E Hillsdale Blvd, Sixth Floor
 Foster City CA 94404

 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




-- 
Vasco Calais Pedro
Founder/CEO
Bueda
412.880.7785
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Neo4j-rdf and Jpype

2010-10-19 Thread Tobias Ivarsson
Yes, neo4j.py does abstract away a lot of this hassle, but it does not (yet)
provide an abstraction for the RDF component.

I tried to retrace your steps, but I am not able to reproduce your error, so
I don't really know what might be going wrong for you. It could be that you
are missing a jar file in the ext-dir that contains some class that
VerboseQuadStore depends on (and needs to be able to load), this means that
the Class Not Found exception you see is not about not
finding VerboseQuadStore, it's about not finding some other class. I don't
really know what that would be though.

For reference, here is what I put in my ext-dir, and the jpype interaction
where I verified that it worked:

$ ls target/dependency/
geronimo-jta_1.1_spec-1.1.1.jar
lucene-core-2.9.2.jar
lucene-highlighter-2.9.1.jar
lucene-memory-2.9.1.jar
neo4j-graph-matching-0.8-SNAPSHOT.jar
neo4j-index-1.1-SNAPSHOT.jar
neo4j-kernel-1.1-SNAPSHOT.jar
neo4j-meta-model-0.9-SNAPSHOT.jar
neo4j-rdf-0.7-SNAPSHOT.jar
neo4j-shell-1.1-SNAPSHOT.jar
neo4j-utils-1.1-SNAPSHOT.jar
$ python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type help, copyright, credits or license for more information.
 import jpype, os
 jpype.startJVM(jpype.getDefaultJVMPath(), -Djava.ext.dirs= +
os.path.abspath(target/dependency))
 jpype.JClass(org.neo4j.rdf.store.VerboseQuadStore)
class 'jpype._jclass.org.neo4j.rdf.store.VerboseQuadStore'


Cheers,
Tobias

On Tue, Oct 19, 2010 at 9:32 PM, Vasco Pedro va...@bueda.com wrote:

 Hi Karen,

   Have you looked into neo4j.py?
   It abstracts a lot of the stuff away and should get you up an
 running fairly quick.

   Cheers,

 Vasco
 Bueda, Inc

 On Tue, Oct 19, 2010 at 3:25 PM, Karen Nomorosa
 karen.nomor...@reardencommerce.com wrote:
  Hi all,
 
  Relatively new to Jpype, and encountering some issues.
 
  I'm trying to make Neo4j a triple store by loading some RDF data.  Looked
 at some documentation and found the following Java example to initialize the
 store:
  GraphDatabaseService graphDb = new
 EmbeddedGraphDatabase(target/var/examples );
  IndexService indexService = new LuceneIndexService( graphDb );
  RdfStore rdfStore = new VerboseQuadStore( graphDb, indexService );
  Sail sail = new GraphDatabaseSail( graphDb, rdfStore );
 
  Transforming it into JPype, I came up with the following:
 
  import jpype
  import os
 
  JAVA_EXT_DIRS = os.path.join(os.path.abspath('.'), 'lib') #folder
 lib contains all jars, including jars I created for neo4j-rdf,
 neo4j-rdf-sail and neo4j-rdf-sparql
  jpype.startJVM(jpype.getDefaultJVMPath(), -Djava.ext.dirs=%s %
 JAVA_EXT_DIRS)
 
  EmbeddedGraphDatabase =
 jpype.JClass(org.neo4j.kernel.EmbeddedGraphDatabase)
  LuceneIndexService =
 jpype.JClass(org.neo4j.index.lucene.LuceneIndexService)
  VerboseQuadStore = jpype.JClass(org.neo4j.rdf.store.VerboseQuadStore)
 
  -- This is where I run into trouble.  When I try to run the
 VerboseQuadStore command, I run into a Class Not Found exception.  I tried
 creating different classes from the same JAR (like Uri, or RDFStoreImpl) and
 I do not encounter the same issues. Only with VerboseQuadStore.
 
  Wondering what I am doing wrong (or if there is a standard / known way of
 doing this using JPype).
 
  Thanks much!
  Karen
 
  
  Karen Joy Nomorosa
  Semantic Analyst
  REARDEN COMMERCE
  1051 E Hillsdale Blvd, Sixth Floor
  Foster City CA 94404
 
  ___
  Neo4j mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 



 --
 Vasco Calais Pedro
 Founder/CEO
 Bueda
 412.880.7785
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




-- 
Tobias Ivarsson tobias.ivars...@neotechnology.com
Hacker, Neo Technology
www.neotechnology.com
Cellphone: +46 706 534857
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user