Closed ghost closed 6 years ago
Hi Davi, I am currently on an engagement out of town. I will be back next week and will then have a look into your problem.
Best regards, Wolfgang
Hi Davi, as far as I can see, you are handling partial query expressions as if they would immediately provide the results of performing such a query. You have to write a complete query using the JCypher Query DSL and then perform it against an instance of IDomainAccess. You can then iterate over the provided results. If you explain what you want to achieve with your query, I can provide an example. In addition to the project documentation a good source of knowledge about how JCypher works are the samples project as well as the JUnit tests, which are accessible if you clone the project from the Git repository.
Best regards, Wolfgang
Wolfgang,
I'm wrapping a List
The exception happens when i call the IDBAcess.execute(JcQuery)
or the Util.toCypher(JcQuery, Format)
.
It started after some code changes and Groovy + JCypher version update, but a git revert doesn't fixed it. It doesn't happen when i got only one property to compare, in a query like this:
MATCH (c:Classe:Substancial:Conceito:Entidade) WHERE c.classeFinal = 'Modelo.Conceitos.Proporcao' RETURN c
By the StackTrace, i think it may be a groovy compilation problem with the APIObjectAccess.getAstNode((APIObject) clause)
or the Concatenator ret = new Concatenator((PredicateExpression)this.astNode);
inside the Concat.holdsTrue(IPredicateFunction I)
method
Thank you a lot! Davi
Wolfgang.
It was really a groovy compilation problem. the method 'ONDE' was in a groovy 'Category', so i moved it to inside the loops:
`Concatenator concat
props.findAll { it.value != null }.each { String chave, Object valor ->
if (concat == null) concat = valueOf(origem.property(chave)).EQUALS(valor)
else concat = concat.AND().valueOf(origem.property(chave)).EQUALS(valor)
}
if (concat) pesquisa << concat`
and now its working.
Thanks a lot for answering and sorry for the trouble. Davi.
Hi Wolfgang.
Sorry to return here, but I tried everything that I could.
I'm using the DSL query to compare my object properties, and i'm getting a NullPointerException at iot.jcypher.query.ast.predicate.PredicateFunction.getType()
Here's the groovy code that i'm using to feed a Concatenator inside a loop:
And here is where it's used:
the StackTrace:
java.lang.NullPointerException at iot.jcypher.query.ast.predicate.PredicateFunction.getType(PredicateFunction.java:28) at iot.jcypher.query.writer.CypherWriter$CollectionCypherWriter.toCypherExpression(CypherWriter.java:462) at iot.jcypher.query.writer.CypherWriter$CollectionCypherWriter.access$1400(CypherWriter.java:452) at iot.jcypher.query.writer.CypherWriter$PredicateCypherWriter.toCypherExpression(CypherWriter.java:654) at iot.jcypher.query.writer.CypherWriter$PredicateCypherWriter.toCypherExpression(CypherWriter.java:638) at iot.jcypher.query.writer.CypherWriter$PredicateCypherWriter.toCypherExpression(CypherWriter.java:628) at iot.jcypher.query.writer.CypherWriter$PredicateCypherWriter.access$500(CypherWriter.java:620) at iot.jcypher.query.writer.CypherWriter.toCypherExpression(CypherWriter.java:247) at iot.jcypher.query.writer.CypherWriter.toCypherExpression(CypherWriter.java:139) at iot.jcypher.query.writer.CypherWriter.toCypherExpression(CypherWriter.java:132) at iot.jcypher.query.writer.CypherWriter.toCypherExpression(CypherWriter.java:126)
I'm using the 3.9.0 version. Thanks in advance, your library is one of the pillars of my college project.