Extract network graph as a ftm file from Aleph?

Hi all! Thanks for adding me to the discourse. I’m backing up some investigations and would like to store once ingested material locally. I already figured out, how to export entities from Aleph to a json file via alephclient.

However, is it possible to extract a network graph as a .ftm file - through alephclient or other means?

Thanks so much for looking into this.

Best, Marvin

Hi Marvin,

this alephclient command should allow you to write a list of entities in a given network graph to a JSON file:

alephclient entitysetitems --outfile entities.json <entityset_id>

You can extract the entity set ID from the network diagram’s URL. For example, in the URL https://aleph.occrp.org/diagrams/123abc, the entity set ID would be 123abc.

Note that this will give you only a list of the entities in the diagram, but it doesn’t include information about the layout (positions, colors, …). If you need that as well, you might want to take a look at the Aleph API, but unfortunately it’s not straight forward to get it as a single file.

Hope this helps!
Till

Thank you, Till, for the swift response! That’s really kind! - The alephclient command helped already, great idea!

Links between entities are set via souceID and `targetID’, I assume?

I mean, having the networks as a single file, would be great, but where to start with Aleph API?

Hey, so in the output of the alephclient command, the links between entities will be implicit. Consider this example diagram:

When you run alephclient entitysetitems …, you will end up with a JSON file that contains three entities:

{ "id": "1", "schema": "Person", "properties": { "name": ["John Doe"] } }
{ "id": "2", "schema": "Company": "properties": { "name": ["ACME Inc."] } }
{ "id": "3", "schema": "Directorship": "properties": { "director": ["1"], "organization": ["2"] }

(I left some parts of the JSON output that aren’t relevant.)

The link is the third Directorship entity – links are just entities and the source and target of the link are determined by the values of its properties.

In case of the Aleph API: Yes, sourceId and targetId (in layout.edges) refer to the source/target entities of an edge.

If you can, mabye share a little bit about what you’re trying to achieve. That would be helpful to suggest an approach for solving your problem. Do you just want to make a copy of your network diagrams? Do you want to migrate them to a different Aleph instance? Or do you want to import your diagrams to a different software?

1 Like

Thanks for planning this out for me! Coming from a less hardcore coding background my idea was simple:

I figured that there is a .ftm file ingest built in Aleph, that works really great. So I figured, exporting some of the network graphs as a ftm file for back up purposes, maybe moving them or distributing them to none-aleph users, e.g. via Aleph Data Desktop (I know it’s deprecated, but for some cases it still works fine).