Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Getting existing Indexs By Java
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mahdi Negahi  
View profile  
 More options Apr 27 2012, 9:03 am
From: Mahdi Negahi <negahi.ma...@gmail.com>
Date: Fri, 27 Apr 2012 06:03:04 -0700 (PDT)
Local: Fri, Apr 27 2012 9:03 am
Subject: Getting existing Indexs By Java

I want to fetch all available Index in a graph database by Java. Then, I
want to fetch all indexed node on them. we don't have any assumption about
Index name, the program must be fetch them automatically.

now I can fetch all index name by this line :

for(String s :_graphDb.index().nodeIndexNames())
   {
   }

but i stuck in next step.

please advice me!

regard
Mahdi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Axel Morgner  
View profile  
 More options Apr 27 2012, 9:19 am
From: Axel Morgner <a...@morgner.de>
Date: Fri, 27 Apr 2012 15:19:47 +0200
Local: Fri, Apr 27 2012 9:19 am
Subject: Re: [Neo4j] Getting existing Indexs By Java
try

for(String s :_graphDb.index().nodeIndexNames())
    {
         graphDb.index().forNodes(s).query(...)
    }
...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mahdi Negahi  
View profile  
 More options Apr 27 2012, 1:27 pm
From: Mahdi Negahi <negahi.ma...@gmail.com>
Date: Fri, 27 Apr 2012 10:27:51 -0700 (PDT)
Local: Fri, Apr 27 2012 1:27 pm
Subject: Re: [Neo4j] Getting existing Indexs By Java

I want to store all nodes that they indexed by corresponding index to other
databases. imagine our database has 1 node that it indexed by a index which
is called "PrimaryKey" the key of the index is "PKEY" and the value is
"125". we just added this Index by following code:

IndexManager index = graphDb.index();
Index<Node> PrimaryKey= index.forNodes( "PrimaryKey" );
PrimaryKey.add( node1, "PKEY", "125" );

so when we pars the databases when we analyse this node , the application
must be fetch all the node index (PrimaryKey) the key of the index (PKEY)
and the value (125).
I want to save these information in other databases.

Thanks for ur answer
Mahdi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Apr 27 2012, 2:31 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Fri, 27 Apr 2012 20:31:42 +0200
Local: Fri, Apr 27 2012 2:31 pm
Subject: Re: [Neo4j] Getting existing Indexs By Java

Did you store the information also as property on the node?

Otherwise you'd have to use some low level lucene operations to extract it, you can do it manually with the lucene tool called luke,
It can export this data into xml, see:  http://www.getopt.org/luke/
"Export to XML - exports index data and metadata to XML file. This is available both from the GUI and from the command-line."

I don't have the code at hand to read and use the lucene database format programmatically.

Michael

Am 27.04.2012 um 19:27 schrieb Mahdi Negahi:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mahdi Negahi  
View profile  
 More options Apr 28 2012, 10:13 pm
From: Mahdi Negahi <negahi.ma...@gmail.com>
Date: Sat, 28 Apr 2012 19:13:44 -0700 (PDT)
Local: Sat, Apr 28 2012 10:13 pm
Subject: Re: [Neo4j] Getting existing Indexs By Java

thanks for ur reply

The application must be worked with all graph, so I don't know the
information is stored as node's property.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mattias Persson  
View profile  
 More options Apr 29 2012, 8:38 am
From: Mattias Persson <matt...@neotechnology.com>
Date: Sun, 29 Apr 2012 14:38:59 +0200
Local: Sun, Apr 29 2012 8:38 am
Subject: Re: [Neo4j] Getting existing Indexs By Java

The values are stored in the lucene documents, but API-wise you cannot
reach them I'm afraid.

2012/4/29 Mahdi Negahi <negahi.ma...@gmail.com>

--
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mahdi Negahi  
View profile  
 More options Apr 30 2012, 12:22 am
From: Mahdi Negahi <negahi.ma...@gmail.com>
Date: Sun, 29 Apr 2012 21:22:32 -0700 (PDT)
Local: Mon, Apr 30 2012 12:22 am
Subject: Re: [Neo4j] Getting existing Indexs By Java

even we can not convert items that they indexed to the XML or something
like that.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Apr 30 2012, 1:22 am
From: Peter Neubauer <neubauer.pe...@gmail.com>
Date: Mon, 30 Apr 2012 07:22:13 +0200
Local: Mon, Apr 30 2012 1:22 am
Subject: Re: [Neo4j] Getting existing Indexs By Java

Sorry Mahdi,
It's hard to read your question. Do you have any code that shows your
problem?
On Apr 30, 2012 6:22 AM, "Mahdi Negahi" <negahi.ma...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mahdi Negahi  
View profile  
 More options May 3 2012, 11:58 pm
From: Mahdi Negahi <negahi.ma...@gmail.com>
Date: Thu, 3 May 2012 20:58:26 -0700 (PDT)
Local: Thurs, May 3 2012 11:58 pm
Subject: Re: [Neo4j] Getting existing Indexs By Java

Sorry Peter

you know I want convert a Neo4j graph to other databases . I convert all
the component of a Neo4j database to the target. But I missed index item in
the target environment. I want to know, Is there any chance to convert
indexed item to the XML or something else ?

for example, imagine we have a graph with two nodes and a relationship.

node 1 :
ID: 1
Property --> Name: Mahdi
Index (PKEY)--> PrimeryKey: 50

node 2:
ID: 2
Property --> Name: Peter
Index (PKEY)--> PrimeryKey: 1

relationship:

Type----> Know
property ---> Since: 2012

so we past this graph to the application and the result something like this

<Node ID=1> <Index Name="PKEY" Key="PrimeryKey" Value="50 /> </Node>
<Node ID=2> <Index Name="PKEY" Key="PrimeryKey" Value="1 /> </Node>

it is much noticeable that we do not have any assumption about index's name
, index key .... we just past a graph to the program or function and it
returns the : index name  , index key and index value with a specific format


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Duane Nickull  
View profile  
 More options May 4 2012, 12:19 am
From: Duane Nickull <du...@uberity.com>
Date: Fri, 4 May 2012 04:19:54 +0000
Local: Fri, May 4 2012 12:19 am
Subject: Re: [Neo4j] Getting existing Indexs By Java

Inline:
***********************************
Consulting and Contracting; Proven Results!
i.  Neo4J, Java, LiveCycle ES, Flex, AIR, CQ5 & Mobile
b. http://technoracle.blogspot.com
t.  @duanechaos

From: Mahdi Negahi <negahi.ma...@gmail.com<mailto:negahi.ma...@gmail.com>>
Reply-To: "neo4j@googlegroups.com<mailto:neo4j@googlegroups.com>" <neo4j@googlegroups.com<mailto:neo4j@googlegroups.com>>
Date: Thursday, 3 May, 2012 8:58 PM
To: "neo4j@googlegroups.com<mailto:neo4j@googlegroups.com>" <neo4j@googlegroups.com<mailto:neo4j@googlegroups.com>>
Subject: Re: [Neo4j] Getting existing Indexs By Java

Sorry Peter

you know I want convert a Neo4j graph to other databases .

DN: So that is just silly.  Why would anyone want to ever do that?  ;-)

I convert all the component of a Neo4j database to the target. But I missed index item in the target environment. I want to know, Is there any chance to convert indexed item to the XML or something else ?

DN: Okay , seriously, there are 6 major classes in Java that work with indexes.
Index<cid:CB3D09EC-41C9-4F33-A0F9-0FB9A5AB0E4C>
IndexHits<cid:5F06BA85-3A76-4680-B9A9-F4FC01E0FF98>
IndexImplementation<cid:AF5B04BF-9FFE-4140-A758-A5DD832C7292>
IndexIterable<cid:734CA358-13EF-4A1C-BBEE-EDF19559230B>
IndexManager<cid:B8802045-7B77-4513-976D-AD2F4173A772>
IndexProvider<cid:8EE1BC97-3231-47F2-A3A4-5E205215BDF3>

I think you why you want, the INdexManager has a lot of methods worth exploring.  Whoever designed this class clearly thought of your use case.  I will provide a caveat however.  I may have misunderstood your request.  If not, IndexManager has a method nodeIndexNames<cid:12E4D8AC-F566-4939-AD45-F00C3637849E>()
 Which returns an array 9String[]) of all the nodes that are indexes.  One returned, you can serialize them into any data format with simple parlous tricks.

Perhaps I did not understand your request?

Duane

for example, imagine we have a graph with two nodes and a relationship.

node 1 :
ID: 1
Property --> Name: Mahdi
Index (PKEY)--> PrimeryKey: 50

node 2:
ID: 2
Property --> Name: Peter
Index (PKEY)--> PrimeryKey: 1

relationship:

Type----> Know
property ---> Since: 2012

so we past this graph to the application and the result something like this

<Node ID=1> <Index Name="PKEY" Key="PrimeryKey" Value="50 /> </Node>
<Node ID=2> <Index Name="PKEY" Key="PrimeryKey" Value="1 /> </Node>

it is much noticeable that we do not have any assumption about index's name , index key .... we just past a graph to the program or function and it returns the : index name  , index key and index value with a specific format

On Monday, April 30, 2012 1:22:13 PM UTC+8, Peter Neubauer wrote:

Sorry Mahdi,
It's hard to read your question. Do you have any code that shows your problem?

On Apr 30, 2012 6:22 AM, "Mahdi Negahi" <negahi.ma...@gmail.com<mailto:negahi.ma...@gmail.com>> wrote:
even we can not convert items that they indexed to the XML or something like that.

On Sunday, April 29, 2012 8:38:59 PM UTC+8, Mattias Persson wrote:

The values are stored in the lucene documents, but API-wise you cannot reach them I'm afraid.

2012/4/29 Mahdi Negahi <negahi.ma...@gmail.com<mailto:negahi.ma...@gmail.com>>
thanks for ur reply

The application must be worked with all graph, so I don't know the information is stored as node's property.

On Saturday, April 28, 2012 2:31:42 AM UTC+8, Michael Hunger wrote:

Did you store the information also as property on the node?

Otherwise you'd have to use some low level lucene operations to extract it, you can do it manually with the lucene tool called luke,
It can export this data into xml, see:  http://www.getopt.org/luke/
"Export to XML - exports index data and metadata to XML file. This is available both from the GUI and from the command-line."

I don't have the code at hand to read and use the lucene database format programmatically.

Michael

Am 27.04.2012 um 19:27 schrieb Mahdi Negahi:

I want to store all nodes that they indexed by corresponding index to other databases. imagine our database has 1 node that it indexed by a index which is called "PrimaryKey" the key of the index is "PKEY" and the value is "125". we just added this Index by following code:

IndexManager index = graphDb.index();
Index<Node> PrimaryKey= index.forNodes( "PrimaryKey");
PrimaryKey.add( node1, "PKEY", "125");

so when we pars the databases when we analyse this node , the application must be fetch all the node index (PrimaryKey) the key of the index (PKEY) and the value (125).
I want to save these information in other databases.

Thanks for ur answer
Mahdi

On Friday, April 27, 2012 9:19:47 PM UTC+8, Axel wrote:

try

for(String s :_graphDb.index().nodeIndexNames())
    {
         graphDb.index().forNodes(s).query(...)
    }
...

--
Mattias Persson, [matt...@neotechnology.com<mailto:matt...@neotechnology.com>]
Hacker, Neo Technology
www.neotechnology.com<http://www.neotechnology.com>

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options May 4 2012, 1:01 am
From: Peter Neubauer <neubauer.pe...@gmail.com>
Date: Fri, 4 May 2012 07:01:58 +0200
Local: Fri, May 4 2012 1:01 am
Subject: Re: [Neo4j] Getting existing Indexs By Java

Mahdi,
If I understand you right, you are looking for a way to export a neo4J
graphics into a format like XML that includes the indexed properties?
On May 4, 2012 5:58 AM, "Mahdi Negahi" <negahi.ma...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mahdi Negahi  
View profile  
 More options May 5 2012, 12:11 am
From: Mahdi Negahi <negahi.ma...@gmail.com>
Date: Fri, 4 May 2012 21:11:31 -0700 (PDT)
Local: Sat, May 5 2012 12:11 am
Subject: Re: [Neo4j] Getting existing Indexs By Java

Dear Überity and Peter

Thanks for ur reply.

 DN: So that is just silly.  Why would anyone want to ever do that?  ;-)

I work on data portability in cloud databases so my portability patterns
consist of two migration patterns. as result, it not much silly as you
thought  ;-)
___________________________________________________________________________ ________________

I only want to export indexed properties but in a specific way , I must to
know the owner of those properties.

for example I loop in every nodes. I must to realized that node has some
indexed properties. then extract them in XML or something else ( SQL Table).

for example the following code is in Neo4j Document

IndexManager index = graphDb.index();
Index<Node> actors = index.forNodes( "actors" );
Node reeves = graphDb.createNode();
actors.add( reeves, "name", "Keanu Reeves" );

so I want to get the following output from the above code.* Please notice
the function must be work with any graph. that means we do not have any
knowledge about index name ("actors"), properties key ("name").*

<Node ID=1>
                <Indexs name="actors">
                             <Index key="name" value="Keanu Reeves" />
                </indexs>
</Node>

I hope I can say what exactly my problem.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options May 5 2012, 4:04 am
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Sat, 5 May 2012 10:04:57 +0200
Local: Sat, May 5 2012 4:04 am
Subject: Re: [Neo4j] Getting existing Indexs By Java

Mahdi,

as mentioned it doesn't work out of the box.

The only thing I can suggest to you right now is to use the Lucene classes IndexReader and Document
point them to each of the index/lucene/node/* and  index/lucene/relationship/* directories read all documents and all fields of each document and use this information.

see: http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/api/a...)
and: http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/api/a...

shouldn't be that complicated, just a few lines of code.

Make sure that all transactions are completed when you do this, otherwise you might get stale data.

Michael

Am 05.05.2012 um 06:11 schrieb Mahdi Negahi:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »