Ora Lassila, World Wide Web Consortium (W3C) & Nokia Research Center / Boston
Version 1, 2/20/97
This document is a suggestion for the new label syntax for PICS. It is intended as a starting point for discussion on the new PICS.
The mew syntax allows PICS labels to be parsed as standard s-expressions, without interpretation during the parsing process, and allows for a richer type system for rating values. This in turn will take PICS closer to a universal metadata communication mechanism.
[ NOTE: Currently, this document only gives a rather skeletal description of the new syntax and relies heavily on the PICS 1.1 specification. Later, it can be turned into a stand-alone document. ]
There are really several levels to describing the syntax of PICS labels. If we go with the basic definition that PICS labels are s-expressions, we can describe their syntax by giving the structure of the s-expressions we accept as valid PICS labels. This definition, however, will need clarifications as to the types of values accepted as components of the described structure. These clarifications are given in sections 3 and 4.
LabelManifest | :: | '(' Version OptionList Label* ')' | |
Version | :: | Symbol | See Note 1. |
OptionList | :: | '(' Option* ')' | |
Option | :: | OptionName Value | See Section 2 for a description of Option structure. |
OptionName | :: | Symbol | See Note 2. |
Label | :: | LabelList | PrimitiveLabel | Error | |
LabelList | :: | '(' 'list' OptionList Label* ')' | |
PrimitiveLabel | :: | '(' 'label' OptionList Attribute* ')' | |
Attribute | :: | AttributeName Value | |
AttributeName | :: | Symbol | URLString | |
URLString | :: | '"' URL '"' | |
Value | :: | String | Symbol | Boolean | Range | '(' Value* ')' | |
Range | :: | Number | '(' 'range' Number Number ')' | See Notes 3 and 5. |
Number | :: | NumberLiteral | '-inf' | '+inf' | |
Boolean | :: | 'true' | 'false' | See note 5. |
Error | :: | '(' 'error' ErrorType Value* ')' | See Section 3 for a description of errors. |
ErrorType | :: | Symbol | See Note 4. |
Notes
Options can be divided into three categories - document options, label options and other options - and their syntax can be defined in detail.
Option | :: | DocumentOption | LabelOption | OtherOption |
DocumentOption | :: | 'at' ISODate | 'md5' Value |
LabelOption | :: | 'by' String | 'generic' Boolean | 'for' URLString | 'on' ISODate | 'until' ISODate | 'name' Symbol | 'service' URLString | 'dsig' Value |
OtherOption | :: | 'comment' String | 'full' URLString | 'extension' Extension |
Extension | :: | '(' MandOpt URLString value* ')' |
MandOpt | :: | 'mandatory' | 'optional' |
Notes:
Errors can be defined in more detail like this:
Error | :: | '(' 'error' ErrorBody ')' |
ErrorBody | :: | NoRatingsError | RequestDeniedError | ServiceUnavailableError | NotLabeledError |
NoRatingsError | :: | 'no-ratings' String* |
RequestDeniedError | :: | 'request-denied' [ DenialExplanation ] |
DenialExplanation | :: | String* | '(' URL String* ')' |
ServiceUnavailableError | :: | 'service-unavailable' |
NotLabeledError | :: | 'not-labeled' URL* |
Here are definitions for some of the "literal" entities of the syntax:
Symbol | any sequence of characters not containing whitespace nor any of the following characters: ( ) " |
NumberLiteral | defined as number in the PICS 1.1 spec. |
String | defined as quotedname in the PICS 1.1 spec. |
URL | as defined in the PICS Rating Services and Rating Systems. |
ISODate | a String, representing a date but restricted from the ISO standard, as described by the PICS 1.1 spec. |
Here are some of the examples from the PICS 1.1 document, modified for the new syntax:
PICS 1.1 |
PICS NG |
|
(PICS-1.1 "http://www.gcf.org/v2.5" by "John Doe" labels on "1994.11.05T08:15-0500" until "1995.12.31T23:59-0000" for "http://w3.org/PICS/Overview.html" ratings (suds 0.5 density 0 color/hue 1) for "http://w3.org/PICS/Underview.html" by "Jane Doe" ratings (subject 2 density 1 color/hue 1)) |
(PICS-2.0 (service "http://www.gcf.org/v2.5" by "John Doe") (label (on "1994.11.05T08:15-0500" until "1995.12.31T23:59-0000" for "http://w3/org/PICS/Overview.html") suds 0.5 density 0 color/hue 1) (label (for "http://w3/org/PICS/Underview.html" by "Jane Doe") subject 2 density 1 color/hue 1)) |
|
(PICS-1.1 "http://www.gcf.org/v2.5" l r (suds 0.5 density 0 color/hue 1) r (subject 2 density 1 color/hue 1)) |
(PICS-2.0 (service "http://www.gcf.org/v2.5") (label () suds 0.5 density 0 color/hue 1) (label () subject 2 density 1 color/hue 1)) |