I am completely new in Python . I am using 3.9.2 and rdflib . I try to execute the first example,
from rdflib import Graph
g = Graph()
g.parse('http://dbpedia.org/resource/Semantic_Web')
for s, p, o in g:
print(s, p, o)
I create a py file , paste it in and then using windows 10 cmd, I cd to my pyhton file and do python rdftest.py
.
No matter how I set the url, I get
Traceback (most recent call last):
File "D:\BACKUP\programming\rdftrest.py", line 3, in <module>
g.parse('http://dbpedia.org/resource/Semantic_Web')
File "C:\Users\spiro\AppData\Local\Programs\Python\Python39\lib\site-packages\rdflib\graph.py", line 1188, in parse
source = create_input_source(
File "C:\Users\spiro\AppData\Local\Programs\Python\Python39\lib\site-packages\rdflib\parser.py", line 281, in create_input_source
) = _create_input_source_from_location(
File "C:\Users\spiro\AppData\Local\Programs\Python\Python39\lib\site-packages\rdflib\parser.py", line 312, in _create_input_source_from_location
if path.exists():
File "C:\Users\spiro\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 1407, in exists
self.stat()
File "C:\Users\spiro\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 1221, in stat
return self._accessor.stat(self)
OSError: [WinError 123] The filename, directory name, or volume label syntax is
incorrect: 'http:\\dbpedia.org\\resource\\Semantic_Web'
How can I fix that? Thank you