Re: Comments on WD-HTTP-in-RDF-20070301

Shadi Abou-Zahra schrieb:
> Johannes Koch wrote:
>>     <http:MessageHeader rdf:ID="mh1">
>>       <http:fieldName rdf:resource="&http;accept-language"/>
>>       <http:fieldValue>en</http:fieldValue>
>>     </http:MessageHeader>
> 
> ...and where a header is not listed in HTTP-in-RDF, for example the 
> header "foo:bar", it could look like this:
> 
> <http:MessageHeader rdf:ID="mh13">
>   <http:fieldName>foo</http:fieldName>
>   <http:fieldValue>bar</http:fieldValue>
> </http:MessageHeader>
> 
> Right?

Yep

>>     <http:MessageHeader rdf:ID="mh2">
>>       <http:fieldName rdf:resource="&http;accept"/>
>>       <http:fieldValue rdf:parseType="Collection">
>>         <foo:ListItem>
>>           <foo:mimeType>application/xhtml+xml</foo:mimeType>
>>           <foo:params>q=1.0</foo:params>
>>         </foo:ListItem>
>>         <foo:ListItem>
>>           <foo:mimeType>text/html</foo:mimeType>
>>           <foo:params rdf:parseType="Collection">
>>             <foo:Param>
>>               <foo:paramName>q</foo:paramName>
>>               <foo:paramValue>0.9</foo:paramValue>
>>             </foo:Param>
>>             <foo:Param>
>>               <foo:paramName>bar</foo:paramName>
>>               <foo:paramValue>blah</foo:paramValue>
>>             </foo:Param>
>>           </foo:params>
>>         </foo:ListItem>
>>       </http:fieldValue>
>>     </http:MessageHeader>
> 
> What namespace is "foo"? I think if we go down that road than at least 
> Params/Param should be in "http" namespace.

I originally thought foo is the prefix for Jo's very own namespace URI 
:-) But we could put all this stuff into the http namespace.

> I'm concerned about trying "http:mimeType", we would need to add many 
> such named properties.

Yes, sorry, this was meant to be just an example.

> Is there a more systematic pattern we can 
> implement like the fieldName/fieldValue approach?

Jakarta Commons HttpClient models a header like this:

<http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/Header.html>:

Header
|- name
|- headerValue


<http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/HeaderElement.html>:

headerValue can be parsed into an array of HeaderElement

header  = [ element ] *( "," [ element ] )
element = name [ "=" [ value ] ] *( ";" [ param ] )
param   = name [ "=" [ value ] ]


So for

   Accept: application/xhtml+xml;q=1.0, text/html;q=0.9

we could have

<http:MessageHeader>
   <http:fieldName rdf:resource="&http;accept"/>
   <http:fieldValue rdf:parseType="Collection">
     <http:HeaderElement>
       <http:elementName>application/xhtml+xml</http:elementName>
       <http:param>
         <http:Param>
           <http:paramName>q</http:paramName>
           <http:paramValue>1.0</http:paramValue>
         </http:Param>
       </http:param>
     </http:HeaderElement>
     <http:HeaderElement>
       <http:elementName>text/html</http:elementName>
       <http:param rdf:parseType="Resource">
         <!-- shorter form here -->
         <http:paramName>q</http:paramName>
         <http:paramValue>0.9</http:paramValue>
       </http:param>
     </http:HeaderElement>
   </http:fieldValue>
</http:MessageHeader>

and for

   Content-Type: application/xhtml+xml;charset=UTF-8

we could have

<http:MessageHeader>
   <http:fieldName rdf:resource="&http;content-type"/>
   <http:fieldValue>
     <http:HeaderElement>
       <http:elementName>application/xhtml+xml</http:elementName>
       <http:param>
         <http:Param>
           <http:paramName>charset</http:paramName>
           <http:paramValue>UTF-8</http:paramValue>
         </http:Param>
       </http:param>
     </http:HeaderElement>
   </http:fieldValue>
</http:MessageHeader>

and for

   Cache-Control: max-age=2000

we could have

<http:MessageHeader>
   <http:fieldName rdf:resource="&http;cache-control"/>
   <http:fieldValue>
     <http:HeaderElement>
       <http:elementName>max-age</http:elementName>
       <http:elementValue>2000</http:elementValue>
     </http:HeaderElement>
   </http:fieldValue>
</http:MessageHeader>

-- 
Johannes Koch
BIKA Web Compliance Center - Fraunhofer FIT
Schloss Birlinghoven, D-53757 Sankt Augustin, Germany
Phone: +49-2241-142628    Fax: +49-2241-142065

Received on Monday, 19 March 2007 22:47:09 UTC