Importing Xref output into Neo4j?

First, I’d like to thank the Erlang support folks for their work in developing and supporting Xref. I have only a limited understanding of the tool so far, but it’s clear that a great deal of thought and effort has gone into it.

By way of background, I’m a big fan of mechanized documentation. I’ve done a few projects in this area, using languages such as Perl and Ruby. These days, I use Ruby for small scripts and Elixir for larger projects. Although I’m learning a bit of Erlang, I’m by no means expert at it, so please forgive (and try to correct) any misapprehensions revealed below.

Notion

I think it might be useful to have an alternative user interface to Xref. Although the current (programmatic) interfaces seem well suited to expert use, other interfaces might provide simpler and more accessible ways to use the harvested information.

As many folks here may be aware, Neo4j (https://neo4j.com) is a popular, open source, graph database. It runs on the JVM and has both cloud-based and locally-installable versions So, I’d like to try importing Xref (and other) data into Neo4j and playing with the resulting database.

Questions

API

I’m confused about the nature of the Xref server(s) and how my code should interact with them. Is each Xref server a lightweight process (so I should use messages) or should I be using only the built-in function calls? Can anyone point me to examples and/or tutorials?

Documentation

I’ve found several documents on Xref and related tools. Can anyone suggest others I should peruse?

Dynamic Data

How much support is there for gathering dynamic data? For example, it might be useful to track message-based relationships between processes.

Language Support

How well does Xref support BEAM languages other than Erlang?

Specifically, are there any limitations and/or problems with using it for Elixir or LFE? (For example, is there any support for tracking macro definition and/or usage?)

Line Numbers

I don’t see any indication that Xref tracks line numbers in the source code. Am I missing something?

1 Like

Welcome to the forum!

You should only use the documented function calls.

One example I think of is the test suites for Erlang/OTP, for example otp_SUITE.erl.

There is no support for tracking macros.

No.

1 Like