0
我正在使用rdflib == 4.1.2。 這是我的代碼如何在rdflib中添加圖形URL添加圖形
>>> g=rdflib.Graph()
>>> s=rdflib.BNode()
>>> FOAF = rdflib.Namespace("http://xmlns.com/foaf/0.1/")
>>> g.bind('foaf', FOAF)
>>> g.add((s, FOAF['img'],"https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcToZGEWvIBFgCiona6d74FtVthl4lkdJg3d61SGy-UCf4qFuDLD"))
我得到這個回溯。
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/rdflib/graph.py", line 394, in add
"Object %s must be an rdflib term" % (o,)
AssertionError: Object https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcToZGEWvIBFgCiona6d74FtVthl4lkdJg3d61SGy-UCf4qFuDLD must be an rdflib term
我該如何解決這個問題?
謝謝!