Skip to content

Update STREAM/href text and examples#82

Merged
mbtaylor merged 2 commits intoivoa-std:masterfrom
mbtaylor:stream-update
Mar 6, 2026
Merged

Update STREAM/href text and examples#82
mbtaylor merged 2 commits intoivoa-std:masterfrom
mbtaylor:stream-update

Conversation

@mbtaylor
Copy link
Member

@mbtaylor mbtaylor commented Mar 5, 2026

Replace outdated example URI schemes "httpg" and "ftp" in section 5.7 with "http" and "https". Also adjust text about what URI schemes parsers are expected to be able to read from.

Replace outdated example URI schemes "httpg" and "ftp" in
section 5.7 with "http" and "https".  Also adjust text about
what URI schemes parsers are expected to be able to read from.
@mbtaylor
Copy link
Member Author

mbtaylor commented Mar 5, 2026

This is a fix for issue #81.

@mbtaylor mbtaylor requested a review from msdemlei March 5, 2026 09:16
Copy link
Collaborator

@msdemlei msdemlei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. "absolute and relative" makes me nervous because we'll suddenly have to explain how to obtain a base URI for a VOTable. This may already be tricky when, e.g. in async TAP, the same VOTable is available under two different paths, but it becomes close to impossible when VOTables are stored or sent via SAMP.

Does TOPCAT actually do relative paths? And if so, this isn't a constant source of annoyance?

So... as long as we don't have the guts to actually drop external streams (I wonder how many parsers actually implement them, frankly), can we at least forbid relative URIs while we can claim it's just a clarification of the existing standard?

@mbtaylor
Copy link
Member Author

mbtaylor commented Mar 5, 2026

Yes STIL has always managed STREAMs with relative URLs. When reading from a file/URI it keeps track of the location of the XML document and uses that to resolve any relative URI in a STREAM/@href. If there's no location, e.g. because the XML is just fed to it from a stream, then it will fail to read from relative URLs.

If you're going to use this STREAM business I'd say use of relative URLs makes it more rather than less usable, since you can just dump the data and metadata in the same place or nearby to each other and move them around together rather than pretty much guaranteeing that the content will break if you ever move the data file. So I kind of assumed that the obvious way to use STREAMs was like this and implemented it in STIL, though I don't think it says that explicitly anywhere.

But I agree adding "relative" in the text here does introduce the explicit expectation of a behaviour that wasn't mentioned before, which could cause problems. And nobody's complained about the lack of this language up till now. The intention of this PR was just to tidy things up not to introduce new requirements, so I'm happy to remove the text "absolute and relative" if you think that's a good idea.

@msdemlei
Copy link
Collaborator

msdemlei commented Mar 5, 2026 via email

@mbtaylor
Copy link
Member Author

mbtaylor commented Mar 6, 2026

Ok, so what you're saying is that the whole href business really is a
way to get around the need to base64-encode stuff? Hmfine... if only
we had some standard way to reliably move the two parts as a unit
(within a zip file, say)... Ah well.

My view was that if BINARY-with-href is useful at all (and really, I think it's hardly been used in the history of VOTable) the benefit is to put the metadata in a small file that can e.g. be manipulated in a text editor to edit the metadata, or ingested by a reader to look at the metadata, while the more unwieldy bulk data can go elsewhere. A more compelling story at the start of VOTable history was maybe VOTable metadata decorating an existing FITS file; but again as far as I'm aware this is hardly ever done. So I do basically agree with you that this is all a bit academic.

Indeed, it will work with href="file:stream.b64". I can't be
bothered to make sure that's not what the file URI schema wants, but
it certainly looks funny.

The way I'd expect a relative URI to be used here is without a scheme part (path-noscheme production from RFC3986). If you create an external-STREAM VOTable using STIL, e.g.:

   stilts tpipe in=:test:3,b ofmt='votable(format=binary2,inline=false)' \ 
                out=x.vot

it writes

   <BINARY2>
   <STREAM href="x-data.bin"/>
   </BINARY2>

Since I'm too lazy to check ... can astropy.io.votable read the file-pair that that generates?

@msdemlei
Copy link
Collaborator

msdemlei commented Mar 6, 2026 via email

Following discussion, and given that astropy.io.votable does not
work with relative URIs in STREAM href attributes, remove the
qualifier "absolute and relative" on the forms of URI that
parsers are expected to be able to dereference.

This would anyway have constituted a new expectation on parsers,
i.e. one not explicit in earlier VOTable versions, and that wasn't
the intention of this (tidying and modernisation) edit.
@mbtaylor
Copy link
Member Author

mbtaylor commented Mar 6, 2026

OK you convinced me.

@mbtaylor mbtaylor requested a review from msdemlei March 6, 2026 14:47
Copy link
Collaborator

@msdemlei msdemlei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm half inclined to create an issue "write something clever on what to expect from STREAM/@href and what not to expect", but then I find I'm too lazy and this can wait until someone actually complains because they'd like to use it and it doesn't work.

So: fine with me, let's go

@mbtaylor mbtaylor merged commit f7811f5 into ivoa-std:master Mar 6, 2026
1 check passed
@mbtaylor mbtaylor deleted the stream-update branch March 6, 2026 15:17
@mbtaylor mbtaylor mentioned this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants