def test_neo_to_graph_transform(): """ load from neo4j and transform to nx graph """ nt = NeoTransformer(host='localhost', port='7474', username='******', password='******') nt.load() nt.report() t = PandasTransformer(nt.graph) t.save(os.path.join(target_dir, "neo_graph.csv"))
def test_neo_to_graph_transform(): """ load from neo4j and transform to nx graph """ n = NeoTransformer() n.load() n.report() t = PandasTransformer(n) t.save("target/neo_graph.csv")
def test_neo_to_graph_transform(): """ load from neo4j and transform to nx graph """ nt = NeoTransformer(uri=DEFAULT_NEO4J_URL, username=DEFAULT_NEO4J_USERNAME, password=DEFAULT_NEO4J_PASSWORD) nt.load() nt.report() t = PandasTransformer(nt.graph) t.save(os.path.join(target_dir, "neo_graph.csv"))
def test_neo_to_graph_transform(): """ load from neo4j and transform to nx graph """ return nt = NeoTransformer(host='localhost', port='7474', username='', password='') nt.load() nt.report() t = PandasTransformer(nt.graph) t.save("target/neo_graph.csv")
help='A filter that can be applied to nodes') parser.add_argument('--edge_filter', action='append', help='A filter that can be applied to edges') parser.add_argument('--uri', help='URI/URL for Neo4j (including port)', default='localhost:7474') parser.add_argument('--username', help='username', default='neo4j') parser.add_argument('--password', help='password', default='demo') args = parser.parse_args() # Initialize NeoTransformer nt = NeoTransformer(None, uri=args.uri, username=args.username, password=args.password) if args.node_filter: for f in args.node_filter: k, v = f.split('=') nt.set_node_filter(k, set(v)) if args.edge_filter: for f in args.edge_filter: k, v = f.split('=') nt.set_edge_filter(k, set(v)) # Read from Neo4j with the given filter constraints (if any) nt.load() nt.report()
action='append', help='A filter that can be applied to node and/or edges') parser.add_argument('--host', help='host to connect with Neo4j', default='localhost') parser.add_argument('--bolt_port', help='Bolt port to connect with Neo4j', default='7687') parser.add_argument('--username', help='username (default: neo4j)', default='neo4j') parser.add_argument('--password', help='password (default: demo)', default='demo') args = parser.parse_args() # Initialize NeoTransformer n = NeoTransformer(None, args.host, {'bolt': args.bolt_port}, args.username, args.password) if args.filter is not None: if len(args.filter) > 0: for filter in args.filter: k, v = filter.split('=') # Set filters n.set_filter(k, v) # Read from Neo4j with the given filter constraints (if any) n.load() n.report()