mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
68.98k stars 6.11k forks source link

`classDiagram` doesn't allow colons in class names #1635

Closed init-dcat-ap-de closed 1 year ago

init-dcat-ap-de commented 3 years ago

I'm trying to use mermaid for creating an class diagram in a semantic web context. There, colons are needed for prefixes:

classDiagram
    class dcat:Dataset {
        <<mandatory>>
    }

Also an issue for @persidskiy , see https://github.com/mermaid-js/mermaid/issues/1266#issuecomment-643793801

mmngreco commented 3 years ago

@init-dcat-ap-de and @persidskiy, Did you find any workaround for this ?

init-dcat-ap-de commented 3 years ago

@mmngreco Unfortunately yes: Switching to PlantUML.

jgreywolf commented 3 years ago

I will focus on this issue and see if I can make it work

jgreywolf commented 3 years ago

@mmngreco This issue should be resolved after #1877 PR has been merged...

aharth commented 2 years ago

Would be nice to be able to use colons in relationship labels too.

Backticks on relationship labels do not seem to work on mermaid.live.

I would like to use the CURIE rdf:type (instead of type):

classDiagram
  `rdfs:Resource` --> `rdfs:Class`:type
jgreywolf commented 1 year ago

@aharth the code that you provided works in mermaid live as of 03/17/2023 - I am not sure when this changed, but it is possible to use : in names for classes as well as relationships

aharth commented 1 year ago

@jgreywolf, do you have an example for using : in relationships?

The following does not work for me on mermaid live:

classDiagram
  `rdfs:Resource` --> `rdfs:Class`:`rdf:type`
jgreywolf commented 1 year ago

Do you mean like this? Live Editor

aharth commented 1 year ago

I would need colons also in the labels of the edges.

E.g., Con:tains.

aharth commented 1 year ago

So the issue is actually not resolved.

mProjectsCode commented 12 months ago

I am facing the same issue. It would be nice if we were able to define strings delimited by '`' for labels too. This would allow the usage of : in the label.