java.lang.Object
org.eclipse.emf.ecore.util.Switch<Boolean>
io.opencaesar.oml.util.OmlSwitch<Boolean>
com.plantoml.plantomlserver.translator.Oml2Dot

public class Oml2Dot extends io.opencaesar.oml.util.OmlSwitch<Boolean>
Converts Ontological Modeling Language (OML) elements to DOT format for graph visualization.

This class traverses OML elements and constructs a graph representation using the DOT language, suitable for rendering with Graphviz.

  • Field Summary

    Fields inherited from class io.opencaesar.oml.util.OmlSwitch

    modelPackage
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for Oml2Dot.
  • Method Summary

    Modifier and Type
    Method
    Description
    caseAspect(io.opencaesar.oml.Aspect aspect)
    Processes Aspect elements in OML.
    caseClassifier(io.opencaesar.oml.Classifier classifier)
    Processes Classifier elements in OML.
    caseConcept(io.opencaesar.oml.Concept concept)
    Processes Concept elements in OML.
    caseConceptInstance(io.opencaesar.oml.ConceptInstance instance)
    Processes ConceptInstance elements in OML.
    caseRelationEntity(io.opencaesar.oml.RelationEntity relation)
    Processes RelationEntity elements in OML.
    caseRelationInstance(io.opencaesar.oml.RelationInstance instance)
    Processes RelationInstance elements in OML.
    caseStructure(io.opencaesar.oml.Structure structure)
    Processes Structure elements in OML.
    caseStructureInstance(io.opencaesar.oml.StructureInstance instance)
    Processes StructureInstance elements in OML.
    convert(org.eclipse.emf.ecore.resource.Resource inputResource)
    Converts the contents of an EMF Resource containing OML data to a DOT format graph.
    Converts a PascalCase string to a spaced lowercase string.

    Methods inherited from class io.opencaesar.oml.util.OmlSwitch

    caseAnnotation, caseAnnotationProperty, caseArgument, caseAssertion, caseAxiom, caseBinaryPredicate, caseBooleanLiteral, caseBuiltIn, caseBuiltInPredicate, caseClassifierEquivalenceAxiom, caseDecimalLiteral, caseDescription, caseDescriptionBox, caseDescriptionBundle, caseDescriptionMember, caseDescriptionStatement, caseDifferentFromPredicate, caseDoubleLiteral, caseElement, caseEntity, caseForwardRelation, caseIdentifiedElement, caseImport, caseInstance, caseInstanceEnumerationAxiom, caseIntegerLiteral, caseKeyAxiom, caseLiteral, caseLiteralEnumerationAxiom, caseMember, caseNamedInstance, caseOntology, casePredicate, caseProperty, casePropertyCardinalityRestrictionAxiom, casePropertyEquivalenceAxiom, casePropertyPredicate, casePropertyRangeRestrictionAxiom, casePropertyRestrictionAxiom, casePropertySelfRestrictionAxiom, casePropertyValueAssertion, casePropertyValueRestrictionAxiom, caseQuotedLiteral, caseRelation, caseRelationBase, caseRelationEntityPredicate, caseReverseRelation, caseRule, caseSameAsPredicate, caseScalar, caseScalarEquivalenceAxiom, caseScalarProperty, caseSemanticProperty, caseSpecializableProperty, caseSpecializableTerm, caseSpecializationAxiom, caseStatement, caseStructuredProperty, caseTerm, caseType, caseTypeAssertion, caseTypePredicate, caseUnaryPredicate, caseUnreifiedRelation, caseVocabulary, caseVocabularyBox, caseVocabularyBundle, caseVocabularyMember, caseVocabularyStatement, defaultCase, doSwitch, isSwitchFor

    Methods inherited from class org.eclipse.emf.ecore.util.Switch

    doSwitch, doSwitch

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Oml2Dot

      public Oml2Dot()
      Constructor for Oml2Dot. Initializes internal structures for nodes and edges.
  • Method Details

    • convert

      public String convert(org.eclipse.emf.ecore.resource.Resource inputResource)
      Converts the contents of an EMF Resource containing OML data to a DOT format graph.

      This method iterates through all elements within the provided EMF Resource and builds a graph representation in DOT format.

      Parameters:
      inputResource - The EMF Resource containing OML data.
      Returns:
      A String representation of the graph in DOT format.
    • caseClassifier

      public Boolean caseClassifier(io.opencaesar.oml.Classifier classifier)
      Processes Classifier elements in OML.

      This method handles Classifier elements and establishes links with their super terms, contributing to the construction of the graph.

      Overrides:
      caseClassifier in class io.opencaesar.oml.util.OmlSwitch<Boolean>
      Parameters:
      classifier - The Classifier element to process.
      Returns:
      true if the element was processed successfully, false otherwise.
    • caseAspect

      public Boolean caseAspect(io.opencaesar.oml.Aspect aspect)
      Processes Aspect elements in OML.

      This method handles Aspect elements, creating graph nodes for them and linking them with other related elements. It calls other methods to handle specific aspects of the Aspect, such as key axioms and property restrictions.

      Overrides:
      caseAspect in class io.opencaesar.oml.util.OmlSwitch<Boolean>
      Parameters:
      aspect - The Aspect element to process.
      Returns:
      null, indicating that the parent Classifier processing should be invoked.
    • caseConcept

      public Boolean caseConcept(io.opencaesar.oml.Concept concept)
      Processes Concept elements in OML.

      This method handles Concept elements, creating graph nodes and linking them with their super terms and related aspects, as well as handling key axioms and property restrictions.

      Overrides:
      caseConcept in class io.opencaesar.oml.util.OmlSwitch<Boolean>
      Parameters:
      concept - The Concept element to process.
      Returns:
      null, indicating that the parent Classifier processing should be invoked.
    • caseStructure

      public Boolean caseStructure(io.opencaesar.oml.Structure structure)
      Processes Structure elements in OML.

      TODO: Provide implementation details once available.

      Overrides:
      caseStructure in class io.opencaesar.oml.util.OmlSwitch<Boolean>
      Parameters:
      structure - The Structure element to process.
      Returns:
      null, indicating that the parent Classifier processing should be invoked.
    • caseRelationEntity

      public Boolean caseRelationEntity(io.opencaesar.oml.RelationEntity relation)
      Processes RelationEntity elements in OML.

      This method deals with RelationEntity elements, linking source and target entities and setting appropriate labels for edges in the graph.

      Overrides:
      caseRelationEntity in class io.opencaesar.oml.util.OmlSwitch<Boolean>
      Parameters:
      relation - The RelationEntity element to process.
      Returns:
      true if the element was processed successfully, false otherwise.
    • caseConceptInstance

      public Boolean caseConceptInstance(io.opencaesar.oml.ConceptInstance instance)
      Processes ConceptInstance elements in OML.

      Creates graph nodes for each ConceptInstance and handles property value assertions.

      Overrides:
      caseConceptInstance in class io.opencaesar.oml.util.OmlSwitch<Boolean>
      Parameters:
      instance - The ConceptInstance element to process.
      Returns:
      true if the element was processed successfully, false otherwise.
    • caseRelationInstance

      public Boolean caseRelationInstance(io.opencaesar.oml.RelationInstance instance)
      Processes RelationInstance elements in OML.

      This method generates nodes and edges for RelationInstance elements, linking them with their source and target NamedInstances.

      Overrides:
      caseRelationInstance in class io.opencaesar.oml.util.OmlSwitch<Boolean>
      Parameters:
      instance - The RelationInstance element to process.
      Returns:
      true if the element was processed successfully, false otherwise.
    • caseStructureInstance

      public Boolean caseStructureInstance(io.opencaesar.oml.StructureInstance instance)
      Processes StructureInstance elements in OML.

      TODO: Provide implementation details once available.

      Overrides:
      caseStructureInstance in class io.opencaesar.oml.util.OmlSwitch<Boolean>
      Parameters:
      instance - The StructureInstance element to process.
      Returns:
      null, indicating that the parent Classifier processing should be invoked.
    • pascalCaseToSpaced

      public String pascalCaseToSpaced(String str)
      Converts a PascalCase string to a spaced lowercase string.

      This method is useful for converting class or type names following the PascalCase convention into a more readable spaced lowercase format. It inserts a space before each uppercase letter and converts the entire string to lowercase.

      Parameters:
      str - The PascalCase string to be converted.
      Returns:
      The spaced lowercase string.