- From: Tim Berners-Lee <timbl@w3.org>
- Date: Wed, 9 Jun 2004 20:17:50 -0400
- To: Yosi Scharf <syosi@MIT.EDU>
- Cc: public-cwm-bugs@w3.org
On Jun 9, 2004, at 10:40, Yosi Scharf wrote:
> 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.
1) Don't bind. (builtin return None)
2) ditto
> 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?
It may be useful to have an option of warnings when a bizarre
combination of types comes up in a builtin's args, as they are often
rule-writer's error. But logically, the builtin just returns no
bindings.
>
> 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 20:17:47 UTC