-
Notifications
You must be signed in to change notification settings - Fork 103
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
Generate diagrams for the application #17
Comments
Brilliant. I'll give it a go. We'll be getting rid of the serd dependency as soon as we can. Hopefully within the next month. |
Forgot a step. After the queries, exit Prolog and type:
If you used the pack to load Logtalk, you will likely need to dig the path to the |
With my recent work on GitHub actions and workflows for Logtalk and Prolog repos, if you enable actions tab in this repo settings, I'm happy to submit a PR with a workflow that will (re)generate and publish the diagrams automatically on push events. |
@pmoura We got rid of the serd and hdt dependency in the dev branch, so might be easier for you to work with now. |
Great! But the required |
Can you create a |
Meanwhile I have upload the diagrams for the https://logtalk.org/files/terminus-server-diagrams/ There are two sets of diagrams:
All diagrams are linked to the source code. The zoom icon allows looking into a sub-diagram with details (e.g. going from directory to its files or from a module interface to its xref details). Most nodes and edges have live links to the directory, files, and file lines in the GitHub repos. Some entry points are:
The diagrams were generated using the query: logtalk_load(diagrams(loader),
working_directory(TerminusStore,TerminusStore), getenv('HOME', Home), file_search_path(swi, SWIHome),
atom_concat(SWIHome, '/library', Library),
atom_concat(SWIHome, '/library/http', SWIhttp),
atom_concat(SWIHome, '/library/pldoc', SWIpldoc),
atom_concat(SWIHome, '/library/semweb', SWIsemweb),
git_hash(Hash, []),
atomic_list_concat(['https://github.com/terminusdb/terminus-server/tree/',Hash,'/'], Git),
diagrams::rdirectory(terminus_server, '.', [
title('terminus-server - open source model driven graph database for knowledge graph representation'),
zoom(true),
path_url_prefixes(TerminusStore, Git, ''),
path_url_prefixes(SWIhttp, 'https://github.com/SWI-Prolog/packages-http/tree/master/', ''),
path_url_prefixes(SWIpldoc, 'https://github.com/SWI-Prolog/packages-pldoc/tree/master/', ''),
path_url_prefixes(SWIsemweb, 'https://github.com/SWI-Prolog/packages-semweb/tree/master/', ''),
path_url_prefixes(Library, 'https://github.com/SWI-Prolog/swipl-devel/tree/master/library/', ''),
omit_path_prefixes([TerminusStore, SWIhttp, SWIpldoc, SWIsemweb, Library, Home]),
directory_paths(true),
exclude_directories([examples, storage, 'terminus-schema', 'terminus-server-diagrams', tmp, utils]),
layout(top_to_bottom)
]). The query is run after loading a modified
|
@pmoura Thanks a lot for the nice diagrams, they look great! I especially like the xref diagram as a quick way of showing people the current architecture. |
As you noticed, the nodes and edges URLs link to exact locations in the source code at GitHub. That works by linking to a specific commit (as you can see in the query above that generates the diagrams). As a consequence, the locations will become invalid as new commits are pushed. But it's easy to define an automatic workflow that updates the diagrams everytime a commit is pushed (e.g. to the |
Closing due to age of issue. |
I cannot do this myself yet as I'm still missing the correct version of the
serd
dependency on my macOS laptop. But you may have fun generating diagrams for the application.First, start Logtalk using either the
swilgt
script or the pack:Then, load the application and try the next queries:
The last query assumes that
[start]
loads all the application files. If that's not the case, load any missing files first.The text was updated successfully, but these errors were encountered: