Commit 9dc4f00b authored by Damien Garaud's avatar Damien Garaud
Browse files

Take into account of inheritance relations in schema2dot (closes #88599).

parent 7227371af9a9
ChangeLog for yams
* generic metadata attributes handling (#83813)
* fix debian packaging to be installable with python = 2.7 (#83759)
* take into account of inheritance relations in schema2dot (#88599)
* RichString is now a function
* final types are now explicitly created to please pylint
2011-11-03 -- 0.34.0
* fixed yams-view script
......@@ -124,6 +124,11 @@ class FullSchemaVisitor(SchemaVisitor):
yield eschema.type, eschema
def edges(self):
# Entities with inheritance relations.
for eschema in self._eindex.values():
if eschema.specializes():
yield str(eschema), str(eschema.specializes()), None
# Subject/object relations.
for rschema in self.schema.relations():
if not self.should_display_schema(rschema):
......@@ -157,6 +162,14 @@ class OneHopESchemaVisitor(SchemaVisitor):
if not self.display_rel(rschema, teschema.type, eschema.type):
edges.add((teschema.type, eschema.type, rschema))
# Inheritance relations.
if eschema.specializes():
nodes.add((eschema.specializes().type, eschema.specializes()))
edges.add((eschema.type, eschema.specializes().type, None))
if eschema.specialized_by():
for pschema in eschema.specialized_by():
nodes.add((pschema.type, pschema))
edges.add((pschema.type, eschema.type, None))
self._nodes = nodes
self._edges = edges
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment