2017-09-21 4 views
0

Si j'utilise selector.select pour sélectionner un article historique par son horodatage &, puis essayez de créer une nouvelle relation balisée avec l'article historique, il s'avère que l'article historique n'est pas réellement balisé! Cependant, un cercle grisé contenant les mêmes informations que le poste historique apparaît dans mon graphique & qui finit par être étiqueté plutôt que le poste historique ... pourquoi est-ce plus important encore - comment puis-je marquer le poste historique?marquage d'un article historique dans py2neo

>>> 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) 

Répondre

0

Gaaargghh !!!

sélectionné = selector.select ("Post", timestamp = 1505826314) .first()

Plutôt que

sélectionné = selector.select ("Post", timestamp = 1505826314)