def main():
    # TODO Deal with unicode errors
    # TODO Too much junk is going to export relationships
    # TODO Are there dates in the neo4j database (as opposed to year month day)
    g = GraphBuilder('http://localhost:7474/db/data/')
    # g.export_person_nodes_to_csv(out_file_name='person_nodes.tab')
    # g.export_company_node_to_csv(out_file_name='company_nodes.tab')
    # g.export_financial_nodes_to_csv(out_file_name='financial_nodes.tab')
    g.export_funded_relationships_to_csv(out_file_name='funded_relations.tab')
def main():
    # TODO Deal with unicode errors
    # TODO Too much junk is going to export relationships
    # TODO Are there dates in the neo4j database (as opposed to year month day)
    g = GraphBuilder('http://localhost:7474/db/data/')
    # g.export_person_nodes_to_csv(out_file_name='person_nodes.tab')
    # g.export_company_node_to_csv(out_file_name='company_nodes.tab')
    # g.export_financial_nodes_to_csv(out_file_name='financial_nodes.tab')
    g.export_funded_relationships_to_csv(out_file_name='funded_relations.tab')
def main():
    # Get reference to neo4j
    g = GraphBuilder('http://localhost:7474/db/data/')

    # uncomment to start with fresh database
    g.clear()
    #
    # print 'Neo4j Version', g.neo4j_version
    #
    # # Grab all nodes from mongo database and  add to graph database
    g.add_node_collection_to_graph('crunchbase', 'financial_organizations', 'funder', limit=200)
    g.add_node_collection_to_graph('crunchbase','people', 'person', limit=200)
    g.add_node_collection_to_graph('crunchbase', 'companies', 'company', limit=200)
    #
    # # Add funding rounds by financial organizations and individuals
    g.add_edges_to_graph('crunchbase', 'companies', index='company', limit=200)  ##  relationship_type='funded', limit=200)
    g.add_edges_to_graph('crunchbase', 'financial_organizations', index='funder', limit=200)   ## relationship_type='funded', limit=200)
    g.add_edges_to_graph('crunchbase', 'people', index='person', limit=200)  ##  relationship_type='funded', limit=200)

    print 'Nodes in graph', g.order