Hi,
Two filters within one query:
I have initialised a pattern for a query using GraphPattern, that looks something like this:
GraphPattern query3 = letter.isA(lsl.iri("letter")).
andHas(lsl.iri("field"), otherFieldStore).
[...]
filter(Expressions.and(endDateGreaterThan, startDateLessThan)).
filter(Expressions.equals(otherRent, rent));
This simply does not include the date filter and skips straight to the rent filter.
What I am trying to achieve is two separate filters like this:
FILTER(?endDate < NOW() && ?startDate < NOW()) .
FILTER(?otherRent = ?rent) . \
How can I achieve this?
Nested Queries:
I have initialised a number of patterns (similar to above) using GraphPattern, as I would like to write a nested query.
I have tried to do so like this:
SelectQuery combinedQuery = Queries.SELECT(field, lessCount, equalCount).where().
select(countOtherLetter.as(equalCount), field).
where(query3).groupBy(field);
which gives me the following: SELECT ?fields ?lessCount ?equalCount ( COUNT( ?otherLetter ) AS ?equalCount ) ?field
WHERE { ?otherLetter a :Letter
[...]
}
But what I am trying to achieve is this:
SELECT ?field ?lessCount ?equalCount WHERE {
{
SELECT (COUNT(?otherLetter) AS ?equalCount) ?field WHERE
[...]
}
}
How can I achieve this? I've viewed all of the above using a logger in my java code. Any help would be appreciated! :)
Vaishali