def __readGraphIriFile(self, graphfile):
"""Search for a graph uri in graph file and return it.
Args:
graphfile: String containing the path of a graph file
Returns:
graphuri: String with the graph URI
"""
try:
with open(graphfile, 'r') as f:
graphuri = f.readline().strip()
except FileNotFoundError:
logger.debug("File not found {}".format(graphfile))
return
try:
urlparse(graphuri)
logger.debug("Graph URI {} found in {}".format(graphuri, graphfile))
except Exception:
graphuri = None
logger.debug("No graph URI found in {}".format(graphfile))
return graphuri
评论列表
文章目录