bio4j / exporter

GSoC 2014 project
GNU Affero General Public License v3.0
3 stars 3 forks source link

Getting to work on the exporting the results #32

Closed pablopareja closed 10 years ago

pablopareja commented 10 years ago

Hey @andre-nunes

Did you already get to work on how to export the results to either XML or JSON? This part of the project is independent from the steps/DSL definition or CLI implementation Do you have a preliminary idea on how you're going to do it? Let me know if you have any question about this :wink:

andr3nun3s commented 10 years ago

Can I use this library? The other way is to implement it myself.

Do I need to use this model?

pablopareja commented 10 years ago

Sure you can use that library, just keep in mind that you will have to use the GraphSONUtility and implement yourself at least part of the logic to export a query to JSON. (we're obviously not exporting the whole DB :smiley: )

The model you mention represents the data types together with their properties, not the data itself of specific instances from specific types that would be the result of a given Gremlin query.

laughedelic commented 10 years ago

oh.. I was writing almost the same reply! ")

pablopareja commented 10 years ago

:smile: :stuck_out_tongue:

andr3nun3s commented 10 years ago

What's the difference between a Jettison and a Jackson? Which should I use?

pablopareja commented 10 years ago

They are two different APIs/libraries with similar characteristics, use the one you feel more comfortable with.

laughedelic commented 10 years ago

Don't choose it randomly, take a look at the first 3 links from the google search "Jettison vs Jackson", it may give you some clues how to chose it for the purposes of the project:

Why not to make a list of pros and cons for the two? And then maybe the choice will be obvious. If not, we'll decide it together :wink:

andr3nun3s commented 10 years ago

Jettison

Jackson

From what I've gathered, Jackson seems the obvious choice, do you agree?

laughedelic commented 10 years ago

absolutely agree! well done :+1:

andr3nun3s commented 10 years ago

Ok, imagine that a query iterates a bunch of vertices, using GraphSONUtility I'll just print each one of those vertices into the output file?

laughedelic commented 10 years ago

well, if the query result is multiple vertices, I guess, the output should be a JSON array of the serialized vertices.

andr3nun3s commented 10 years ago

Ok, so I've tested exporting to GraphSON and it worked. I used a simple query using our DSL on the classic TinkerGraph to test it, here's the commit: https://github.com/bio4j/exporter/commit/06f613726d4ab86e9ba738d49db51f7581f85ce5

As GraphML is a specification for the serialization of an entire graph and not the individual elements of a graph, methods that support input and output of single vertices and edges are not supported. I'll have to add the vertices/edges to a graph and export the whole graph. Source