SNOMEDToOWL.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:SNOMEDToOWL 作者: hsolbrig 项目源码 文件源码
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)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号