Copyright © 2007 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
The identification of resources on the Web by URI may not be sufficient to uniquely resolve a document as other factors such as HTTP content negotiation might come into play. This issue is particularly significant for quality assurance testing, conformance claims, and reporting languages like the Evaluation and Report Language (EARL). This document describes a representation of HTTP vocabulary in RDF. The terms defined by this document allow HTTP headers that have been exchanged between a client and a server to be recorded in RDF format. The terms defined by this document includes vocabulary for HTTPS as well as other extensions to the core specification.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This Editor's Draft of the HTTP Vocabulary in RDF document was published on 1 March 2007 by the Evaluation and Repair Tools Working Group (ERT WG). It is an update of the previous HTTP Vocabulary in RDF Working Draft of 20 December 2006, and addressed the comments received since. In particular, this draft implements the decisions of the Working Group at its face to face meeting in February 2007 (see history of document changes). This document is expected to be published as a W3C Working Group Note after review and refinement.
The Working Group encourages feedback about the approach, as well as about the completeness and maturity of this document by developers and researchers who have interest in a representation of the HTTP vocabulary in RDF format. Feedback from the W3C Quality Assurance Interest Group (QA IG), the W3C Semantic Web Interest Group (SWIG), the Protocol for Web Description Resources Working Group (POWDER WG), and the W3C Mobile Web Best Practices Working Group (BPWG) is particularly welcome. Please send comments on this document to the public mailing list of the working group public-wai-ert@w3.org. The archives of the working group mailing list are publicly available.
Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. The group does not expect this document to become a W3C Recommendation. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
This document defines a representation of the Hyper Text Transfer Protocol (HTTP) using the Resource Description Framework (RDF). It defines a collection of RDF classes and properties that represent the HTTP vocabulary as defined by the HTTP specification. These RDF terms can be used to record HTTP request and response messages in RDF format. For example by automated Web accessibility evaluation tools to describe Web resources, including the various headers exchanged between the client and server during content negotiation. More usage examples for these terms are described in section 1.3. Use Cases.
This document is not inteded to be a clarification of the different concepts of the HTTP specification. The HTTP specification is defined by a series of Request for Comments (RFC) and other documentation. These are listed in Appendix C. References. This document is also not intended to be an introduction to RDF, refer to [RDF] or [RDF-PRIMER] for this purpose.
The RDF representation of the HTTP vocabulary defined by this document uses namespace http://www.w3.org/2006/http#
. The prefix http
is used throughout this document to denote this namespace. For content representations in RDF (see [Content in RDF]) the prefix tbd
@@@TBD@@@ is used for the namespace http://www.w3.org/2007/tbd#
@@@TBD@@@.
By default, the vocabulary introduced by this document uses names starting with upper-case letters for classes and names starting with lower-case letters for properties.
[Editor's Note: the Working Group is intending to elaborate and better describe the use cases listed below. The Working Group invites contribution and suggestions for further use cases.]
The following (non-exhaustive) list of use cases aims to highlight some of the different usages of this vocabulary:
@@@TBD@@@ I think there was another use case in one of the comments to the previous document.
This section defines RDF terms for the HTTP 1.1 specification according to [RFC 2616].
A resource of type Connection
represents a connection that is used for the HTTP transfer. The following properties may appear in nodes of type Connection
:
connectionAuthority
requests
Request
resources.Example 2.1: A Connection
resource.
<http:Connection rdf:ID="conn"> <http:connectionAuthority>www.example.org:80</http:connectionAuthority> <http:requests rdf:parseType="Collection"> <http:Request rdf:about="#req0"/> <http:Request rdf:about="#req1"/> </http:requests> </http:Connection>
A resource of type Message
represents an HTTP message. The following properties may appear in resources of type Message
:
httpVersion
dc:date
headers
MessageHeader
resources,body
Example 2.2: A Message
resource.
<http:Message rdf:ID="mes0"> <http:httpVersion>1.1</http:httpVersion> <dc:date>2007-09-13</dc:date> <http:headers rdf:parseType="Collection"> <http:MessageHeader rdf:about="#reqh0"/> <http:MessageHeader rdf:about="#reqh1"/> </http:headers> </http:Message>
There are two subclasses from the Message
class: Request
and Response
.
The body
property represents an HTTP entity body as defined in [RFC 2616]. It can appear in resources of both type Request
or Response
. The object for this property must be a resource of the type tbd:Content
or a subclass thereof. HTTP bodies are series of bytes. So it is always possible to point to a tbd:ByteContent
resource. If the body is textual content, you can also point to a tbd:TextContent
resource. If the body is XML content, you can also point to a tbd:XMLContent
resource (see [Content in RDF] for more information on content representations in RDF).
Editor's Note: How to model the use of various representations (ByteContent, TextContent, XMLContent) for the same entity body? Would an rdf:Alt be a solution?.
The Request
class is a subclass of the Message
class. A resource of this type represents an HTTP request. Additional to the properties mentioned in 2.2 Message Class, the following properties may appear in resources of type Request
:
methodName
method
Method
resource representing the HTTP method (optional, see 3.1. Methods),requestURI
response
Response
resource representing the response resulting from this request (see 2.4. Response Class).The dc:date
property when used in a Request
resource represents the date the request was sent by the client.
Example 2.3: A Request
resource.
<http:Request rdf:ID="req0"> <http:httpVersion>1.1</http:httpVersion> <http:methodName>GET</http:methodName> <http:method rdf:resource="http://www.w3.org/2006/http-methods#GET"/>@@@TBD@@@ <http:abs_path>/</http:abs_path> <http:headers rdf:parseType="Collection"> <http:MessageHeader rdf:about="#reqH0"/> <http:MessageHeader rdf:about="#reqH1"/> </http:headers> <http:response rdf:resource="#resp0"/> </http:Request>
The requestURI
property represents the request URI as specified in section 5.1.2 of [RFC 2616]. The value of the property is either the constant value http:asterisk
or a Literal value of the absolute URI, the absolute path, or an authority. This vocabulary defines the following sub-properties to reference these values:
absoluteURI
abs_path
authority
Example 2.4: The use of the requestURI
property and its sub-properties.
<http:Request> <http:methodName>OPTIONS</http:methodName> <http:requestURI rdf:resource="http://www.w3.org/2006/http#asterisk"/> ... </http:Request>
<http:Request> <http:methodName>GET</http:methodName> <http:absoluteURI>http://www.example.org:80/foo/bar</http:absoluteURI> ... </http:Request>
<http:Request> <http:methodName>GET</http:methodName> <http:abs_path>/foo/bar</http:abs_path> ... </http:Request>
<Request> <http:methodName>CONNECT</http:methodName> <http:authority>www.example.org:80</http:authority> ... </Request>
The Response
class is a subclass of the Message
class. A resource of this type represents an HTTP response as defined in [RFC 2616]. Additional to the properties mentioned in 2.2 Message Class, the following properties may appear in resources of type Response
:
statusCodeNumber
statusCode
StatusCode
resource representing the status code (optional, see 3.2. Status Codes),reasonPhrase
The dc:date
property when used in a Response
resource represents the date the response was received by the client.
Example 2.5: A Response
resource.
<http:Response rdf:ID="resp0"> <http:httpVersion>1.1</http:httpVersion> <http:statusCodeNumber>200</http:statusCodeNumber> <http:statusCode rdf:resource="http://www.w3.org/2006/http-statusCodes#200"/>@@@TBD@@@ <http:headers rdf:parseType="Collection"> <http:MessageHeader rdf:about="#respH0"/> <http:MessageHeader rdf:about="#respH1"/> </http:headers> <http:body> <tbd:Content rdf:about="#respC0"/> </http:body> </http:Response>
A resource of type MessageHeader
represents an HTTP header. The following properties may appear in resources of type MessageHeader
:
fieldName
headerName
HeaderName
resource representing the header name (optional, see 3.4. Header Names),fieldValue
headerElements
HeaderElement
resources (optional).Example 2.6: A MessageHeader
resource.
<http:MessageHeader rdf:ID="reqH0"> <http:fieldName>Accept</http:fieldName> <http:headerName rdf:resource="http://www.w3.org/2006/http-headers#accept"/>@@@TBD@@@ <http:fieldValue>text/html, image/png, image/gif;q=0.8</http:fieldValue> <http:headerElements rdf:parseType="Collection"> <http:HeaderElement rdf:about="#he0"/> <http:HeaderElement rdf:about="#he1"/> <http:HeaderElement rdf:about="#he2"/> </http:headerElements> </http:MessageHeader>
A resource of type HeaderElement
represents an element in a header value. The following properties may appear in resources of type HeaderElement
:
elementName
elementValue
params
Param
resources (optional).Example 2.7: A HeaderElement
resource.
<http:HeaderElement rdf:ID="he0"> <http:elementName>image/gif</http:elementName> <http:params rdf:parseType="Collection"> <http:Param rdf:about="#param0"/> </http:params> </http:HeaderElement>
A resource of type Param
represents an element in a header value parameter. The following properties may appear in resources of type Param
:
paramName
paramValue
Example 2.8: A Param
resource.
<http:Param rdf:ID="param0"> <http:paramName>q</http:paramName> <http:paramValue>0.8</http:paramValue> </http:Param>
This section defines RDF terms for the predefined resources representing values used in HTTP 1.1 specification according to [RFC 2616] or other specifications.
The HTTP 1.1 specification defines eight methods: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT. The resource at http://www.w3.org/2006/http-methods
@@@TBD@@@ provides Method
resources for each of these to be used as objects for the method
property.
A resource of type Method
represents the name of a method used with HTTP.
[HTTP Status Codes] is a registry for status codes too be used in HTTP. The resource at http://www.w3.org/2006/http-statusCodes
@@@TBD@@@ provides StatusCode
resources for each of these to be used as objects for the statusCode
property.
A resource of type StatusCode
represents a status code.
Status codes in HTTP may be grouped. The resource at http://www.w3.org/2006/http-statusCodes
@@@TBD@@@ provides StatusCodeGroup
resources for some groupings of status codes.
A resource of type StatusCodeGroup
represents a group of status codes.
[RFC4229] is a registry of header names to be used in HTTP. The resource at http://www.w3.org/2006/http-headers
@@@TBD@@@ provides HeaderName
resources for each of these to be used as objects for the headerName
property.
A resource of type HeaderName
represents the name of a header used with HTTP.
There are also noteable schema limitations with regards to security and privacy since the content recorded by this vocabulary could potentially contain sensitive information. For example authentication information in HTTP headers or other information (login user name, passwords, etc.) within the body of the message. Since the schema of this document is limited to terms defined by the HTTP vocabulary, security and privacy considerations need to be made at the application level. For example, certain parts of the data may be restricted to appropriate user permissions or obfuscated.
The following terms are defined by this specification:
Class name | Label | Allowable types | Required properties | Optional properties |
---|---|---|---|---|
http:Connection |
Connection | http:connectionAuthority |
http:requests |
|
http:HeaderElement |
Header Element | http:elementName |
http:elementValue ,
http:params |
|
http:HeaderName |
Header Name | |||
http:Message |
Message | http:Request, http:Response | http:httpVersion |
dc:date ,
http:body ,
http:headers |
http:MessageHeader |
Message header | http:fieldName ,
http:fieldValue |
http:headerName ,
http:headerElements |
|
http:Method |
Method | |||
http:Param |
Parameter | http:paramName ,
http:paramValue |
||
http:Request |
Request | http:methodName , http:requestURI |
http:method ,
http:response |
|
http:Response |
Response | http:statusCodeNumber ,
http:reasonPhrase |
http:statusCode |
|
http:StatusCode |
Status Code | |||
http:StatusCodeGroup |
Status Code Group |
Property name | Label | Domain | Range | Restriction |
---|---|---|---|---|
http:body |
Entity body | http:Message |
tbd:Content @@@TBD@@@ |
At most one per http:Message |
http:connectionAuthority |
Connection authority | http:Connection |
RDF Literal | Exactly one per http:Connection |
http:elementName |
Header element name | http:HeaderElement |
RDF Literal | Exactly one per http:HeaderElement |
http:elementValue |
Header element value | http:HeaderElement |
RDF Literal | Exactly one per http:HeaderElement |
http:fieldName |
Field name | http:MessageHeader |
RDF Literal | Exactly one per http:MessageHeader |
http:fieldValue |
Field value | http:MessageHeader |
RDF Literal | Exactly one per http:MessageHeader |
http:headerElements |
Header elements | http:MessageHeader |
Collection of http:HeaderElement |
At most one per http:MessageHeader |
http:headerName |
Header name | http:MessageHeader |
http:HeaderName |
At most one per http:MessageHeader |
http:headers |
Headers | http:Message |
Collection of http:MessageHeader |
At most one per http:Message |
http:httpVersion |
HTTP Version | http:Message |
RDF Literal | Exactly one per http:Message |
http:method |
Header name | http:Request |
http:Method |
At most one per http:Request |
http:methodName |
Field name | http:Request |
RDF Literal | Exactly one per http:Request |
http:paramName |
Parameter name | http:Param |
RDF Literal | Exactly one per http:Param |
http:params |
Parameters | http:HeaderElement |
Collection of http:Param |
At most one per http:HeaderElement |
http:paramValue |
Parameter value | http:Param |
RDF Literal | Exactly one per http:Param |
http:reasonPhrase |
Reason phrase | http:Response |
RDF Literal | Exactly one per http:Response |
http:requests |
Requests | http:Connection |
Collection of http:Request |
At most one per http:Connection |
http:requestURI |
Request URI | http:Request |
RDF Literal | Exactly one per http:Request |
http:response |
Response | http:Request |
http:Response |
At most one per http:Request |
http:statusCode |
Status code | http:Response |
http:StatusCode |
At most one per http:Response |
http:statusCodeNumber |
Status code number | http:Response |
RDF Literal | Exactly one per http:Response |
Value Name | Label | Used in | Description |
---|---|---|---|
http:asterisk |
Asterisk | http:requestURI |
An asterisk used as request URI |
The following example shows an RDF/XML representation of an HTTP request and response pair.
A client sends two requests to a server at www.example.org
port 80 via HTTP 1.1 GET. With each request, it sends request headers. The first request is for a resource in the document root (/
), the second for a resource at /image
. While handling the second request the server performs content negotiation respecting the request's Accept
header and so sends a PNG image. This is indicated by the response's Vary
header.
<?xml version="1.0" encoding="utf-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:http="http://www.w3.org/2006/http#" xmlns:tbd="http://www.w3.org/2007/tbd#"@@@TBD@@@ > <http:Connection rdf:ID="conn"> <http:connectionAuthority>www.example.org:80</http:connectionAuthority> <http:requests rdf:parseType="Collection"> <http:Request rdf:about="#req0"/> <http:Request rdf:about="#req1"/> </http:requests> </http:Connection> <http:Request rdf:about="#req0"> <http:httpVersion>1.1</http:httpVersion> <http:methodName>GET</http:methodName> <http:method rdf:resource="http://www.w3.org/2006/http-methods#GET"/>@@@TBD@@@ <http:abs_path>/</http:abs_path> <http:headers rdf:parseType="Collection"> <http:MessageHeader> <http:fieldName>Host</http:fieldName> <http:headerName rdf:resource="http://www.w3.org/2006/http-headers#host"/>@@@TBD@@@ <http:fieldValue>www.example.org</http:fieldValue> </http:MessageHeader> <http:MessageHeader> <http:fieldName>User-Agent</http:fieldName> <http:headerName rdf:resource="http://www.w3.org/2006/http-headers#user-agent"/>@@@TBD@@@ <http:fieldValue>My User Agent</http:fieldValue> </http:MessageHeader> <http:MessageHeader> <http:fieldName>Accept</http:fieldName> <http:headerName rdf:resource="http://www.w3.org/2006/http-headers#accept"/>@@@TBD@@@ <http:fieldValue>text/html, image/png, image/gif;q=0.8</http:fieldValue> <http:headerElements rdf:parseType="Collection"> <http:HeaderElement> <http:elementName>text/html</http:elementName> </http:HeaderElement> <http:HeaderElement> <http:elementName>image/png</http:elementName> </http:HeaderElement> <http:HeaderElement> <http:elementName>image/gif</http:elementName> <http:params rdf:parseType="Collection"> <http:Param> <http:paramName>q</http:paramName> <http:paramValue>0.8</http:paramValue> </http:Param> </http:params> </http:HeaderElement> </http:headerElements> </http:MessageHeader> </http:headers> <http:response rdf:resource="#resp0"/> </http:Request> <http:Request rdf:about="#req1"> <http:httpVersion>1.1</http:httpVersion> <http:methodName>GET</http:methodName> <http:method rdf:resource="http://www.w3.org/2006/http-methods#GET"/>@@@TBD@@@ <http:abs_path>/image</http:abs_path> <http:headers rdf:parseType="Collection"> <http:MessageHeader> <http:fieldName>Host</http:fieldName> <http:headerName rdf:resource="http://www.w3.org/2006/http-headers#host"/>@@@TBD@@@ <http:fieldValue>www.example.org</http:fieldValue> </http:MessageHeader> <http:MessageHeader> <http:fieldName>User-Agent</http:fieldName> <http:headerName rdf:resource="http://www.w3.org/2006/http-headers#user-agent"/>@@@TBD@@@ <http:fieldValue>My User Agent</http:fieldValue> </http:MessageHeader> <http:MessageHeader> <http:fieldName>Accept</http:fieldName> <http:headerName rdf:resource="http://www.w3.org/2006/http-headers#accept"/>@@@TBD@@@ <http:fieldValue>image/png, image/gif;q=0.8</http:fieldValue> <http:headerElements rdf:parseType="Collection"> <http:HeaderElement> <http:elementName>image/png</http:elementName> </http:HeaderElement> <http:HeaderElement> <http:elementName>image/gif</http:elementName> <http:params rdf:parseType="Collection"> <http:Param> <http:paramName>q</http:paramName> <http:paramValue>0.8</http:paramValue> </http:Param> </http:params> </http:HeaderElement> </http:headerElements> </http:MessageHeader> </http:headers> <http:response rdf:resource="#resp1"/> </http:Request> <http:Response rdf:ID="resp0"> <http:httpVersion>1.1</http:httpVersion> <http:statusCodeNumber>200</http:statusCodeNumber> <http:statusCode rdf:resource="http://www.w3.org/2006/http-statusCodes#200"/>@@@TBD@@@ <http:reasonPhrase>OK</http:reasonPhrase> <http:headers rdf:parseType="Collection"> <http:MessageHeader> <http:fieldName>Date</http:fieldName> <http:headerName rdf:resource="http://www.w3.org/2006/http-headers#date"/>@@@TBD@@@ <http:fieldValue>.......</http:fieldValue> </http:MessageHeader> <http:MessageHeader> <http:fieldName>Content-Type</http:fieldName> <http:headerName rdf:resource="http://www.w3.org/2006/http-headers#content-type"/>@@@TBD@@@ <http:fieldValue>text/html; charset=utf-8</http:fieldValue> <http:headerElements rdf:parseType="Collection"> <http:HeaderElement> <http:elementName>text/html</http:elementName> <http:params rdf:parseType="Collection"> <http:Param> <http:paramName>charset</http:paramName> <http:paramValue>utf-8</http:paramValue> </http:Param> </http:params> </http:HeaderElement> </http:headerElements> </http:MessageHeader> </http:headers> <http:body> <tbd:XMLContent> <tbd:xmlLeadingMisc rdf:parseType="Literal"><!-- This is the start of the document --> </tbd:xmlLeadingMisc> <tbd:docTypeDecl> <tbd:DocTypeDecl> <tbd:dtdName>html</tbd:dtdName> <tbd:publicId>-//W3C//DTD XHTML 1.0 Strict//EN</tbd:publicId> <tbd:systemId rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</tbd:systemId> </tbd:DocTypeDecl> </tbd:docTypeDecl> <tbd:xmlRest rdf:parseType="Literal"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>My document</title> </head> <body> <p><!-- ...... --></p> </body> </html></tbd:xmlRest> </tbd:XMLContent> </http:body> </http:Response> <http:Response rdf:ID="resp1"> <http:httpVersion>1.1</http:httpVersion> <http:statusCodeNumber>200</http:statusCodeNumber> <http:statusCode rdf:resource="http://www.w3.org/2006/http-statusCodes#200"/>@@@TBD@@@ <http:reasonPhrase>OK</http:reasonPhrase> <http:headers rdf:parseType="Collection"> <http:MessageHeader> <http:fieldName>Date</http:fieldName> <http:headerName rdf:resource="http://www.w3.org/2006/http-headers#date"/>@@@TBD@@@ <http:fieldValue>.......</http:fieldValue> </http:MessageHeader> <http:MessageHeader> <http:fieldName>Content-Type</http:fieldName> <http:headerName rdf:resource="http://www.w3.org/2006/http-headers#content-type"/>@@@TBD@@@ <http:fieldValue>image/png</http:fieldValue> </http:MessageHeader> <http:MessageHeader> <http:fieldName>Vary</http:fieldName> <http:headerName rdf:resource="http://www.w3.org/2006/http-headers#vary"/>@@@TBD@@@ <http:fieldValue>accept</http:fieldValue> <http:headerElements rdf:parseType="Collection"> <http:HeaderElement> <http:elementName>accept</http:elementName> </http:HeaderElement> </http:headerElements> </http:MessageHeader> </http:headers> <http:body> <tbd:Base64Content> <tbd:bytes rdf:datatype="http://www.w3.org/2001/XMLSchema#base64Binary">qouh3908t38hohfrf..........</tbd:bytes> </tbd:Base64Content> </http:body> </http:Response> </rdf:RDF>
The following is a list of changes since the 20 December, 2006 Working Draft:
http:Connection
class to describe the actual TCP connectionhttp:response
property to the request class to relate responseshttp:responseCode
property