Пример #1
0
 def add_slot_range(slot: SlotDefinition) -> None:
     if slot.range:
         if slot.range in self.schema.types:
             add_type_ref(self.schema.types[slot.range])
         else:
             cls = self.schema.classes[slot.range]
             if cls.imported_from:
                 if self.class_identifier(cls):
                     identifier_range = self.class_identifier_path(
                         cls, False)[-1]
                     if identifier_range in self.schema.types:
                         add_type_ref(TypeDefinition(identifier_range))
                     else:
                         rval.add_entry(cls.imported_from,
                                        identifier_range)
                 if slot.inlined:
                     rval.add_element(cls)
Пример #2
0
 def visit_type(self, typ: TypeDefinition) -> None:
     self._visit(typ)
     typ.uri = self.namespaces.uri_for(typ.uri)