Paul Harrison wrote: > On 23.11.2006, at 05:16, Matthew Graham wrote: > > > > > 2. Views > > This needs to be renamed to what it actually is, i.e. format(s), since > > the current name is universally confusing. > > yes! - but I think it is really two concepts - on import it is just a > statement of the format of the data - on export it is a request to > convert the data to a format. The whole transfer object in the WSDL > should reflect this difference by not using the same data structure > for requests and returned information, as this is also confusing IMHO > as the distinction is lost between the statements > "this data is in format x" > "convert this data to format y" >Yep, I agree with that. I suspect that we ended up with 'view' in the import methods because of history. This originally came from the work we did at Cambridge in June, where we started looking at different back end implementations and what they would want to offer. In particular, we were thinking about a relational database service that could be used to store tabular data. A simple file based system always has the option of just returning the original file, but a database system can't. Once the data has been transferred into a table, the system no longer has the original file. So, a database system would always have to generate the output from the data in the table. Which is where the name view came from. As far as I can rememebr, the same element name was used for the import messages to make it possible to write a simple non-parsing client, that could take the XML from an export response and paste it into an import request to another server without having parse and modify the XML elements. In hindsight, this probably isn't a very important use case, as all of the client implementations will probably use a SOAP library to parse the XML into native objects before they even begin to look at it, and generate their requests as object trees first and use the SOAP library to serialize them into XML at the end. It isn't worth the confusion, within our own group, and explaining it to others, that importing a view has caused. As Paul says, importing and exporting are two different cases, and they have different meanings. On an import, we simply want to say "I'm wanto to send a FITS image". The fact that it is a result of a cutout transform of a larger image stored elsewhere is irrelevant. That information may be useful for provenance, in which case it should be encoded elsewhere, perhaps as properties of the node.
<node uri="vos://....">
....
<accepts>
<format uri="...."/>
<format uri="...."/>
<format uri="...."/>
</accepts>
....
</node>
and a client would specify the <format> that it wanted to send :
<pushToVOSpace>
....
<format uri="...."/>
....
</pushToVOSpace>
<node uri="vos://....">
....
<provides>
<view uri="...."/>
<view uri="...."/>
<view uri="...."/>
</provides>
....
</node>
just using <view> elements to indicate what data is available.
This mangles about three different things into one element.
<node uri="vos://....">
....
<provides>
....
<!-- The original image -->
<view uri="...." original="true">
</view>
....
</provides>
....
</node>
Or, a part of the image, with params to specify the coordinates of the fragment you want :
<node uri="vos://....">
....
<provides>
....
<!-- A cut-out of the image -->
<view uri="....">
<param name="...."/>
<param name="...."/>
</view>
....
</provides>
....
</node>
<node uri="vos://....">
....
<provides>
....
<!-- The original image -->
<view uri="....">
<formats>
<format uri="...." original="true"/>
<format uri="...."/>
<format uri="...."/>
</formats>
</view>
....
</provides>
....
</node>
Note that the original flag moves from the view, to one (and only one) of the format elements.
The service could also offer the results of the cut-out service in different formats, but none of them should be tagged as original :
<node uri="vos://....">
....
<provides>
....
<!-- A cutout of the image -->
<view uri="....">
<params>
<param name="...."/>
<param name="...."/>
</params>
<formats>
<format uri="...."/>
<format uri="...."/>
</formats>
</view>
....
</provides>
....
</node>
It might be be quite be difficult to express the rules for the original attibute clearly enough in the XML schema.
It should only apply to one format element, in one of the available views.
It might be clearer to provide the original data in a separate <view> element, and use a specific URI to represent original data,
rather than using a separate attribute.
This means we don't have to have extra rules about where the original attribute can be set and where it can't
Note - In the current schema we have the original flag as an optional (default true) attribute on any view element. So all of the available views may appear to be 'original', apart from the ones that we remember to explicitly say are not.
Replacing the original attribute with the special URI might make it easier to express the rules in the schema.
<node uri="vos://....">
....
<provides>
<!-- The original image -->
<view uri="[original]">
<formats>
<format uri="...."/>
</formats>
</views>
....
</provides>
....
</node>
and the generated formats in a separate view :
<node uri="vos://....">
....
<provides>
....
<!-- The whole image, in different formats -->
<view uri="[format-transform]">
<formats>
<format uri="...."/>
<format uri="...."/>
</formats>
</view>
....
</provides>
....
</node>
Plus a cut-out service that provides image fragments in a variety of formats :
<node uri="vos://....">
....
<provides>
....
<!-- A cut-out of the image -->
<view uri="[cut-out]">
<params>
<param name="...."/>
<param name="...."/>
</params>
<formats>
<format uri="...."/>
<format uri="...."/>
</formats>
</view>
....
</provides>
....
</node>
Separating view and format into two elements means that the <view> element just describes the data transform applied to the data, rather than the file format that is is in.
<node uri="vos://....">
....
<provides>
<!-- The original image -->
<view uri="[original]">
<format uri="....">
<protocol uri="[ftp-get]"/>
<protocol uri="[gftp-get]"/>
<protocol uri="[http-get]"/>
</format>
</view>
....
</provides>
....
</node>
Plus a number of views, which are only available via http-get.
Using Java Servlets within the VOSpace service to provide the transforms :
<node uri="vos://....">
....
<provides>
....
<!-- A cut-out of the image -->
<view uri="[cut-out]">
<params>
<param name="...."/>
<param name="...."/>
</params>
<formats>
<format uri="....">
<protocol uri="[http-get]"/>
</format>
<format uri="....">
<protocol uri="[http-get]"/>
</format>
</formats>
</view>
</provides>
....
</node>
<node uri="vos://....">
....
<provides>
<!-- The original file -->
<view uri="[original]">
<format uri="....">
<protocol uri="[ftp-get]"/>
<protocol uri="[gftp-get]"/>
<protocol uri="[http-get]"/>
</format>
</view>
</provides>
....
</node>
<node uri="vos://....">
....
<provides>
<!-- The original image -->
<view uri="[original]">
<format uri="....">
<protocol uri="[ftp-get]"/>
<protocol uri="[gftp-get]"/>
<protocol uri="[http-get]"/>
</format>
</view>
....
<!-- The same image in different formats -->
<view uri="[format-transform]">
<formats>
<format uri="....">
<protocol uri="[http-get]"/>
</format>
<format uri="....">
<protocol uri="[http-get]"/>
</format>
</formats>
</view>
....
<!-- A cut-out of the image -->
<view uri="[cut-out]">
<params>
<param name="...."/>
<param name="...."/>
</params>
<formats>
<format uri="....">
<protocol uri="[http-get]"/>
</format>
<format uri="....">
<protocol uri="[http-get]"/>
</format>
</formats>
</view>
</provides>
....
</node>
<node uri="vos://....">
....
<accepts>
<!-- The 'any' format -->
<format uri="[any]">
<protocol uri="[ftp-get]"/>
<protocol uri="[gftp-get]"/>
<protocol uri="[http-get]"/>
</format>
<accepts>
</node>
A more specialised image archive or database system may only accept specific formats sent via http-put :
<node uri="vos://....">
....
<accepts>
<!-- The any format -->
<format uri="[any]">
<protocol uri="[ftp-get]"/>
<protocol uri="[gftp-get]"/>
<protocol uri="[http-get]"/>
<protocol uri="[http-put]"/>
</format>
<!-- VOTable data -->
<format uri="[votable]">
<protocol uri="[http-put]"/>
</format>
<!-- FITS images data -->
<format uri="[fits-image]">
<protocol uri="[http-put]"/>
</format>
<accepts>
</node>

![]() |
Click here for the AstroGrid Service Web |
This is the AstroGrid Development Wiki |
|