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
评论列表
文章目录