jlowenz / hypergraphdb

Automatically exported from code.google.com/p/hypergraphdb
0 stars 0 forks source link

Creating a graph based on existing API #69

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello 

Could you help me with this please

I want to know how to store the Links with relationships in the new hypergraph 
based on the existing API of wordnet

you provide this example in the wiki pages:

HyperGraph graph = HGEnvironment("c:/temp/test_hgdb");
  Book mybook = new Book("Critique of Pure Reason", "E. Kant");  
  HGHandle bookHandle = graph.add(mybook);
  HGHandle priceHandle = graph.add(9.95);
  HGValueLink link = new HGValueLink("book_price", bookHandle, priceHandle);

I tried to add the link to the graph but after I traverse the graph I couldn't 
get the same result if I traverse the original one.

graph.add(link);

Could you help please?

Thank you

Original issue reported on code.google.com by copy4e...@gmail.com on 5 Dec 2011 at 4:59

GoogleCodeExporter commented 9 years ago
I'm not sure I understand the question. How do you traverse the graph? What is 
the "original one" vs. the "non-original one"?

Original comment by borislav...@gmail.com on 5 Dec 2011 at 3:35

GoogleCodeExporter commented 9 years ago
sorry for miss-explaining my question 

I mean by the original graph is the wordnet hypergraph

and the non-original or the new graph is the graph i create which would be like 
subset of the wordnet hypergraph.

the problem for me is how to store links with relations in a proper way because 
when I add them to  my new graph using the code you provide in the wiki page 

HyperGraph graph = HGEnvironment("c:/temp/test_hgdb");
  Book mybook = new Book("Critique of Pure Reason", "E. Kant");  
  HGHandle bookHandle = graph.add(mybook);
  HGHandle priceHandle = graph.add(9.95);
  HGValueLink link = new HGValueLink("book_price", bookHandle, priceHandle);
  graph.add(link);

I tried to traverse the wordnet graph for spisific word using depthFirstSearch 
you provide in the wiki pages also and I get a list of result then I tried to 
traverse the new graph with the same word using the same depthFirstSearch 
algorithm I got different result than the one with the wordnet.

so could you help me to know how to store the links with relations in a proper 
way so I can traverse it and get same result of wordnet. 

Thank you for your help I really appreciated. 

Original comment by copy4e...@gmail.com on 6 Dec 2011 at 4:43

GoogleCodeExporter commented 9 years ago
Well, what you're doing in terms of storage looks right. I'll probably need to 
see you traversal code. Keep in mind that each atom in HGDB is typed. So when 
you query or traverse, you generally specify the types of links you're 
interested in. With this book example, the type of the link is actually 
java.lang.String and the value is "book_price". With wordnet links, in general 
only the type matters as no value is really stored (except glosses for synsets 
if I remember correctly.). So when you traverse, make sure you configure your 
adjacency list generator correctly and it should work. You can always debug by 
doing the traversal manually - graph.getIncidenceSet(currentAtom) etc...

Original comment by borislav...@gmail.com on 9 Dec 2011 at 4:02

GoogleCodeExporter commented 9 years ago
Thank You for your help, I was trying to store the links with the values thats 
why I didn't get the same result
I think I miss understand how the wordnet is stored in the hypergraph thats why 
I am confused.

sorry for asking too many requests from you but do you have any reference on 
how the data of wordnet is stored in the hypergraph so I can understand it.

Thank you for your support I really appreciated. 

Original comment by copy4e...@gmail.com on 11 Dec 2011 at 6:40

GoogleCodeExporter commented 9 years ago
Well, there's the overview which you have probably seen: 
http://hypergraphdb.org/learn?page=WordNet&project=hypergraphdb. Otherwise, the 
code is as always the best reference :)

Original comment by borislav...@gmail.com on 11 Dec 2011 at 10:25

GoogleCodeExporter commented 9 years ago
Well, there's the overview which you have probably seen: 
http://hypergraphdb.org/learn?page=WordNet&project=hypergraphdb. Otherwise, the 
code is as always the best reference :)

Original comment by borislav...@gmail.com on 11 Dec 2011 at 10:25