def get_triples(org, out_file, weeks=1, span=None, format="turtle"):
g = Graph()
if span is not None:
records = get_publications_for_org(org, span=span)
else:
records = get_publications_for_org(org, weeks=int(weeks))
num = 0
for num, rec in enumerate(records):
g += rec.to_rdf()
trips = len(g)
console("{} records found. {} triples created.".format(num or 0, trips))
if trips > 0:
if out_file is not None:
output_graph(g, destination=out_file, format=format)
else:
print output_graph(g, format=format)
评论列表
文章目录