[open-bibliography] Basic RDF/XML to bibtex/RIS conversion?

Ben O'Steen bosteen at gmail.com
Fri Feb 3 15:21:35 UTC 2012


Graphml is an easy to hack format for Gephi, especially if you are using
python to hack with - you might find the following code helpful:

https://github.com/benosteen/PubMed-OA-network-analysis-scripts/blob/master/create_network.py

eg

import networkx as nx
from graphml import write_graphml

# the graphml.py in that repo is an improved version of the one in networkx)

g = nx.DiGraph() #directed graph (useful for citations)

g.add_node(node_id, **params) # params is key: value pairs, keys should be
present for all nodes if used.

# for example, params could be
# params = {'title': 'foo',
#                 'author':....  etc
#                 }

g.add_edge(from_node_id, to_node_id) # the edge can also have params

write_graphml(g, open("output.graphml", "w"))


And then just open the graphml in Gephi

Ben

On Friday, 3 February 2012, Mark MacGillivray wrote:

> On Fri, Feb 3, 2012 at 3:04 PM, Tom Morris <tfmorris at gmail.com<javascript:;>>
> wrote:
> > On Fri, Feb 3, 2012 at 9:44 AM, Ross Mounce <ross.mounce at gmail.com<javascript:;>>
> wrote:
> >>> the scripts I wrote that parse the BNB files and spit out the bibjson
> >>
> >> yes, I think that sounds like something that would be useful. Although
> >> I may have to ask the same type of question again:
> >>
> >> How to get from bibjson -> bibtex  (or RIS)
> >
> > Google Refine's templated exporter could probably get you from BibJSON
> > to RIS pretty easily (not sure about BibTex's LaTeX encoding of
> > multinational characters).
>
> Yeah, refine might be a good option, or some scripts from Jim.
>
>
> > Having said that, surely Gephi doesn't take either of these as a
> > native import format.  Don't you just want clusters of authors (and
> > other associated metadata) in some tractable format?
>
> Having had a very cursory look at the front page of gephi, I imagine
> this to be the case; why would a vis tool care about bibtex? If so,
> you could probably just pull these sorts of lists directly out of the
> bibjson.
>
> Mark
>
> _______________________________________________
> open-bibliography mailing list
> open-bibliography at lists.okfn.org <javascript:;>
> http://lists.okfn.org/mailman/listinfo/open-bibliography
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/open-bibliography/attachments/20120203/00ce6d4f/attachment-0001.html>


More information about the open-bibliography mailing list