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

rdfpuml: don't mangle (...) to [...] #21

Closed
VladimirAlexiev opened this issue May 5, 2023 · 0 comments
Closed

rdfpuml: don't mangle (...) to [...] #21

VladimirAlexiev opened this issue May 5, 2023 · 0 comments

Comments

@VladimirAlexiev
Copy link
Owner

Take a simple model with field names embedded in URL and attribute;

<person/(id)> a s:Person;
  s:additionalType <type/(type)>;
  s:name "(name)".

<type/(type)> a puml:InlineProperty.

rdfpuml mangles (...) to [...] to avoid parasitic compartments (horizontal lines),
since PlantUML assumes a field name with parens to be a method and moves it in a compartment above attributes:

The system checks for parenthesis to choose between methods and fields.

@startuml
hide empty members
hide circle
skinparam classAttributeIconSize 0
class _person_id_ as "<person/(id)>"
_person_id_ : a s:Person
_person_id_ : s:additionalType <type/[type]>
_person_id_ : s:name "[name]"
@enduml

Which results in this (notice the square brackets):

image


We can use this new feature from plantuml/plantuml#536 (comment):

You can use {field} and {method} modifiers to override default behaviour of the parser about fields and methods.

@startuml
hide empty members
hide circle
skinparam classAttributeIconSize 0
class _person_id_ as "<person/(id)>"
_person_id_ : {field} a s:Person
_person_id_ : {field} s:additionalType <type/(type)>
_person_id_ : {field} s:name "(name)"
@enduml

Which results in this (notice the parens):
image

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

1 participant