Skip to content

Node attribute problem #2669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rstyro opened this issue Feb 14, 2023 · 1 comment
Closed

Node attribute problem #2669

rstyro opened this issue Feb 14, 2023 · 1 comment
Assignees
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@rstyro
Copy link

rstyro commented Feb 14, 2023

Hello, boss, I have a question to ask

Node class

@Node("Article")
public class ArticleNode {
    @Id
    @GeneratedValue
    private Long id;

    @Property("aid")
    private String aid;

    // 文献ID
    @Property("ti")
    private String ti;
// ...
}
@Repository
public interface IArticleRepository extends Neo4jRepository<ArticleNode,Long> {
}

demo test

@Test
    void contextLoads() {
        Optional<ArticleNode> byId = articleRepository.findById(8687226l);
        System.out.println(byId.orElse(null));
    }

// Result printing

17:15:06.347 [main] WARN  o.s.d.neo4j.cypher - [warn,157] - Neo.ClientNotification.Statement.UnknownPropertyKeyWarning: The provided property key is not in the database
	MATCH (articleNode:`Article`) WHERE id(articleNode) = $__id__ RETURN articleNode{.aid, .dp, .id, .ti, __nodeLabels__: labels(articleNode), __internalNeo4jId__: id(articleNode), Article_au_art_Author: [(articleNode)<-[Article__relationship__Author:`au_art`]-(articleNode_auRelList:`Author`) | articleNode_auRelList{.auid, .citedNum, .hIndex, .id, .orcid, .username, __nodeLabels__: labels(articleNode_auRelList), __internalNeo4jId__: id(articleNode_auRelList), Article__relationship__Author}]}
	                                                                                             ^
One of the property names in your query is not available in the database, make sure you didn't misspell it or that the label is available when you run this statement in your application (the missing property name is: id)
17:15:06.347 [main] WARN  o.s.d.neo4j.cypher - [warn,157] - Neo.ClientNotification.Statement.UnknownPropertyKeyWarning: The provided property key is not in the database
	MATCH (articleNode:`Article`) WHERE id(articleNode) = $__id__ RETURN articleNode{.aid, .dp, .id, .ti, __nodeLabels__: labels(articleNode), __internalNeo4jId__: id(articleNode), Article_au_art_Author: [(articleNode)<-[Article__relationship__Author:`au_art`]-(articleNode_auRelList:`Author`) | articleNode_auRelList{.auid, .citedNum, .hIndex, .id, .orcid, .username, __nodeLabels__: labels(articleNode_auRelList), __internalNeo4jId__: id(articleNode_auRelList), Article__relationship__Author}]}
	                                                                                                                                                                                                                                                                                                                                                      ^
One of the property names in your query is not available in the database, make sure you didn't misspell it or that the label is available when you run this statement in your application (the missing property name is: id)

What's wrong with this warning message? How to hide it

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 14, 2023
@meistermeier meistermeier self-assigned this Feb 14, 2023
@meistermeier
Copy link
Collaborator

There is nothing wrong with the warning messages.
Spring Data Neo4j creates generic queries to fetch all possible relationships and properties. Those might not yet exist in the database. Neo4j 5+ returns this notification and it gets passed through the driver to SDN.
To avoid this kind of warnings, you can configure your logger like I have written here: #2660 (comment)

On the other hand, I will have a closer look into the scenario you describe. There is an internal id defined but SDN queries for the (non-existing) id property. This seems unnecessary.

meistermeier added a commit that referenced this issue Feb 14, 2023
This is unnecessary because the property itself won't exist in this case,
but only id(node).
More visible now because Neo4j 5+ logs unknown property querying.

Closes #2669
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants