OrientDB: connected components OSQL query - orientdb

Does anybody know how to compute the connected components of a graph with an OrientDB query?
I'm trying to replicate what was done here but I'm missing something similar to a REDUCE operator for collections.
Thanks in advance.

This query
SELECT distinct(traversedElement(0))
FROM (TRAVERSE both('ManagedBy') FROM Employee)
Returned me the right result. At the beginning I could not understand why but then I figured out that the default strategy used in TRAVERSE is DFS that's why we can rely on taking the first node of each traversal as a representative for its connected component.

Related

Is it possible to call a DevOps Query(with Name) using analytical query?

I need to retrieve the DevOps work items dynamically by using the already existing query(only the query name will be known).
Query name will be passed dynamically and the columns available in the query should be retrieved as is.
The restriction is I need to use Analytical Query, not the Wiql query or client.
The total data retrieved will go beyond 40k(occasionally)
If it's not feasible in the analytical query, Kindly suggest other options to handle the load.
Your help will be appreciated, Thanks in Advance.

Using Aggregations in RestHeart

I am trying to use the aggregations feature in RestHeart which is described here: https://restheart.org/docs/aggregations/
I am using it to filter and group stuff in my collection based on a input variable, like this.
https://.../_aggrs/test-pipeline?avars={"country":"DE"}
As the documentation states querying the aggregation does not yield the result directly, but I have to query the newly created collection. I found out that it also works to just query the aggregation endpoint twice. But in any case I have to make two requests to get the result.
I am now worried about concurrent users. If two users are querying the aggregation at the same time (with different avars), one might get the result of the other.
I am wondering why this is not mentioned anywhere. It seems to me that everybody should have this problem when using variables (avars) in an aggregation.
How can I solve this? Might transactions be the solution? https://restheart.org/docs/transactions/
I cannot try it right now, because my mongoDB is refusing to start a transaction. But would it even work?
Are there any other solutions?
Best regards,
Tobi

How to visualise the division between the result of two aggregation in Kibana (metrics)

I'm using kibana 6.8.1-oss and I'd like to visualise the result of the division between two aggregation.
To be more specific, I have a field A and a field B.
I want to create the result of sum(A)/sum(B) in a visualisation so I can put it into a dashboard.
Do you know if it's possible ?
Thanks in advance,
After a some research, I figured that this functionality is yet not supported by Kibana.

OrientDB low performance in query with LUCENE and OR expression

I have a graph database with 1.000.000 vertex.
When I run this query:
it work well but look at this:
The OR should not affect the performance but it does.
Why?
What is happening here is that the second query is doing a full scan and matching all the records against the two conditions.
Try to execute and EXPLAIN of the queries and see the difference.
We are working hard to make it much better in v 3.0

how to get only the top 100 matching results in neo4j FT index queries

how to get only the top 100 matching results in neo4j FT index queries. I am sure for common searches the index will match thousands of nodes but i would need only say the top 100 highest scored matches. What configuration settings or query context should i set to achieve this. How is this possible in REST API without cypher. Is cypher a must to get these 100 top scored full text matches. Thanks for any help!
The simplest way would probably be using Cypher's LIMIT clause. Since you explicitly asked for non cypher solutions, the only option is to write a unmanaged extension that runs the index query and does not fully consume the iterator.