work.py 文件源码

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

项目:bibcat 作者: KnowledgeLinks 项目源码 文件源码
def __add_creators__(self, work_graph, work_uri, instance_uri):
        """Method takes a new work graph and instance uri, queries for
        relators:creators of instance uri and adds values to work graph

         Args:
            work_graph(rdflib.Graph): RDF Graph of new BF Work
            instance_uri(rdflib.URIRef): URI of BF Instance
        """
        instance_key = str(instance_uri)
        if instance_key in self.processed: 
            for code in self.creator_codes:
                if not code in self.processed[instance_key]:
                    continue
                relator = getattr(NS_MGR.relators, code)
                for agent_uri in self.processed[instance_key][code]:
                    work_graph.add((work_uri, 
                                    relator, 
                                    agent_uri))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号