On Tue, Dec 8, 2009 at 12:41 PM, Robert Bradshaw
<rober...@math.washington.edu> wrote:
> On Dec 8, 2009, at 12:26 PM, William Stein wrote:
>
>> On Tue, Dec 8, 2009 at 12:14 PM, Jason Grout
>> <jason-s...@creativetrax.com> wrote:
>>> William Stein wrote:
>>>
>>>>> I guess what I'm advocating is that it would be useful for the
>>>>> underlying ID to be (probabilistically) globally unique, not just
>>>>> unique for a user or a specific notebook server.
>>>>
>>>> (1) How is that useful?
>>>> (2) Why don't web pages, wiki pages (?), latex documents, etc. have
>>>> such a unique id?
>>>
>>>
>>> How would either of you deal with the following situation:
>>>
>>> I have Rob Beezer's linear algebra book in Sage Worksheets, with
>>> hundreds of cross-references between the worksheets.  I want to
>>> upload
>>> two copies of the book into my notebook server.
>>>
>>
>> The design I have in mind I came up with while flying cross-country
>> with Rob Beezer and his book :-)
>>
>>> Where do the crossreferences point?
>>
>> I wouldn't even think about importing a book until I've implemented
>> nested worksheets (just like nested web pages).
>> So here's what happens:
>>
>> (1) You upload the first book and the absolute version of the labels
>> are all of the form
>>
>>   beezer/intro/label1
>>   beezer/ch1/label1
>>   beezer/ch1/label2
>>
>> etc.  Within the book, the worksheets just use labels of the form
>> "intro/label1", "ch1/label1", etc., -- they never explicitly mention
>> "beezer".   The worksheets themselves know they are children of the
>> "beezer" worksheet (which could be a cover page or contents page).
>>
>> (2) When you upload the second copy of the book, you will receive a
>> dialog that says "The 'beezer' top level label is already defined.
>> Name for top level label of new worksheet: [beezer2]."  You can then
>> just accept "beezer2" or change it to anything you want.
>
> Any referenced directly to beezer would break, but I'm more OK with
> that.

They would (continue to) point at the already existing beezer.
Beezer's book wouldn't explicitly reference beezer, since all
references should be relative in that collection of worksheets.

Note again that I want to implement a hierarchy of worksheets, so a
worksheet can have a bunch of subworksheets, just like a web page has
pages that hang off of it with relative links.

> Alternatively, one could create and upload to a subdirectory,
> where the name beezer would not conflict.
>
>>>  Do I get an error and have to
>>> manually reassign all possible labels on the second version of the
>>> book?
>>>
>>
>> Nope.
>>
>>> I can see Robert's idea working better, in that it sees that there
>>> are
>>> conflicts, so it regenerates "unique" ids for all worksheets in the
>>> second copy of the book upon import, automatically changing any
>>> reference in those worksheets to use the new ids.
>>
>> No, it is way worse.    For starters, think very carefully about how
>> these *references* are expressed?  (1) with that design the references
>> are unreadable, (2) the references could be autogenerated as output of
>> some sage command, hence be *impossible* to change by scanning the
>> worksheets.
>
> The idea is that one would never need to change them. (Scanning the
> worksheets is fragile anyways.)
>
>> With my design -- which just happens to be the bog
>> standard design that is used everywhere (web pages, etc.), imho --
>> even autogenerated references would work fine (since they are
>> relative).   Plus, sticking with a standard design means it will be
>> easier for people to understand.
>
>
> I had not realized you were thinking about introducing *relative*
> labels. Yes, that makes much more sense, and I think solves all the
> issues.

Awesome.  I can see why you didn't realize that, since I hadn't even
mentioned it until just now.    Rob B. and I realized relative labels
(and worksheets) are essential on our flight back.  And also they are
very natural since that's what people are used to with web pages, etc.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to