LISTSERV mailing list manager LISTSERV 16.0

Help for ZNG Archives


ZNG Archives

ZNG Archives


ZNG@C4VLPLISTSERV01.LOC.GOV


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

ZNG Home

ZNG Home

ZNG  February 2014

ZNG February 2014

Subject:

Re: SRU recordPacking and JSON

From:

Jonathan Rochkind <[log in to unmask]>

Reply-To:

SRU (Search and Retrieve Via URL) Implementors

Date:

Wed, 19 Feb 2014 12:17:46 -0500

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (197 lines)

I'd also add this particular answer from the RFC3023 FAQ, which is 
relevant to what you guys are talking about, as far as assuming anything 
about the relationship between content type "something" and content type 
"something+xml".

A.13 What is the semantic difference between application/foo and
      application/foo+xml?

    MIME processors that are unaware of XML will treat the '+xml' suffix
    as completely opaque, so it is essential that no extra semantics be
    assigned to its presence.  Therefore, application/foo and
    application/foo+xml SHOULD be treated as completely independent media
    types.  Although, for example, text/calendar+xml could be an XML
    version of text/calendar[RFC2445], it is possible that this
    (hypothetical) new media type would include new semantics as well as
    new syntax, and in any case, there would be many applications that
    support text/calendar but had not yet been upgraded to support
    text/calendar+xml.


So.  "application/sru+xml" needs to be registered to be used legally. 
Even if you already had "application/sru" registered, you'd need to have 
registered "application/sru+xml" too, to use it legally.

By standard, anything ending in "+xml" should be valid XML. So you would 
probably be stopped from registering something ending in "+xml" that 
wasn't intended to be.

Beyond that, the nature of what "application/sru+xml" is, is up to your 
own documentation for the content type. So when you registered 
"application/sru+xml", the standard that defines it may have said "it 
will return something that is valid under the SRU Response XML schema" 
-- then that's what makes this so. Not just any implication or 
assumption of the relationship between "application/sru" and 
"application/sru+xml".

I don't think there's any standard about "+json". But you could still 
register a type for "application/sru+json", and the standard that 
establishes the meaning of that registration could say it will be JSON, 
and would be expected to define the particular nature of that JSON. 
Which you could do using JSON schema, or plain English language, or 
whatever other means you wanted; there is nothing that would require it 
to be anything in particular, that'd be up to you standardizing it.

Jonathan

On 2/19/14 11:54 AM, Jonathan Rochkind wrote:
> No.
>
> So, according to the relevant standards, all content types need to be
> registered, you don't just get to make them up -- unless you use some of
> the prefixes for experimental/vendor/unregistered content types.
>
> Not even if they end in "+xml" do you get to make them up.
>
> There is, however, an established convention in the standard that
> content types ending in "+xml" are XML
>
> There is no equivalent established standard for content types ending in
> "+json", even if you think it is "sort of implied."
>
> The "+xml" convention is standardized in this RFC:
> http://tools.ietf.org/search/rfc3023
>
> I don't believe a "+json" convention is standardized anywhere, although
> I don't think there's anything stopping you from ending any content type
> you want in "+json" ("+" is a legal char for content types in general, I
> think?), and I can see how it would be a helpful hint for developers.
>
> You would still need to register your content type, or use one of the
> vendor/experimental/private-use prefix standards, as you would for any
> new content type, ending in "+xml", "+json", or anything else. Or at
> least, you'd need to do that unless you are okay with violating the
> standards.
>
> I do encourage looking at RFC3023 to get a sense of how all this stuff
> works, especially it's FAQ section at the end.
>
> Jonathan
>
> On 2/19/14 10:57 AM, Ray Denenberg wrote:
>> *From:*LeVan,Ralph
>>
>>  > Application/sru+xml means SRU returned as XML.
>>
>> It means more than that. it means that the response must be as defined
>> by the SRU Response schema:
>>
>> http://docs.oasis-open.org/search-ws/searchRetrieve/v1.0/os/schemas/sruResponse.xsd
>>
>>
>>
>> That sort of implies
>>
>>  > that application/sru+json is meaningful.
>>
>> Not unless (or until) there is an analogous json schema.
>>
>>  > The HTTP Accept header or the httpAccept parameter take care of the
>>
>>  > response definition, possibly supplemented with the responseType
>>
>>  > parameter if a sufficiently complicated media subtype canít be agreed
>>
>>  > upon. (In the example given below of an Atom response with SRU
>>
>>  > semantics, it was suggested that the media type would be
>>
>>  > application/atom+xml combined with a response type (essentially) of
>> SRU.
>>
>> No, it's saying more than just "atom expressing SRU", it is saying there
>> is a (fictitious) definition (which may be a schema, or some other form
>> of definition) whose identifier is *info:srw/1/response-type/atom, * to
>> be used in conjunction with atom, to form a complete SRU response.
>>
>>  > To my mind what that means is that we are refining the Atom semantics
>>
>>  > with SRU semantics. Iíd probably fudge the whole thing as
>>
>>  > application/atom.sru+xml, realizing that no one has agreed to the
>>
>>  > semantics of that media type. :)
>>
>> By that approach we either (a) fudge non-standard media types, or (b)
>> try to standardize the media types we want.   I don't like either
>> possibility.
>>
>>  > A similar pattern then applies for the record.  I need to specify a
>>
>>  > media type with semantics and syntax combined.
>> Application/marc21+xml,
>>
>>  > application/vnd.viaf+xml, application/vnd.viaf+json.  The current
>>
>>  > solution is to provide an opaque URI in the recordSchema parameter (or
>>
>>  > a short name for that URI as defined in the Explain record) that
>>
>>  > magically defines semantics and syntax.
>>
>> And what's wrong with the latter?
>>
>>  > I think I prefer a more explicit use of an Internet media type.  It is
>>
>>  > subject to standard rules about negotiation with the client and server
>>
>>  > both able to say something about the ranking of preferences.  The
>>
>>  > recordSchema element in the record response allows the server to tell
>>
>>  > the client what media type was selected for the response.
>>
>> I think you meant to say "selected for the record"?  But no, the server
>> doesn't select a record syntax, that value is echoed in the response,
>> redundantly. The server cannot select an alternative syntax.  At the
>> (broader) response level, it's different. The client has the option of
>> content negotiation, as an alternative to using httpAccept, and, this
>> way to do it (allowing both mechanisms)  was chosen (and as I recall, it
>> was your idea) for two reasons (1) we wanted to allow content
>> negotiation, (2) some clients are not capable of content negotiation.
>>
>> But my point, I think, is that content negotiation is meaningful at the
>> response level, but doesn't really make a whole lot of sense at the
>> record level.
>>
>>  >     The critical standards issue here is that the client needs
>>
>>  > to be able to request something *not* on our approved list of options
>>
>> I don't follow, could you elaborate?
>>
>>  >
>>
>>  > recordXMLEscaping (formerly recordPacking) is a specific example of a
>>
>>  > generic problem.  I might like to escape my json records in my json
>>
>>  > response so that they donít get parsed as part of the entire payload.
>>
>>  > More importantly, I *probably* need to escape my JSON records in my
>> XML
>>
>>  > response.  I think we need to reconsider recordPacking.
>>
>> Yes, I do see the point here. I'm sure it will be on the table for 2.1.
>>
>> Thanks Ralph.
>>
>> Ray
>>
>>
>> *Sent:* Tuesday, February 18, 2014 4:21 PM
>> *To:* [log in to unmask]
>> *Subject:* Re: SRU recordPacking and JSON
>>

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

July 2017
October 2016
July 2016
August 2014
February 2014
December 2013
November 2013
October 2013
February 2013
January 2013
October 2012
August 2012
April 2012
January 2012
October 2011
May 2011
April 2011
November 2010
October 2010
September 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
October 2009
September 2009
August 2009
July 2009
May 2009
April 2009
March 2009
February 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001

ATOM RSS1 RSS2



LISTSERV.LOC.GOV

CataList Email List Search Powered by the LISTSERV Email List Manager