KID URIs


General description

A Uniform Resource Identifier (URI) is a compact string of characters for identifying an abstract or physical resource. A KID URI is a character string for identifying a source of KLOE events.

The syntax of a KID URI is as follows:

protocol : protocol-specific-parameters ? options

where:

KID modular structure allows for a variety of modules to be used at the same time by an application. Several standard modules are present in the KID package, but also any user-provided module can be easily linked in an application and used.


URI splitting

Since a URI can contain another URI inside the protocol-specific-parameters part, it is important to understand the mechanism by which an URI get split in the three components.

Two phases (in the given order) are performed inside the KID package:

  1. the protocol get separated from the rest of the URI
  2. the remaining part get splitted into the protocol-specific-parameters and options parts.

The first phase is acchieved by looking for the first : character in the URI. Where the first instance of the character is found, the URI get split. (Follows some examples.)
spy:/tmp/myfile.yb =>
spy : /tmp/myfile.yb
dbfile:raw014473N_ALL_f04_1_1_1.002?group_id=USER =>
dbfile : raw014473N_ALL_f04_1_1_1.002?group_id=USER
merge:(remote:spy:/tmp/B_L3BHA_1_1@fibm05?max_events_per_packet=10?,remote:spy:/tmp/B_L3BHA_1_1@fibm06?max_events_per_packet=10?)?mode=ANY&partial=T
||
V
merge : (remote:spy:/tmp/B_L3BHA_1_1@fibm05?max_events_per_packet=10,remote:spy:/tmp/B_L3BHA_1_1@fibm06?max_events_per_packet=10)?mode=ANY&partial=T

The second phase is acchieved by looking for the last ? character in the remaining string. Where (and if) the first instance, looking backwards, of the character is found, the URI get split. (Follows some examples.)
/tmp/myfile.yb =>
/tmp/myfile.yb    
raw014473N_ALL_f04_1_1_1.002?group_id=USER =>
raw014473N_ALL_f04_1_1_1.002 ? group_id=USER
(remote:spy:/tmp/B_L3BHA_1_1@fibm05?max_events_per_packet=10,remote:spy:/tmp/B_L3BHA_1_1@fibm06?max_events_per_packet=10)?mode=ANY&partial=T
||
V
(remote:spy:/tmp/B_L3BHA_1_1@fibm05?max_events_per_packet=10,remote:spy:/tmp/B_L3BHA_1_1@fibm06?max_events_per_packet=10) ? mode=ANY&partial=T

From the above examples can be deduced that a URI is valid also if it does not contain any ? character. This is certainly true, but is it recomended to put the final ? character also in cases when it is not strictly necessary. This is especially true for the automatic generation of URIs; when an URI is nested into another URI, its semantics can change significantly depending if the final ? is used or not. (Follows an example.)
merge:spy:/tmp/B_1_1?maxevt=1,spy:/tmp/B_2_1?maxevt=1? =>
merge : spy:/tmp/B_1_1?maxevt=1,spy:/tmp/B_2_1?maxevt=1 ?  
 
merge:spy:/tmp/B_1_1?maxevt=1,spy:/tmp/B_2_1?maxevt=1 =>
merge : spy:/tmp/B_1_1?maxevt=1,spy:/tmp/B_2_1 ? maxevt=1
WRONG!


Some more examples:


Send comments to: Igor Sfiligoi

Last modified: Fri Aug 4 19:36:17 MET DST