0

If I use selector.select to select a historic post by its timestamp & then try to create a new tagged relationship with the historic post it turns out that the historic post isn't actually tagged! However, a greyed-out circle containing the same information as the historic post appears in my graph & that ends up being tagged rather than the historic post... why is that & more importantly - how do I actually tag the historic post?

>>> import py2neo

>>> from py2neo import Graph, Node, Relationship

>>> from pandas import DataFrame

>>> graph = Graph(user='neo4j', password='notmypassword')

>>> t = Node("Tag", name="ANOTHER_TAG")

>>> graph.merge(t)     # put the Tag into the graph

>>> selected = selector.select("Post", timestamp=1505826314) 

>>> list(selected)

>>> [(deefe72:Post {date:"2017-09-19",id:"e0f08d21-afeb-49b7-b841-c6c366d11b62",text:"30 years in the building trade have injured my back & my joints",timestamp:1505826314,title:"building is bad for my back"})]

>>> rel=Relationship(t, "TAGGED", selected)

>>> graph.create(rel)
Bruno Peres
  • 15,845
  • 5
  • 53
  • 89
user1613312
  • 374
  • 2
  • 15

1 Answers1

0

Gaaargghh!!!

selected = selector.select("Post", timestamp=1505826314).first()

Rather than

selected = selector.select("Post", timestamp=1505826314)

user1613312
  • 374
  • 2
  • 15