Class Oml2Dot
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 -
Method Summary
Modifier and TypeMethodDescriptioncaseAspect(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.pascalCaseToSpaced(String str) 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, isSwitchForMethods inherited from class org.eclipse.emf.ecore.util.Switch
doSwitch, doSwitch
-
Constructor Details
-
Oml2Dot
public Oml2Dot()Constructor for Oml2Dot. Initializes internal structures for nodes and edges.
-
-
Method Details
-
convert
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
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:
caseClassifierin classio.opencaesar.oml.util.OmlSwitch<Boolean>- Parameters:
classifier- The Classifier element to process.- Returns:
- true if the element was processed successfully, false otherwise.
-
caseAspect
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:
caseAspectin classio.opencaesar.oml.util.OmlSwitch<Boolean>- Parameters:
aspect- The Aspect element to process.- Returns:
- null, indicating that the parent Classifier processing should be invoked.
-
caseConcept
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:
caseConceptin classio.opencaesar.oml.util.OmlSwitch<Boolean>- Parameters:
concept- The Concept element to process.- Returns:
- null, indicating that the parent Classifier processing should be invoked.
-
caseStructure
Processes Structure elements in OML.TODO: Provide implementation details once available.
- Overrides:
caseStructurein classio.opencaesar.oml.util.OmlSwitch<Boolean>- Parameters:
structure- The Structure element to process.- Returns:
- null, indicating that the parent Classifier processing should be invoked.
-
caseRelationEntity
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:
caseRelationEntityin classio.opencaesar.oml.util.OmlSwitch<Boolean>- Parameters:
relation- The RelationEntity element to process.- Returns:
- true if the element was processed successfully, false otherwise.
-
caseConceptInstance
Processes ConceptInstance elements in OML.Creates graph nodes for each ConceptInstance and handles property value assertions.
- Overrides:
caseConceptInstancein classio.opencaesar.oml.util.OmlSwitch<Boolean>- Parameters:
instance- The ConceptInstance element to process.- Returns:
- true if the element was processed successfully, false otherwise.
-
caseRelationInstance
Processes RelationInstance elements in OML.This method generates nodes and edges for RelationInstance elements, linking them with their source and target NamedInstances.
- Overrides:
caseRelationInstancein classio.opencaesar.oml.util.OmlSwitch<Boolean>- Parameters:
instance- The RelationInstance element to process.- Returns:
- true if the element was processed successfully, false otherwise.
-
caseStructureInstance
Processes StructureInstance elements in OML.TODO: Provide implementation details once available.
- Overrides:
caseStructureInstancein classio.opencaesar.oml.util.OmlSwitch<Boolean>- Parameters:
instance- The StructureInstance element to process.- Returns:
- null, indicating that the parent Classifier processing should be invoked.
-
pascalCaseToSpaced
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.
-