Hi,

I'm trying to match listing availabilities in my graph (Airbnb-like). 

* The graph has 1 node per date, and consecutive days are linked by a 
NEXT_DAY edge.
* Listings are linked to day nodes by an AVAILABLE edge (if they are 
available)

I'm trying to write a query which return all listings which are available 
from start_date to end_date.

I know the following syntax is wrong but I may help giving the general idea

MATCH period=(a)-[:NEXT_DAY*]->(c)
WHERE a.date="2015-01-20" AND c.date="2015-01-24"

MATCH (listing:Listing)-[:AVAILABLE]->(d:Date)
FOREACH (d IN nodes(period))

RETURN listing


*Bonus question: How could I proceed if I wanted to score listings 
proportionally to their availability match with the query (e.g. 100% if the 
listing is available during the whole period, 50% if it is only available 
half of the period) ?*

Thanks in advance :)

Benjamin

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