Query 2 Get News Articles by Location on a particular date

suggest change
def search_news_by_entity(location,timestamp):
    query = """
    MATCH (n)-[]->(l) 
    where l.name='%s' and n.timestamp='%s'
    RETURN n.news_id limit 10
    """

    query = query % (location,timestamp)

    news_ids = []
    for res in graph.cypher.execute(query):
        news_ids.append(str(res[0]))

    return news_ids

You can use this query to find all news articles (n) connected to a location (l) by a relationship.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents