I think I answered this in my previous reply. I see the
(actor:Person)-->(theater:Theater) relationship as including information
that is already in the graph. You can already match on
(actor)-->(movie)-->(theater), so there is not need to duplicate this
information in an additional relationship. Even if you want to know how
many of his movies played in the theater, that is easy to query without
storing the result. I gave an example query for just that in the previous
email.

There are cases when you might want to store results of queries in the
graph. Normally that only happens if you have very expensive or slow
queries. This is not the case in these examples. And if you do end up in
that case, you need to manage possible inconsistencies in the data model.
If the original graph changes, you have to update all these stored results
also. That is risky.


On Tue, Sep 9, 2014 at 5:46 PM, Mohana Krishna <[email protected]> wrote:

> I have assumed a node of type "Person" is connected to node of type
> "Theater" if the theater fetched most collections in terms of money for his
> movie. Similarly, a node of type "Movie" is connected to a node of type
> "Theater" if the movie has played in the theater. In such a case issuing
> the following query has given me a clique of size-3. I hope I can extend
> this to higher level (say size-4, size-5 etc.) and to my case of crime data
> (based on crime_type). Please correct me if there is any logical mistake or
> if there is a better way of formulating it in terms of performance.
>
> My query:
>
>  MATCH (actor:Person)-[:ACTED_IN]->(movie:Movie),
>        (movie:Movie)-[:PLAYED_IN]->(theater:Theater),
>     (actor:Person)-[:MAX_COLLECTIONS]->(theater:Theater)
>  RETURN actor.name, movie.title, theater.name;
>
> Awaiting your reply. Thanks Craig.
>
> On Tuesday, 12 August 2014 20:00:01 UTC+5:30, Mohana Krishna wrote:
>
>> Hello,
>>
>> I have loaded the spatial data in the attached file using REST API script
>> (which is also attached). The nodes are created and I can visualize them on
>> DB.
>>
>> However when I perform the query
>>
>> "START n=node:geom('withinDistance:[41.8082, -87.7084, 10.0]') RETURN n"
>> in CYPHER window , I am getting "Unknown Error" as result.
>>
>> Please help.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to