Re: Cwm namespace/URI bug?

On Thursday, Aug 28, 2003, at 16:30 US/Eastern, Dan Connolly wrote:

> On Thu, 2003-08-28 at 15:14, Ryan Lee wrote:
>> (using the latest version of 2000/10/swap, with cwm.py 1.135, 
>> 2003/08/25)
>>
>> Consider a file a.n3:
>>
>>  % cwm --n3 a.n3
>>
>>  result: [[
>>  @prefix : <http://www.example.org/ns#> .
>>
>>  :s :p :o .
>>  # ENDS
>>  ]]
>>
>> This is good.  But if I call cwm with the following (assuming
>> a.n3 is the same as above):
>>
>>  % cwm --n3 http://www.example.org/a.n3 > o.n3
>>
>>  result: [[
>>  @prefix : </ns#> .
>>
>>  :s :p :o .
>>  # ENDS
>>  ]]
>>
>> If I were to then use that output for something else, the namespace 
>> would
>> render it incorrect for most situations.
>
> Incorrect? How do you mean?
>

You mean it would be relative to the URI space of the input.

If you want to use a different space, use --base

If you want to make sure it deosn't use relative URIs for anything in 
http: space,
  use --base=whatever:

Ralph fell into the same trap.


>>   Perhaps cwm should not be so
>> eager to look for relative URIs when it comes to namespaces.  Or 
>> something
>> like that.
>>
>> This is particularly troublesome when doing work with files coming off
>> www.w3.org that use at least one namespace that starts with
>> 'http://www.w3.org/'.  It can be worked around by using cwm with
>> no-prefix, absolute URI flags, --n3=pr.  It does NOT work if the 
>> --n3=r
>> (suppress relative URIs) option is used on its own nor if --n3=p is 
>> used
>> on its own.
>
> cwm assumes the output goes to the same part of URI space
> as the input; if you violate that assumption by moving the
> the output to file: space when the input came from http: space,
> you need to tell cwm by way of the --base option, I think.
>
>>   I would rather see 'http://' namespaces go untouched no
>> matter what flags are used.
>
> I don't see any straightforward way to do that.
>

And actually, it is pretty useful to be able to work in file or http
space in a very consistent fashion.

>> Information on what I might be doing wrong would also be greatly
>> appreciated.



> Dan Connolly, W3C http://www.w3.org/People/Connolly/
>

Received on Thursday, 28 August 2003 23:00:32 UTC