Hi alltogether,
I really like the concept of storing unsorted data to a time-series
calendar and perform lazy (or fuzzy) analytics afterwards
Second, I want to realize this with the Ruby Object Mapping Tool
ActiveOrient.
So I followed the usecase-instructions in the maual
(http://orientdb.com/docs/2.1/Time-series-use-case.html) using the 2.1.5
release of OrientDB.
Some minor changes were necessary, first I was not able to use Linkmaps,
because this Version completely rejected any attempt to insert data into
the linkmap-field. After changing to LinkList anything works.
This is the class-tree
V --> "Exchange", ["ExShare", "ExVol"]
V --> Day ,"Month", "Year"
All classes are Vertices, the exchange-based classes contain data to store
in the calendar.
The content of a Month-record:
=> #<ActiveOrient::Model::Month:0x00000003d8e5e8
@metadata={"type"=>"d", "class"=>"Month", "version"=>33, "fieldTypes"=>
"day=z", "cluster"=>13, "record"=>23},
@attributes={"label"=>10,
"day"=>["#14:736", "#14:737", "#14:738", "#14:739", "#14:740",
"#14:741", "#14:742", "#14:743", "#14:744", "#14:745", "#14:746", "#14:747",
"#14:748", "#14:749", "#14:750", "#14:751", "#14:752", "#14:753", "#14:754",
"#14:755", "#14:756", "#14:757", "#14:758", "#14:759", "#14:760", "#14:761",
"#14:762", "#14:763", "#14:764", "#14:765", "#14:766", "#14:767"],
"created_at"=>2015-11-26 06:40:17 +0100, "updated_at"=>2015-11-
26 06:40:17 +0100}>
Properties of Year: month: type linklist
Properties of Month: day: type linklist
Properties of Day: ad_share, ad_vol each type linklist
Thanks to the Usecase-documentation, I even managed to assign data-items to
the calendar.
Now the tricky part: retrieving of the data.
Firstly: The documentation uses "SELECT union()" to aggregate the data.
This should be changed to "SELECT unionall( " by somebody with write
access to the documentation.
The DataRecords are stored in ExShare and ExVol, both equipped with an
Index: date+exchange: unique
The Query
select expand( shares ) from (
select unionall(ad_share) AS shares from (
traverse day from ( select expand( month[10] ) from year
where label = 2015 ) ) ) order by New52WeekHigh
reveals
----+-------+-------+-----+--------+---------+---------+---------+-----------+------------+------------------+-------------------------+-------------------------
# |@RID |@CLASS
|Total|exchange|Advancing|Declining|Unchanged|New52WeekLo|New52WeekHig|date
|created_at |updated_at
----+-------+-------+-----+--------+---------+---------+---------+-----------+------------+------------------+-------------------------+-------------------------
0 |#10:605|ExShare|375 |amex |174 |181 |20 |14
|0 |2015-10-01
00:0...|2015-11-26T17:08:46.12...|2015-11-26T17:08:46.12...
1 |#10:605|ExShare|375 |amex |174 |181 |20 |14
|0 |2015-10-01
00:0...|2015-11-26T17:08:46.12...|2015-11-26T17:08:46.12...
2 |#10:605|ExShare|375 |amex |174 |181 |20 |14
|0 |2015-10-01
00:0...|2015-11-26T17:08:46.12...|2015-11-26T17:08:46.12...
3 |#10:605|ExShare|375 |amex |174 |181 |20 |14
|0 |2015-10-01
00:0...|2015-11-26T17:08:46.12...|2015-11-26T17:08:46.12...
4 |#10:605|ExShare|375 |amex |174 |181 |20 |14
|0 |2015-10-01
00:0...|2015-11-26T17:08:46.12...|2015-11-26T17:08:46.12...
5 |#10:605|ExShare|375 |amex |174 |181 |20 |14
|0 |2015-10-01
00:0...|2015-11-26T17:08:46.12...|2015-11-26T17:08:46.12...
6 |#10:635|ExShare|378 |amex |244 |116 |18 |4
|0 |2015-10-15
00:0...|2015-11-26T17:09:00.81...|2015-11-26T17:09:00.81...
7 |#10:635|ExShare|378 |amex |244 |116 |18 |4
|0 |2015-10-15
00:0...|2015-11-26T17:09:00.81...|2015-11-26T17:09:00.81...
8 |#10:635|ExShare|378 |amex |244 |116 |18 |4
|0 |2015-10-15
00:0...|2015-11-26T17:09:00.81...|2015-11-26T17:09:00.81...
9 |#10:635|ExShare|378 |amex |244 |116 |18 |4
|0 |2015-10-15
00:0...|2015-11-26T17:09:00.81...|2015-11-26T17:09:00.81...
10 |#10:635|ExShare|378 |amex |244 |116 |18 |4
|0 |2015-10-15
00:0...|2015-11-26T17:09:00.81...|2015-11-26T17:09:00.81...
11 |#10:635|ExShare|378 |amex |244 |116 |18 |4
|0 |2015-10-15
00:0...|2015-11-26T17:09:00.81...|2015-11-26T17:09:00.81...
12 |#10:638|ExShare|379 |amex |161 |203 |15 |3
|0 |2015-10-16
00:0...|2015-11-26T17:09:02.46...|2015-11-26T17:09:02.46...
obviously the datasets are queried several times.
Additionally, when trying to filter by » where exchange = 'nasdaq' «
nothing is returned by the query.
Can anybody give a hint, how to solve this undesired behaviour?
--
---
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.