Skip to content
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

tweaking rdfpuml/plantuml layout and appearance #31

Open
VladimirAlexiev opened this issue Mar 29, 2024 · 4 comments
Open

tweaking rdfpuml/plantuml layout and appearance #31

VladimirAlexiev opened this issue Mar 29, 2024 · 4 comments

Comments

@VladimirAlexiev
Copy link
Collaborator

graphs tend to grow large and need tweaking. Some alternatives could be added for the tool. I need to get some examples out to show what I mean. Coming up.

rdfpuml can already tweak arrow direction, length and appearance; and node stereotypes.
Eg here's an example from a Crunchbase model.
I keep it in a separate puml.ttl that I concat to the real model.

####################

# superclass and class hierarchy (lattice)
<agent/(uuid)> a cb:Agent.
<agent/(person_uuid)>       puml:up-tri-dashed <agent/(uuid)>.
<agent/(organization_uuid)> puml:up-tri-dashed <agent/(uuid)>.
<agent/(investor_uuid)>     puml:up-tri-dashed <agent/(person_uuid)>.
<agent/(investor_uuid)>     puml:up-tri-dashed <agent/(organization_uuid)>.

# Colored circles: agent=red, relation=pink, financial=yellow, static=lightgreen
cb:Acquisition     puml:stereotype "(A,yellow)".
cb:Agent           puml:stereotype "(A,red) abstract superclass".
cb:Degree          puml:stereotype "(D,pink)".
cb:Event           puml:stereotype "(E,lightgreen)".
cb:EventAppearance puml:stereotype "(A,pink)".
cb:Fund            puml:stereotype "(F,red)".
cb:FundingRound    puml:stereotype "(F,yellow)".
cb:IPO             puml:stereotype "(I,yellow)".
cb:Investment      puml:stereotype "(I,yellow)".
cb:Investor        puml:stereotype "(I,red)".
cb:Job             puml:stereotype "(J,pink)".
cb:Organization    puml:stereotype "(O,red)".
cb:Person          puml:stereotype "(P,red)".
skos:Concept       puml:stereotype "(C,lightgreen)".

# Relation directions
cb:acquiree                puml:arrow puml:up.
cb:acquirer                puml:arrow puml:up.
cb:entity                  puml:arrow puml:up.
cb:event                   puml:arrow puml:up.
cb:featuredJobOrganization puml:arrow puml:up.
cb:institution             puml:arrow puml:up.
cb:investor                puml:arrow puml:up.
cb:participant             puml:arrow puml:up.
cb:partner                 puml:arrow puml:up.

# All links to Org and Person should be `up` except Job which uses `left/right` (nested between them)
#cb:organization            puml:arrow puml:up.
#cb:person                  puml:arrow puml:up.
cb:featuredJobOrganization puml:arrow puml:left.
<job/(uuid)>                         puml:right <agent/(person_uuid)>; puml:left <agent/(org_uuid)>.
<degree/(uuid)>                      puml:up    <agent/(person_uuid)>.
<funding_round/(funding_round_uuid)> puml:up    <agent/(org_uuid)>.
<ipo/(uuid)>                         puml:up    <agent/(org_uuid)>.

# Inlined external URLs
cb:cbUrl            a puml:InlineProperty.
cb:eventUrl         a puml:InlineProperty.
cb:facebookUrl      a puml:InlineProperty.
cb:homepageUrl      a puml:InlineProperty.
cb:linkedinUrl      a puml:InlineProperty.
cb:logoUrl          a puml:InlineProperty.
cb:registrationUrl  a puml:InlineProperty.
cb:twitterUrl       a puml:InlineProperty.

# Inlined thesaurus values. Alternative: display them as skos:Concepts
cb:acquisitionType  a puml:InlineProperty.
cb:appearanceType   a puml:InlineProperty.
cb:cbIndustry       a puml:InlineProperty.
cb:degreeType       a puml:InlineProperty.
cb:employeeCount    a puml:InlineProperty.
cb:eventRole        a puml:InlineProperty.
cb:gender           a puml:InlineProperty.
cb:investmentType   a puml:InlineProperty.
cb:investorType     a puml:InlineProperty.
cb:jobType          a puml:InlineProperty.
cb:organizationRole a puml:InlineProperty.
cb:primaryRole      a puml:InlineProperty.
cb:status           a puml:InlineProperty.
#skos:broader        a puml:InlineProperty.
skos:inScheme       a puml:InlineProperty.
@VladimirAlexiev VladimirAlexiev changed the title tweaking plantuml layout tweaking rdfpuml/plantuml layout and appearance Mar 29, 2024
@johanwk
Copy link
Owner

johanwk commented Mar 29, 2024

I have sometimes found a need to add very specific commands to the output of rdfpuml, and did this with a hack: arguments "addtext" and "addtextend" to the org-babel block rdfpumlblock. I need to look for some examples, otherwise I guess this will not make a lot of sense .. this is just to mention that there may be a need in some cases to add explicit plantuml statements.

@VladimirAlexiev
Copy link
Collaborator Author

  • If you needed to add to .puml then I'm very interested to learn what tweaks you needed, so I can add them as rdfpuml features
  • Can you do this with headers :prologue and I guess :epilogue as shown in plantuml installation/invocation #6 (comment) ?
  • For adding rdfpuml instructions (triples in the puml: namespace), when these need to be shared between code blocks (models), I've been putting them in prefixes.ttl or a separate puml.ttl that is prepended.

@johanwk
Copy link
Owner

johanwk commented Apr 9, 2024

I'll be more than happy to give the details of the hacks I needed to get IDO diagrams right!

Maybe the most important is to not inline some cases of rdf:type, for cases where I want to draw attention to "this individual is a member of this class and that class".

:prologue and :epiloguearen't suitable for these cases, since (as I've found) the hacks require addition to the puml code, which is only available after rdfpuml has done its job, and I don't usually want to have puml blocks in the document.

If we have time tomorrow, we can look at the rdfpuml-block code block in elot-lob, which I think will make it easy to see what I've been up to. I have parameters for adding to the start of the puml code, and at the end (iirc, adding to the end is for overriding defaults).

For rdfpuml configuration, there's an org-babel block rdfpuml-config in elot-lob where the settings for coloured circles, etc. is written. There's some variant configs as well.

@VladimirAlexiev
Copy link
Collaborator Author

Ok @johanwk , that's VladimirAlexiev/rdf2rml#14 and I'll try to do it in the next few days.
Fixing it in the puml is way too hard (or as we say "dentistry through the ass": no wonder Bulgarians used it be called Vulgars in historic times :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants