Hi Luigi,

I found that and was working on that yesterday and got pretty close... I 
posted it onto Stack Overflow 
<http://stackoverflow.com/questions/39401396/orientdb-query-to-return-matched-paths-satisfying-constraints-in-tabular-form>
 and 
got a reply that worked :)

Thanks!
  -William

On Friday, September 9, 2016 at 1:13:49 AM UTC-6, Luigi Dell'Aquila wrote:
>
> Hi William,
>
> If you are using OrientDB v 2.2 you should consider using MATCH statement: 
> http://orientdb.com/docs/2.2.x/SQL-Match.html
> It is a much better fit for this kind of queries.
>
> I hope it helps
>
> Thanks
>
> Luigi
>
>
> 2016-09-07 19:30 GMT+02:00 William <[email protected] <javascript:>>:
>
>> Hi,
>>
>> I'm new to OrientDB and am still learning... so far I've got some data 
>> loaded using the ETL system into a schema that has three different node 
>> types and two lightweight edge types. 
>>
>> The schema is something like this:
>>
>>
>> <https://lh3.googleusercontent.com/-PbpUhJUWd-w/V9BDFtGXtzI/AAAAAAAAHLY/ex7crJaOLiorXZEbKjqoxRGQgrqSffE9gCLcB/s1600/node_types.png>
>>
>>
>>
>> <https://lh3.googleusercontent.com/-TsGDXVhZTm4/V9BDIqQKSKI/AAAAAAAAHLc/y3Ra95b5T3gyXdtqmDFvNJdoHWaxLO8vgCLcB/s1600/graph_edges_schema.png>
>>
>> A simple dataset might be like this:
>>  
>>
>>
>> <https://lh3.googleusercontent.com/-nAe_wcu910o/V9BD8QE8gJI/AAAAAAAAHLo/DAzaeGV1fokP6NtcCRRx-dnMJTmJ7eKlwCLcB/s1600/sample_graph.png>
>>
>> The query that I'm trying working on would find paths:
>>
>> [A1] --E1--> [B1] <--E2-- [C1] --E2--> [B2] <--E1-- [A2]
>>
>> with these constraints: 
>>  
>>
>> C1.Date is in 9/2014
>> C1.Weight is > 0.8
>> A1.Date is the same as C1.Date
>> A2.Date is between C1.Date and C1.Date+3 days
>>
>>
>> Ideally, I'd like to get the output into a table that would have these 
>> columns:
>>
>> C1.Date, C1.Weight, A1.Flag, A2.Flag, B1.ID, B2.ID
>>
>>
>> So, I think I need to start with the C node and work my way out from 
>> there... so I put this together:
>>
>> [1] SELECT FROM C WHERE Weight > 0.8 AND Date.format('yyyy-MM')='2014-09'
>>
>>
>> Getting to the B-nodes would be an OUT traversal, so I added a traverse 
>> query on the E2 edges going out from "C" nodes.:
>>
>> [2] TRAVERSE OUT("E2") FROM ( [1] )
>>
>>
>> then I can get the A nodes with:
>>
>> [3] TRAVERSE IN("E1") FROM ( [2] )
>>
>>
>> So, this is where I'm getting stuck, I'm not sure how to filter the dates 
>> on my A1 and A2 nodes based on what's in the C node...
>>
>> I'm attaching a zip file containing this example in CSV with ETL files to 
>> construct the graph.  I'm also running this on community-2.2.8.
>>
>> Any help or pointers is greatly appreciated!
>>
>> Thanks!
>> -William
>>
>>
>>
>>
>> -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OrientDB" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" 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