Re: [Neo] sail and time index

2010-04-14 Thread Mattias Persson
I see that you're trying to restart the transaction by calling tx.success()
(every 1 items). You must do

  tx.success();
  tx.finish();
  tx = graphDb.beginTx();

to restart the transaction. Try that instead.

What you interpret as stuck is GC trashing, 90% of CPU is spent garbage
collecting because there's so little memory left to allocate.

2010/4/13 Lyudmila L. Balakireva lu...@lanl.gov

  I have  small test VerboseQuadStore alreday  build with
 LuceneIndexService.

 Then I made test program where I create  new
 LuceneFulltextQueryIndexService to test your suggestion , see below :

 final GraphDatabaseService graphDb = new EmbeddedGraphDatabase( db);
final IndexService indexService = new LuceneIndexService(
 graphDb );

IndexService index = new LuceneFulltextQueryIndexService(
 graphDb);

  RdfStore store = new VerboseQuadStore( graphDb, indexService );
Sail sail = (Sail) new GraphDatabaseSail( graphDb, store);

Repository repo = new SailRepository( sail );
RepositoryConnection rc = repo.getConnection();
SailConnection sc = sail.getConnection();
URI context = sail.getValueFactory().createURI(
 http://www.mementoweb.org/time/2008-02-00; );
RepositoryResultStatement result = rc.getStatements(null,
 null, null, true, context);

  int count=0;
  Transaction tx =  tx = graphDb.beginTx();
 index.removeIndex(context);

 while (result.hasNext()){
 Statement st = result.next();
 Resource sp = st.getSubject();
 Node node = graphDb.createNode();
 node.setProperty(uri,sp.stringValue() );
 node.setProperty(time,2008-02-00 );

count = count+1;
if (count==1) {
System.out.println(count: + count);
count=0;
tx.success();
}
index.index(node, context, sp.stringValue()+|20080200);

}

 The index hangs after 3 rows  and never finishes. Did I missed
 something ?
 Is it designed that you can have multiple Indexes? If I need to create
 fulltext index later I can do it ?
 thanks

  You could perhaps use the LuceneFulltextQueryIndexService (which is a
  LuceneFulltextIndexService, but which interprets the value argument in
  getNodes() as lucene query
  syntaxhttp://lucene.apache.org/java/2_9_1/queryparsersyntax.html).
  Index your URI|time as a one concatenated value and query it with
  range
  queries
 http://lucene.apache.org/java/2_9_1/queryparsersyntax.html#Range%20Searches
 ,
  f.ex: [http://my-uri|0 TO http://my-uri|1270797634350]
 (since
  all values are strings in lucene), and grabbing the last one. If the
  results
  of the range query could be reversed you could grab the first one
 instead,
  which would be much better.
 
  This solution doesn't strike me as being particularly good, but might
 work
  (I haven't tried it).
 
  2010/4/8 Lyudmila L. Balakireva lu...@lanl.gov
 
  Hi,
 
  I have  question how to better deal with time range index. I  am using
  Sail layer to build a triple store with context as time value.  I need
  binary search the nearest context value for the given uri and requested
  time.
  For example for the mysql it will be  table [ uri,time ] where rows:
  u ,t1
  u, t2
  u1,t1
  u2,t2
  etc.
   having  the given uri  u and  time t   t1  t t2  I can fast find  the
  nearest t1 for uri u  by query: select max (time) where timet  and uri
  =u;
 
  Is any  internal trick  I can use  for neo4j to build such index or
  optimize the operation?
   The timeline index  is somewhat  different since I need first to break
  recordset by uri and then find time. It will be many millions of
  timelines attached to the one node and I still need to iterate thru the
  nodes.  What else can be done here then Mysql?
  Thank you for help,
  Luda
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 
 
 
 
  --
  Mattias Persson, [matt...@neotechnology.com]
  Hacker, Neo Technology
  www.neotechnology.com
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 

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




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


Re: [Neo] sail and time index

2010-04-09 Thread Mattias Persson
You could perhaps use the LuceneFulltextQueryIndexService (which is a
LuceneFulltextIndexService, but which interprets the value argument in
getNodes() as lucene query
syntaxhttp://lucene.apache.org/java/2_9_1/queryparsersyntax.html).
Index your URI|time as a one concatenated value and query it with range
querieshttp://lucene.apache.org/java/2_9_1/queryparsersyntax.html#Range%20Searches,
f.ex: [http://my-uri|0 TO http://my-uri|1270797634350] (since
all values are strings in lucene), and grabbing the last one. If the results
of the range query could be reversed you could grab the first one instead,
which would be much better.

This solution doesn't strike me as being particularly good, but might work
(I haven't tried it).

2010/4/8 Lyudmila L. Balakireva lu...@lanl.gov

 Hi,

 I have  question how to better deal with time range index. I  am using
 Sail layer to build a triple store with context as time value.  I need
 binary search the nearest context value for the given uri and requested
 time.
 For example for the mysql it will be  table [ uri,time ] where rows:
 u ,t1
 u, t2
 u1,t1
 u2,t2
 etc.
  having  the given uri  u and  time t   t1  t t2  I can fast find  the
 nearest t1 for uri u  by query: select max (time) where timet  and uri
 =u;

 Is any  internal trick  I can use  for neo4j to build such index or
 optimize the operation?
  The timeline index  is somewhat  different since I need first to break
 recordset by uri and then find time. It will be many millions of
 timelines attached to the one node and I still need to iterate thru the
 nodes.  What else can be done here then Mysql?
 Thank you for help,
 Luda
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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