relaton / relaton-models

Bibliographic models
4 stars 2 forks source link

Convert models to LutaML-UML format #30

Closed ronaldtse closed 3 years ago

ronaldtse commented 3 years ago

We need to convert all models to the LutaML-UML format.

Install via: gem install lutaml

The syntax is described here: https://github.com/lutaml/lutaml-uml/blob/master/LUTAML.adoc

And there is a migration command from PlantUML WSD to LutaML, lutaml-wsd2uml [file]

andrew2net commented 3 years ago

@ronaldtse I've bumped to an issue. Lutaml raises an error because of sybol /. Do you have any suggestion how to address it?

  enum StringFormat {
      text/plain
      text/html
      application/docbook+xml
      application/tei+xml
      text/x-asciidoc
      text/markdown
      application/x-isodoc+xml
  }
lutaml -t png -o ./images/ models/RelBib_DocumentRelation.lutaml
/Users/andrej/.rvm/gems/ruby-2.4.0/gems/parslet-1.7.1/lib/parslet/cause.rb:70:in `raise': Failed to match sequence (WHITESPACE? DIAGRAM_DEFINITION) at line 1 char 1. (Parslet::ParseFailed)
        from /Users/andrej/.rvm/gems/ruby-2.4.0/gems/parslet-1.7.1/lib/parslet/atoms/base.rb:49:in `parse'
...
ronaldtse commented 3 years ago

Could you try double quotes?

Ping @w00lf , is this supported in lutaml-uml?

w00lf commented 3 years ago

Could you try double quotes?

Ping @w00lf , is this supported in lutaml-uml?

Yes, its supported but in this case we don't support / char at all, I will create a hotfix

ronaldtse commented 3 years ago

Thank you @w00lf!

w00lf commented 3 years ago

@andrew2net @ronaldtse added support for slash chars, released the new lutaml-uml version - 0.2.10

andrew2net commented 3 years ago

thank you @w00lf, now if there is a symbol "+" in value then it's rendered in a new line:

image
andrew2net commented 3 years ago

@ronaldtse, @w00lf it seems multiple types not allowed. This class raises an error:

  class DocumentRelation {
      +type: DocumentRelationType
      +description: FormattedString[0..*]
      +bibitem: BibliographicItem
      +bibLocality: BibItemLocality[0..*] | LocalityStack[0..*]
      +bibSourceLocality: BibItemLocality[0..*]  | LocalityStack[0..*]
  }
w00lf commented 3 years ago

thank you @w00lf, now if there is a symbol "+" in value then it's rendered in a new line:

image

@andrew2net can you supply the original lutaml code for debuging?

w00lf commented 3 years ago

@ronaldtse, @w00lf it seems multiple types not allowed. This class raises an error:

  class DocumentRelation {
      +type: DocumentRelationType
      +description: FormattedString[0..*]
      +bibitem: BibliographicItem
      +bibLocality: BibItemLocality[0..*] | LocalityStack[0..*]
      +bibSourceLocality: BibItemLocality[0..*]  | LocalityStack[0..*]
  }

Multiple types don't supported yet

andrew2net commented 3 years ago

@andrew2net can you supply the original lutaml code for debuging?

@w00lf

enum StringFormat {
      text/plain
      text/html
      application/docbook+xml
      application/tei+xml
      text/x-asciidoc
      text/markdown
      application/x-isodoc+xml
  }
andrew2net commented 3 years ago

we wait for the multitype implementation https://github.com/lutaml/lutaml-uml/issues/79

w00lf commented 3 years ago

@andrew2net can you supply the original lutaml code for debuging?

@w00lf

enum StringFormat {
      text/plain
      text/html
      application/docbook+xml
      application/tei+xml
      text/x-asciidoc
      text/markdown
      application/x-isodoc+xml
  }

Fixed in https://github.com/lutaml/lutaml-uml/pull/81

ronaldtse commented 3 years ago

I've already converted all the files, all working now.