cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Duplicate header entries while importing a C# AST into Neo4j

Hi all!

I have been using Neo4j to try to import the structure of a C# Abstract Syntax Tree (AST) generated by Microsoft Roslyn so I can query the program structure using Cypher.

My approach is to visit all the SyntaxNodes and add them to multiple CSV files based on the type of the node and only include the primitive types as node properties. All underlying complex types will be added as nodes with their own node types as well and I create a relationship between them to keep the AST structure intact.

The issue is (I think) that due to the inheritance structure of the AST, I will end up with nodes with the same properties but with different relationships. While importing the csv files with the admin-import tool (62 csv header files and 62 csv data files) I get the following error:

unexpected error: Duplicate header entries found, first false:string, other (and conflicting) false:string

CSV headers examples:
Microsoft.CodeAnalysis.CSharp.Syntax.AccessorDeclarationSyntax-header.csv
:ID,Language:string,RawKind:int,SpanStart:int,IsMissing:boolean,IsStructuredTrivia:boolean,HasStructuredTrivia:boolean,ContainsSkippedText:boolean,ContainsDirectives:boolean,ContainsDiagnostics:boolean,HasLeadingTrivia:boolean,HasTrailingTrivia:boolean,ContainsAnnotations:boolean,:LABEL

Microsoft.CodeAnalysis.CSharp.Syntax.AccessorListSyntax-header.csv
:ID,Language:string,RawKind:int,SpanStart:int,IsMissing:boolean,IsStructuredTrivia:boolean,HasStructuredTrivia:boolean,ContainsSkippedText:boolean,ContainsDirectives:boolean,ContainsDiagnostics:boolean,HasLeadingTrivia:boolean,HasTrailingTrivia:boolean,ContainsAnnotations:boolean,:LABEL

Using code i have verified that no csv header file exists which includes the same property name more than once.

Of course I could add a "bogus" property to the node types to make them identical but this would compromise the data integrity. I was wondering if someone knows of a way to solve this issue without compromising the data integrity.

I'm using Neo4j version 3.5.7 on OSX with the admin-import tool. The file import.report as well as the log files are empty.

Thanks in advance!

0 REPLIES 0