Orientdb - Adding Formula to Vertex (Node) - orientdb

I am new to Orientdb. I have use case of trying to create a financial model in Orientdb . Is it possible to create a formula field type on a vertex that is based on another linked vertex or vertex and edge value . If not possible i am interested in best practice of how to update Vertex field values based on another vertex .

Related

Graphx :Edit the graph and add the vertex and Edges

I'm new to Graphx and doing some research, where I have to map the property graph model to hadoop. I have successfully created the graph by creating Vertex and edge RDD.Now I want to edit my graph by adding vertex at position X and the add a edge at position X-1 and X+1.
I have read multiple documents which says graphs are immutable, but there is an option of subgraph but according to me it is used only to eliminate certain vertex and edges.
Can some one guide me is there any way to edit the graphs ?

three.js calculate surfaces of stl files

I think i have a difficult problem right here..
I want to able to get the surfaces of f.e. the orange object in this three.js example https://threejs.org/examples/?q=stl#webgl_loader_stl
i want to click with the mouse, find the correct surface, which should then be highlighted, so i make sure this was the surface i want.
(i already implemented raycaster successfully, so thats not an issue)
The intersectObject method returns an array of intersections, each of which has face property. The face contains vertex indices.
For STL files containing multiple solids, each solid is assigned to a different group, and the groups are available in the geometry object that is returned from STLLoader. Each group is defined by a range of vertex indices.
So, I think you can correlate the vertex indices returned from the raycaster with the vertex indices in the geometry groups.

Storing mesh data values

I am creating meshes based off of a CSV files in the format "x,y,z,dataValue". Based on the data value, I am coloring the vertex. For example, for data value 10-20, it will be a dark green, and for 20-30 a lighter green, etc... I have this working, but I would like to be able to create an analysis tool for the mesh. Basically I want to show the data value of the point being hovered over by the mouse. So, if they are hovering over a vertex, it shows "data value = x". However, once the mesh is created I can only access the color, that data value is basically transformed into a material. I need a way to store the data value relative to each vertex.
I have about 450,000 lines of data, so I need an efficient way to find the data value. I have thought of two options: store the vertices mapped to a data value, and search through the map to find the right data value (I think this might me too slow).. OR store the data value in the shader for each vertex and then when hovering over the vertex, access the shader to grab the data value. I'm not sure how to do the second approach, or if it is the better way to go about it. I'm just looking for an efficient way to go about this.
I think you need to organize your vertex data in an Octree.
First get the hit point by the mouse ray and the MeshCollider via Physics.Raycast, and
then search for the vertex near the hit point in the octree.

How can I create the undirect Edge in OrientDB 2.2

I am a newbie in OrientDB. Currently I want to create the undirect Edge between 2 Vertexes, it looks like: Product A relates to Product B.
I am using Java API, blueprint.
Thank you.
aVertex.addEdge(endVertex, "label")
graph.addEdge(id, outVertex, inVertex, "label")
Either way, there are always an out and an in vertex
There is no way to create an undirected edges. In OrientDB, as in most graph databases in the market, edges always have a direction.
It is not a limitation, because you can traverse edges regardless their direction, using both() query operator or, in Java:
vertex.getEdges(Direction.BOTH, label)

How to determine the source vertex of connected component in graphx

I'm trying to determine the source vertex (root) in each connected component. The Graphx documentation says the connected components algorithm labels each connected component of the graph with the ID of its lowest-numbered vertex.
I would like to retrieve the source vertex, in this case 11. How can I do that?