ingester.py 文件源码

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

项目:bibcat 作者: KnowledgeLinks 项目源码 文件源码
def transform(self, source=None, instance_uri=None, item_uri=None):
        """Takes new source, sets new graph, and creates a BF.Instance and
        BF.Item entities

        Args:
            source: New source, could be URL, XML, or CSV row
            instance_uri(rdflib.URIRef): Existing Instance URI, defaults to None
            item_uri(rdflib.URIRef): Existing Item URI, defaults to None

        Returns:
            tuple: BIBFRAME Instance and Item
        """
        if source is not None:
            self.source = source
            self.graph = new_graph()
        bf_instance = self.populate_entity(NS_MGR.bf.Instance, instance_uri)
        bf_item = self.populate_entity(NS_MGR.bf.Item, item_uri)
        self.graph.add((bf_item, NS_MGR.bf.itemOf, bf_instance))
        return bf_instance, bf_item
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号