OQL to Query a List in GemFire - gemfire

I am trying to form a OQL in GemFire which would query a particular attribute within the list.
I have huge number of Employee objects in GemFire with employeeId as the key.
On querying by ID we receive the following object. We convert the object into XML for some use.
<Employee>
<employeeId>592266</employeeId>
<employeeExperienceList>
<experience>
<org>XYZ</org>
<toDate>10/1/2010</toDate>
<fromDate>2/3/2014</fromDate>
</experience>
<experience>
<org>ABC</org>
<toDate>2/15/2014</toDate>
<fromDate>3/17/2018</fromDate>
</experience>
</employeeExperienceList>
</Employee>
Now I want to develop an OQL which retrieves all the Employees who are from the Organization ABC.
How can I add this to the where clause?

Perhaps this is best explained with an example; see here. Specifically, this is the OQL query you are looking for.
You can find more on Pivotal GemFire's Query capabilities here.
Hope this helps.
Cheers!
John

Related

GridGain/ Ignite query list data type

I'm trying to figure out how to work with a list datatype in a Gridgain query, I have an object which has a field
#QuerySqlField private final List<Integer> expertGroupIds; that I can receive during selects but I can't manage to create an update query on the list, and can't find anywhere what is the correct syntax while working from the Gridgain sqlline client.
Also, what I'm finally trying to achieve is to have a select query that will find all objects where expertGroupIds has at least one element similar to a list receive as a parameter (basically I need to check if the 2 lists have any intersections)
Thanks for your help!
You can't is the short answer. There's no way to filter (a WHERE clause) or update it from SQL.
But you can if you normalise it, as you would with a traditional relational database.

How to get information of a specific Wikidata ID using SPARQL query?

I know how to find all movies in Wikidata. So, I get a list of IDs like "Q18644475". If I try to get all film info for every film in the database in one query, I get a timeout. So, I decided to get the film info in individual queries.
Is there an SPARQL query to get the title and release year(optionally all possible info) for this ID?
I find the hoops you have to jump through to use an entity ID in SPARQL to be quite nuts.
If anyone else stumbles across this question then an alternative is to download the complete entity information in JSON format.
For example:
https://www.wikidata.org/wiki/Special:EntityData/Q18644475.json

Dynamic where clause and operand SQL Server

Having read almost all topics related to dynamic where clauses, I still can't find a way through.
Here is my source table:
Source Table
And the result I want is:
Results
In fact I want to return all values satisfying the Test value condition but don't know how to implement it dynamicly (I have a table with 700K lines).
Thanks a lot for your help.
EDIT:
Following your answers, I will detailed a bit more the approach.
Unfortunately, as I'm a new user, I'm not allowed to post pictures directly in the post.
I'm basicly performing segregation of duties controls over the SAP system.
Basicly, I want to test if some of the access of a customer are conflictual based on SAP extractions against a knowledge template stating potential conflicts.
Here is an simplified example of the SAP extract:
And here is a simplified example of the Potential conflict template:
<table><tbody><tr><th>Field</th><th>Value</th></tr><tr><td>ACTVT</td><td>AZ0220</td></tr><tr><td>KOART</td><td>K</td></tr><tr><td>BUKRS</td><td>*</td></tr><tr><td>EKGRP</td><td>03</td></tr></tbody></table>
This is a faxe example of the raw data of the customer:
<table><tbody><tr><th>FIELD</th><th>RANGE_START</th><th>RANGE_END</th></tr><tr><td>ACTVT</td><td>AZ01*</td><td>AZ99*</td></tr><tr><td>KOART</td><td>A</td><td>L</td></tr><tr><td>BUKRS</td><td>011</td><td>099</td></tr><tr><td>EKGRP</td><td>2</td><td>10</td></tr></tbody></table>
I thought a way of doing this is to use dynamic where clause.
Thanks a lot for your help

Analytics API: Query for when objects are tagged?

Is it possible using the Analytics API to query for when a particular type of artifact, like a defect or test case, was tagged with a particular tag?
What would the query look like?
If the ObjectID of your Tag of interest is 12345678910, then a query similar to the following should do the trick:
"_TypeHierarchy":"TestCase",
"Tags":{$in:[12345678910]},
"_PreviousValues.Tags":{$nin:[12345678910]}

Hibernate Search: how to query for embeded entities

I like to use Hibernate Search for implementing an sophisticated autosuggestion feature across multiple input fields on a web page.
Each input field is for its own entity, let's say Country and City. There is a many-to-one relationship between both entities
(countries contain cities).
The autosuggestion should work such that when typing e.g. a country name prefix and the city field is already filled,
you get only suggestions for countries that have such a city (and vice versa).
The server side autosuggestion service should return list of projections
(entityId, entityName) which are rendered into the input field (dropdown, whatever).
According to the schema and after having read the manual I tried the following index schema:
SearchMapping mapping = new SearchMapping();
mapping.analyzerDef(...
.entity(City.class).indexed().indexName("MyIndex")
.property("cityId", ElementType.FIELD)
.documentId()
.name("id")
.property("name", ElementType.FIELD)
.documentId()
.name("id")
.property("country", ElementType.METHOD)
.indexEmbedded()
.entity(Country.class).indexed()
.property("id", ElementType.FIELD)
.documentId()
.name("id")
.property("name", ElementType.METHOD)
.field()
.name("name")
This mapping defines City to be the main entity, right?
I have indexed all cities and am able to query for them (also by combining both fields). However, I only get matches when querying for cities.
i.e. when querying like
fullTextSession.getSearchFactory().buildQueryBuilder().forEntity(City.class).get();
This is not useful for the country field becuse when I type in "Spain", I get a single row for each city of Spain. (Spain, Spain, Spain, Spain ,.... ;-))
The question is: How is it possible to search for country entities? Changing the index structure? The indexing procedure? Or how to query?
The only way I found was to setup a Facet for country, and you the different possible facets as autosuggestion. However, this is also not perfect
since it is not possible to sort facets alphabetically.
Of course, in this example, I could switch both entities in the mapping, but suppose scenarios with more complex entity graphs.
UPDATE: adding queries requested in comment
For building queries, I employ the QueryBuilder. The following produces a result set like in the Spain example:
fullTextSession.getSearchFactory().buildQueryBuilder().forEntity(City.class).get();
with query:
country.name:Spain
If I try to use a query builder for countries
fullTextSession.getSearchFactory().buildQueryBuilder().forEntity(Country.class).get();
and query:
name:Spain
I get no results.
You are not showing your actual query. You don't have to use the query DSL, but you can also write native Lucene queries. In both cases (DSL or native Lucene) you can combine queries via boolean logic. Embedded entities follow the java bean notation. The country name would for example in a city query be reached as country.name. Again, without your actual query it is hard to give any more specific feedback.
Last, but not least, facets can also be sorted alphabetically. Check FacetSortOrder.COUNT_DESC.