def _add_defining_attribute(self, coll: Collection, group: int, rels: Set[RF2Files.Relationship]) -> None:
if group == 0:
for rel in rels:
restr = existential_restriction(self, as_uri(rel.typeId), as_uri(rel.destinationId))
if rel.typeId in self._context.NEVER_GROUPED:
coll.append(restr)
else:
coll.append(role_group(self, restr))
else:
if len(rels) > 1:
# A group whose target is an intersection of subjects + inner restrictions
target, inner_coll = intersection(self)
[inner_coll.append(existential_restriction(self, as_uri(rel.typeId), as_uri(rel.destinationId)))
for rel in rels]
coll.append(role_group(self, target))
else:
rel = list(rels)[0]
coll.append(existential_restriction(self, as_uri(rel.typeId), as_uri(rel.destinationId)))
评论列表
文章目录