Re: iterable argument required - bug?

What you did was trying to find the uri of something that was not a string.

attached are files to show the behaviour on (1) non-strings, and (2) strings that do not encode uri's. 

Timbl, what should the behavior be? Currently if the file has either error cwm throws an exception. Should it do that? Should it keep going?

Yosi


>After a substantial time away, I'm getting back into using cwm. One of 
>the projects I'm working on reliably fails in the following manner, but 
>I'm not sure if it's a bug with my data (if so, it seems like a pretty 
>spectacular way to fail), or cwm. Does this look like a known problem 
>in cwm? Perhaps something that's not friendly to Python 2.3 in the 
>code?
>
>This is the latest from CVS, with Python 2.3 (Apple's build) on OSX 
>10.3.3.
>
>Thanks,
>
>adsl-67-119-69-246:~/Projects/HTTP header registry/swap> ./cwm.py 
>~/Desktop/rfc_rules.n3 ~/Desktop/out.n3 --think --purge > ~/out.n3
>Traceback (most recent call last):
>   File "./cwm.py", line 646, in ?
>     doCommand()
>   File "./cwm.py", line 517, in doCommand
>     think(workingContext, mode=option_flags["think"])
>   File "/Users/mnot/Projects/HTTP header registry/swap/query.py", line 
>58, in think
>     return InferenceTask(knowledgeBase, ruleFormula, mode=mode, 
>repeat=1).run()
>   File "/Users/mnot/Projects/HTTP header registry/swap/query.py", line 
>207, in run
>     return self.runSmart()
>   File "/Users/mnot/Projects/HTTP header registry/swap/query.py", line 
>195, in runSmart
>     total += cy.run()
>   File "/Users/mnot/Projects/HTTP header registry/swap/query.py", line 
>303, in run
>     return rule.once()
>   File "/Users/mnot/Projects/HTTP header registry/swap/query.py", line 
>404, in once
>     total = query.resolve()
>   File "/Users/mnot/Projects/HTTP header registry/swap/query.py", line 
>545, in resolve
>     return self.unify(self.queue, self.variables, self.existentials)
>   File "/Users/mnot/Projects/HTTP header registry/swap/query.py", line 
>709, in unify
>     nbs = item.tryBuiltin(queue, bindings, heavy=0, evidence=evidence)
>   File "/Users/mnot/Projects/HTTP header registry/swap/query.py", line 
>995, in tryBuiltin
>     result = pred.evalSubj(obj, queue, bindings.copy(), proof, 
>self.query)
>   File "/Users/mnot/Projects/HTTP header registry/swap/term.py", line 
>864, in evalSubj
>     return self.store._fromPython(self.evaluateSubject(obj.value()))
>   File "/Users/mnot/Projects/HTTP header registry/swap/llyn.py", line 
>706, in evaluateSubject
>     if ':' not in object:
>TypeError: iterable argument required
@prefix log:  <http://www.w3.org/2000/10/swap/log#> .
@prefix : <#> .

{?y log:uri <>} log:implies {?y a :TEST_RESULT} .
@prefix log:  <http://www.w3.org/2000/10/swap/log#> .
@prefix : <#> .

{?y log:uri "hello"} log:implies {?y a :TEST_RESULT} .

Received on Wednesday, 9 June 2004 10:57:38 UTC