I was testing RDFLib using WinPython. Just to see if it works I quickly ran Jeni Tennison's tutorial source code. While almost everything worked ok, there seems to be an error with the RDFLib 3.2.3 version (which apparently is the only one I can run with WinPython):

Traceback (most recent call last):
File "D:\test\pytest\get-names-and-emails.py", line 40, in <module>
graph.parse(rdflib.StringInputSource(content), format="nt")
AttributeError: 'module' object has no attribute 'StringInputSource'

If I try to parse the content directly I will get the error described here: rdflib troubles. How should I parse the code using RDFLib 3.2.3 so that I will not get the BAD URL error described in the other forum post? Configuration is Windows 7, 64 bytes, WinPython 0.11 Python and Python - 64 bytes

asked 22 Feb '13, 13:43

paxRoman's gravatar image

accept rate: 0%

edited 22 Feb '13, 13:44

Any RDFLib version >3 should work fine on windows.

Just replacing rdflib.StringInputSource(content) with data=content, like this:

graph.parse(data=content, format='nt')
permanent link

answered 22 Feb '13, 13:54

Gunnar%20Aastrand%20Grimnes's gravatar image

Gunnar Aastr...
accept rate: 47%

It worked. Thanks!

(22 Feb '13, 14:13) paxRoman paxRoman's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 22 Feb '13, 13:43

question was seen: 1,268 times

last updated: 22 Feb '13, 14:13