No problem Aseem! Now, a very straightforward serialization would be http://graphml.graphdrawing.org/primer/graphml-primer.html. Would that be viable? It is XML, so might not mix well.
A Gremlin script like writer = new GraphMLWriter(g) out = new java.io.ByteArrayOutputStream() writer.outputGraph(out) result = out.toString() Should do the job in the REST API. However, I think a more native way would be good to look at, too. Otherwise, there is a format that Tinkerpop is introducing that is more JSON-friendly, https://github.com/tinkerpop/blueprints/wiki/JSON-Reader-and-Writer-Librarythat you easily could emit in the same way once it has stabilized and released. Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/ - Ă–resund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Thu, Aug 25, 2011 at 10:56 PM, Aseem Kishore <[email protected]>wrote: > Sorry if I'm inundating the list w/ too many emails. =D > > I've been loving Cypher -- way more user-friendly and powerful than the > REST > API's traverse method -- but I'm finding even Cypher isn't optimized for > queries where I really want to fetch a *subgraph*, not tabular data. > > I can give plenty of scenarios if that helps (I've even drawn diagrams!), > but the theme in my queries is repeatedly that I need to understand the > relationships between nodes in our graph, which means I want subgraphs. > > I understand that the traverse method in the REST API gives you the option > of returning nodes, relationships, or paths. I'd like to propose a new > return type: subgraph (or graph). > > Here's what I'm envisioning: the JSON contains an adjacency matrix of nodes > and relationships -- referenced entirely by URLs -- and an additional map > from URL to data (properties) for each referenced node and relationship. > > Here's an example format: https://gist.github.com/1171908 > > I'd *love* to be able to query and fetch subgraphs from the graph like > this. > That would be so awesome. I'd love thoughts and feedback. > > Cheers, > Aseem > _______________________________________________ > Neo4j mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

