PML example: Parsing an HTTP header in a pmlp:Information's hasRawString

From Inference Web

Jump to: navigation, search

(draft example; see iw:PML Primer for an introduction to PML.)

by: Tim Lebo



PML justifies by annotating. Existing information can provide additional information by subsequent processing, and that processing can be documented by adding additional descriptions to the existing data.

An example

One application is concerned with crawling a few pages and capturing their HTTP headers. It is currently only concerned with the last-modified attribute, but captures the entire header to provide additional context for its operations. It's current requirements do not motivate parsing the entire HTTP header, and it is not easy to because the utility is not available or there is no time to find one.

   a pmlp:Information;
   rdfs:seeAlso    <>;
   pmlp:hasRawString """HTTP/1.1 200 OK^M
Server: Microsoft-IIS/6.0^M
X-Powered-By: PHP/5.2.9^M
Content-Type: text/html^M
X-Pad: avoid browser bug^M
Date: Mon, 20 Sep 2010 18:11:54 GMT^M
Connection: keep-alive^M
   pmlp:hasReferenceSourceUsage <sourceUsage_9ccc0859-2831-453b-a71c-46a7e4e091ed_redirected_url_header>;

Later, an application IS concerned about the full HTTP header information and spends the time to build or find a header parser. This application can access the existing information and augment it with its new granular and query-able parsed HTTP header information. The HTTP header parser can be identified as providing this additional information.

The process to document

The process documentation

Personal tools