I could solve this issue but right now I am having performance related 
problem.
 
The structure is like this:
[A] - (owns) -> [B] - (sends) -> [C] - (to) -> [D] <- (owned by) - [E]
[C] would be hyperedge instead of node but that is not manageable. [C] has 
millions of items.
The goal is to create an edge between [A] and [C] and update it frequently 
based on [C] .
Due to computation time the best is to store statistics in an edge instead 
of calculating it on demand. I need batch processing.
 
So what I do is:
Loop through on [C] for a particular day (indexed) and in the same query I 
collect the @RID of [A], [B], [C], [D] and [E] (there is only one from each 
for an item [C].
So, I have the 2 endpoints in a relative easy and fast way. 
But now I have to check whether the link exists between [A] and [E] and 
contains the [C] in a linkset, meaning it was already processed.
And his part is slow because there is no API for getEdge(vertex A, vertex 
B, class C) (although it is in the documentation but marked as deprecated.
So I do it with SQL query: select @rid.asString() as row_id, if(eval('[C] 
in LinkSetField'), 1, 0) as C_Exists from class-C where in = [A] and out = 
[E]. This is not indexed. 
If exists and contains [C] then skips it, otherwise creates and/or puts [C] 
into the "super-edge" and then updates the statistical fields as well.
 
So I need a fast and efficient solution in JavaScript function to find an 
edge between 2 entities and retreive properties, even if these are linksets.
 
Thank you in advance!
 
L.
 
 
 
 

2014. június 3., kedd 21:36:33 UTC+2 időpontban László Rékasi a következőt 
írta:

> Hi, 
>
> I am looking for an example about adding, removing items from linkset 
> embedded in edge with Javascript.
> Do you have any?
>
> something like:
> var myEdge = v1.addEdge("MyEdgeClass", v2, null, null, "Field1", "String 
> Value", "LinkSetField", [ so what to put here? ]);
>
> also, would like to remove items in case of the underlying subgraph 
> changes.
>
> Thank you in advance very much!
>
> L.
>

-- 

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