W3C

Up to cover page | Back to WebCGM Concepts | On to WebCGM Profile


3 WebCGM Intelligent Content

3.1 Addressing Pictures and Objects

3.1.1 URI Fragment specification

The URI (Uniform Resource Identifier) is how resources are identified on the Internet. For example, a CGM file called web.cgm located on the CGM Open web site might have the following URI:

http://www.cgmopen.org/web.cgm

Pictures and objects (application structures) within a WebCGM are addressed using the mechanism of the URI fragment. These WebCGM rules are derived from and are consistent with the Web protocols defined in RFC 1738 and RFC 1808.

A URI fragment is the separator character " # " appended to the main part of the URI or the "base", followed by a string. The fragment string is usually specific only to a particular class of applications. This clause defines the WebCGM fragment which allows CGM viewers, web browsers, scripting engines, and other applications to address (point to) specific pictures and objects within pictures in CGM files.

The base URI is terminated by "#", and a fragment is appended which defines the picture, object, and the desired viewer behavior. The URI fragment syntax is based on concepts described in the XML Pointer Language(Xpointer). The URI fragment syntax is defined below. The formal grammar for the WebCGM fragment is given using a simple Extended Backus-Naur Form (EBNF) notation.

webcgmfragment ::= picterm "." objterm | 
			picterm |
			objterm  |
			picid "." objid |
			objid

picterm ::= pictureid | pictsequence

pictureid ::= "pictid("   picid   (","  behavior)? ")"

picid ::= (namechar)+

behavior ::= "$$new_window" | "$$replace" | "$$replace_in_container"
			| target

target ::= (namechar)+

pictsequence ::= "pictseqno(" picseqno ("," behavior)? ")"

picseqno ::= [0-9]+

objterm ::= objectid | objectname

objectid ::= "id("   objid   ("," objbehavior)? ")"

objid ::= (namechar)+

objbehavior ::= "view_context" | "highlight" | "highlight_all"

objectname ::= "name("   objname  ("," objbehavior)? ")"

objname ::= (namechar)+

namechar ::= digit | lowalpha | hialpha | namesafe 

lowalpha ::= "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" |
           "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" |
           "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"

hialpha ::=  "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" |
           "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" |
           "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z"

digit ::=    "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

namesafe ::= "$" | "-" | "_" | "+"

3.1.2 Fragment Parameters

3.1.2.1 Picture Selection Keywords

pictid - the id of the picture to be viewed. The id parameter in the BEGIN PICTURE element. If the metafile does not contain a picture with matching id, the first picture in the metafile is chosen.

picseqno - the sequence number of the picture to be viewed. "1" is the first picture, "2" is the second picture, etc. If picseqno exceeds the number of pictures in the metafile, the last picture is displayed.

3.1.2.2 Picture Behaviors

$$new_window - display the CGM in a new window.

$$replace - remove the existing content from the viewer and replace it with the referenced cgm in the same window. This is the default behavior.

$$replace_in_container - remove the existing content from the window which contains the viewer's window, and display the CGM in this window.

target - remove the existing content from the frame whose name matches the string and display the CGM in the frame. If no frame exists by the specified name, default to the $$new_window behavior.

3.1.2.3 Object Selection Keywords

id - the id of the APS of type 'grobject', 'para' or 'subpara' to be selected. The id parameter in the BEGIN APS element. If no match is found in the picture, no object is selected.

name - the value of the 'name' attribute in an object (grobject, para, or subpara APS). This is an alternate way to address objects. The first object in the picture which contains a name attribute with a matching value is selected. If no match is found in the picture, no grobject is selected. If more than one match is found in the picture the 'highlight_all' behavior can be used to highlight all selected objects.

3.1.2.4 Object Behaviors

view_context - If a 'ViewContext' attribute exists for the object APS, display only the rectangular region of the picture defined in the ViewContext attribute, and highlight the object. If no ViewContext attribute exists in the object, the highlight behavior should be implemented. This is the default behavior.

highlight - highlight the first object selected and ignore the ViewContext attribute, if present.

highlight_all - highlight all objects selected.

3.1.3 Examples

3.1.3.1 Preliminaries

The WebCGM fragment in its most verbose form provides the means to address objects in single or multiple picture metafiles and tell the viewer what to do to execute the link. The default viewer behavior defines what the browser should do if the WebCGM fragment does not explicitly define the viewer behavior.

The following examples illustrate some of the ways the WebCGM fragment can be used. The examples describe how one might address the CGM file "engine.cgm" which is stored on the CGM Open website (http://www.cgmopen.org/webcgm/). The CGM file contains various pictures of an engine assembly - the top view, the front view, the right view, the left view, and the isometric view. The pictures are ordered sequentially in the CGM file and identified as follows:

Picture 1: picid="top"

Picture 2: picid="front"

Picture 3: picid="right"

Picture 4: picid="left"

Picture 5: picid="iso"

Each picture in the CGM file contains several identifiable objects - the oil pump, the cylinder head, the fan, the radiator, or the distributer. Not all objects are shown in all views.

The objects contained in each picture are as follows:

Picture 1:

Oil pump: id='oil-pump-t' name='lube-system'

Cylinder head: id='cyl-hd-t' name='engine'

Fan: id='fan-t' name='cooling'

Radiator: id='rad-t' name='cooling'

Distributer: id='dist-t' name='ignition'

Picture 2:

Oil pump: id='oil-pump-f' name='lube-system'

Cylinder head: id='cyl-hd-f' name='engine'

Fan: id='fan-f' name='cooling'

Radiator: id='rad-f' name='cooling'

Distributer: id='dist-f' name='ignition'

Picture 3:

Oil pump: id='oil-pump-r' name='lube-system'

Cylinder head: id='cyl-hd-r' name='engine'

Fan: id='fan-r' name='cooling'

Radiator: id='rad-r' name='cooling'

Picture 4:

Cylinder head: id='cyl-hd-l' name='engine'

Fan: id='fan-l' name='cooling'

Radiator: id='rad-l' name='cooling'

Distributer: id='dist-l' name='ignition'

Picture 5:

Oil pump: id='oil-pump-i' name='lube'

Cylinder head: id='cyl-hd-i' name='engine'

Fan: id='fan-i' name='cooling'

Radiator: id='rad-i' name='cooling'

Distributer: id='dist-i' name='ignition'

3.1.3.2 Example 1

http://cgmopen.org/webcgm/engine.cgm#pictid(top,$$new_window).id(cyl-hd-t,highlight)

When used as the value of the URI attribute in a object in a CGM file, this example retrieves engine.cgm cgm file from the cgmopen.org web site and displays the picture named "top" in a new window, highlighting the object with an id of "cyl-hd-t". The existing display remains. The entire picture is displayed, regardless of the existence of a view context for the object "cyl-hd-t".

3.1.3.3 Example 2

http://cgmopen.org/webcgm/engine.cgm#pictid(top).id(oil-pump-t,highlight)

When used as the URL in an OBJECT element in HTML, this example displays the CGM with the default picture behavior (replace), displaying the whole of "top" with the pump highlighted. Since "top" is the first picture in the file, if we had used the name "top-view" the visual result would have been the same, since "top" is the first picture in the file.

3.1.3.4 Example 3

http://cgmopen.org/webcgm/engine.cgm#pictseqno(5,topframe).id(dist-i,view_context)

This example retrieves the engine.cgm cgm file from the cgmopen.org web site and displays the fifth picture in the metafile in the frame named "topframe", highlighting the object with an id of "dist-i". The view context (if present) attribute for the object "dist-i" is used to determine the rectangular portion of the picture to display in the frame.

Shorthand WebCGM fragments are also allowed. Some examples of these shorthand forms follow:

3.1.3.5 Example 4

http://cgmopen.org/webcgm/engine.cgm#pictseqno(2,topframe)

This example retrieves the engine.cgm CGM file from the cgmopen.org web site and displays the second picture in the metafile in the frame named "topframe".

3.1.3.6 Example 5

http://cgmopen.org/webcgm/engine.cgm#name(cooling)

This example retrieves the engine.cgm cgm file from the cgmopen.org web site and displays the first (default) picture in the metafile. The first object containing a name attribute with value "cooling" is highlighted and the view context attribute, if it exists, is used to define the rectangular area of the picture to display.

3.1.3.7 Example 6

http://cgmopen.org/webcgm/engine.cgm#fan-t

This example retrieves the engine.cgm cgm file from the cgmopen.org web site and displays the first (default) picture in the metafile. The object with id "fan-t" is highlighted and the view context attribute of the object, if it exists, is used to define the rectangular area of the picture to display.

3.1.3.8 Example 7

#id(oil-pump-t)

This example will highlight the object "oil-pump-t" in the currently displayed picture and the view context attribute, if it exists for the object "oil-pump-t", is used to define the rectangular area of the picture to display. The address fragment could be shortened even further to "#oil-pump-t"

3.1.4 Addressing one of several viewers from HTML

Often, applications will display several pictures in a single HTML page. The only way to address the cgm viewer instance that is responsible for the display of a particular picture is via the "object" tag defined in HTML 4.0. The CGM defined by the object tag can be uniquely addressed using the <name> parameter of the object tag. However, the specific syntax for addressing a specific CGM in a HTML page is not standardized.

The Document Object Model (DOM) is currently under development. This work, when completed, is expected to provide a standard basis for addressing this problem.

3.2 Application Structure and APS Attribute Descriptions

3.2.1 Application Structures

WebCGM has four APS types: layer, grobject, para, and subpara. This document uses the term "object" to refer to an APS of type 'grobject', 'para', and 'subpara'.

3.2.1.1 Grobject

Description. The application structure (APS) of type 'grobject' is used to group graphical primitives in a picture together and assign certain attributes to the group. The object is geometrically identified either by the set of primitives enclosed between the BEGIN APS and END APS elements (if any), or by the spatial region associated with the 'region' APS Attribute (if present). 'Grobject' APSs may contain any CGM graphical content allowed by this profile, and may contain other APS and APS attribute content as defined in section 3.3 (the complete, normative WebCGM content model).

Viewer Behavior. A 'grobject' APS may be selected by the user ("pick"). The viewer should decide about the pick selection in the following manner:

  1. If the object does not contain a 'region' attribute and contains no a LinkURI attributes no further action is required.
  2. If the object contains at least one 'LinkURI' attribute but no 'region' attribute, a click on non-transparent areas of the graphical elements of the object selects the object. If the object does not contain any graphical primitives no further action is required. If the object contains more than one LinkURI attribute, the user shall be given a choice of which URI to navigate.
  3. If the object contains a 'region' attribute and contains at least one LinkURI attribute, then the 'region' should be used for selection. If the object contains more than one LinkURI attribute, the user shall be given a choice of which URI to navigate.
  4. If the object contains a 'region' attribute but no LinkURI attributes no further action is required.

It is possible that a user selection ("pick") of a object in a displayed WebCGM picture may not have a single unambiguous result - the cursor location may reside within the geometric extent or 'region' of more than one APS. In such a case, the pick priority is as follows:

  1. If the pick has selected only one APS, then it is the one which is picked;
  2. If the pick has selected more than one APS, and the APSs are not nested, then the APS with the highest pick priority is the one whose picking region occurs latest in the picture (see the 'region' APS Attribute for definition of "picking region").
  3. If the pick has selected more than one APS, and the APSs are nested, then it is the APS lowest in the hierarchy which is picked. Unpredictable results may occur if the picking rules of the APS hierarchy and the visible content are contradictory.

Viewers shall give visual feedback to the user that a successful pick has occurred, and an indication of the particular object (or region) which has been picked. The exact method of feedback is viewer dependent.

If a APS is the target of a link, either from within the picture or from content external to the picture, then the default behavior of the viewer should be as follows:

3.2.1.2 Layer

Description. The 'layer' APS declares that the graphical content within this APS and any valid nested APS ('grobject' and 'para', but not 'layer') belong to the layer identified by the contained 'LayerName' APS attribute. Each 'layer' APS shall contain exactly one 'LayerName' APS attribute.

Viewer Behavior. Viewers shall provide functionality to inform users of the presence of layers, their names and descriptions. Viewers shall provide functionality to selectively turn on and off the visibility of layers. Viewer may, but are not required to, provide additional functionality for the view manipulation and browsing of layers.

3.2.1.3 Para

Description. The application structure (APS) of type 'para', may be used to identify text ("paragraphs"). In the case that the underlying graphic does not represent graphical text in a searchable form (e.g., the text has been rasterized, polygonized, broken into small units, or pieces of a single string occur in awkward order), 'para' together with 'content' can potentially enable text search functionality. 'Para' APSs may contain any CGM graphical content allowed by this profile, and may contain other APS and APS attribute content as defined in section 3.3 (the complete, normative WebCGM content model).

Viewer Behavior. The WebCGM prescription for priority of text search matching is: 'para' with matching 'content' (1st priority match); 'para' without 'content' but with recognizable single-element RESTRICTED TEXT match (2nd priority match); or, single-element RESTRICTED TEXT match, outside of any 'para' (3rd priority match). Further details of behavior of viewers with respect to identifiing matches or communicating the identity of matches is not specified in WebCGM 1.0.

In other respects, e.g., picking and link navigation, the viewer behavior of 'para' is identical to that of 'grobject'. See 3.2.1.1.

3.2.1.4 SubPara

Description. The application structure (APS) of type 'subpara', may be used to identify smaller fragments of text within APS of type 'para'. This enables, for example, the identification of the larger text block (the "paragraph") for searching purposes, and the tagging of smaller fragments as hotspots. 'Subpara' APSs may contain any CGM graphical content allowed by this profile, may not contain nested APS, and may contain APS attribute content as defined in section 3.3. The APS attribute content rules of sub-para matches those of 'para'.

Viewer Behavior. See 3.2.1.3, 'para'.

3.2.1.5 About General Metadata Elements

Description. This version and level of WebCGM do not allow additional APS elements to occur, other than 'grobject', 'layer', 'para', and 'subpara'. Private metadata may be associated with WebCGM objects by keeping the metadata outside of the CGM, and associating it with objects within the CGM. The methods, structures, and results of such private intelligent graphics architectures are not specified by WebCGM 1.0, and are outside the scope of standardized interchange under WebCGM 1.0.

3.2.2 Application Structure Attributes

3.2.2.1 Region

Description. The 'region' APS Attribute provides an optional spatial region, associated with a graphical object, which assumes precedence for user picking operations directed at the object. Simple regions of type rectangle, ellipse, polygon, and continuous polybezier can be defined. Complex regions which comprise a collection of simple regions can be built, allowing definition of disjoint subregions, regions with holes, etc. Their semantics (subregions, and interior/exterior definition) are identical to those of the CGM element CLOSED FIGURE.

Parameters. The data record is a SDR of one or more member pairs (i.e., 2*m members, m>=1). Each member-pair defines a simple region: the first member is of data type Index, whose valid values are:

  1. rectangle
  2. ellipse
  3. polygon
  4. continuous polybezier

The second member is type VDC and contains:

For polygon and polybezier regions, closure is implicit (if the last given point does not match the first, then the viewer closes the region with a straight line segment from the last to the first).

In the case that there are multiple simple regions, m>1, then the individual simple regions each correspond to a REGION in the sense of the CGM CLOSED FIGURE element.

Viewer Behavior. See 3.2.1.1.

3.2.2.2 ViewContext

Description. The 'ViewContext' APS Attribute provides specification to viewers of the initial view of an object, when the viewer has been directed to navigate to the graphical object which contains this attribute. A 'ViewContext' APS Attribute may be contained within an otherwise empty APS, in which case the APS provides only a viewport specification.

Parameters. The data record is a SDR of 1 member of type VDC defining two corner points of a rectangle.

Viewer Behavior. See 3.2.1.1.

3.2.2.3 linkURI

Description. The 'linkURI' APS Attribute defines a URI, to be associated with the object containing this attribute. When the object is selected by a graphical pick operation, then the viewer should take necessary action to navigate the link. Multiple 'linkURI' attributes may be contained within a single APS.

Parameters. The data record is a SDR of one member, containing three strings (type SF, String Fixed). The first string is the link destination, a URI, the second string (possibly null) is a LinkTitle attribute, and the third string is (possibly null) is the a Behavior parameter. Note that a null string is a zero-length string, and is not the same as an omitted parameter.

The Behavior string is provided in the case that the URI points to a media type other than CGM, as described below.

The destination of a link is specified by a Uniform Resource Identifier, or URI. Any valid URL under the specifications of RFC1738 and RFC1808 is a valid value of this parameter. This specification does not constrain the syntax or semantics of a URI in a linkURI that identifies a resource that is not a CGM file (for example, an HTML or XML document).

In the case that the URI points to CGM media type, an optional fragment identifier in conjunction with the URI structure specifies pictures and objects (application structures) within pictures, per section 3.1.1above, "Addressing Pictures and Objects". In such cases, viewer behavior should normally be encoded in the fragment.

In cases that the destination is not CGM media type, the 3rd parameter, Behavior, is supplied. The set of valid values of this parameter is as defined in 3.1.2 for 'behavior' (i.e., picture behavior, not 'objbehavior').

3.2.2.4 LayerName

Description. The 'LayerName' APS Attribute declares that the graphics associated with the 'layer' APS containing this attribute belong to the identified layer. If not included within a 'layer' APS, then picture content belongs to the "null layer". The LayerName need not be unique. If more than one 'layer' APS contains the same LayerName, then the occurrences following the first occurrence shall be construed as continuing the definition of the named layer.

Parameters. The data record is a SDR of one member, containing two strings (type SF, String Fixed). The first string is the Layer Name (identifier). The second string is a Layer Description. Either string can be null (zero-length). If the Layer Name is null, then the graphics of this object belong to the null layer, just as if they were unassigned.

Viewer Behavior. See 3.2.1.2.

3.2.2.5 ScreenTip

Description. The 'ScreenTip' APS Attribute provides an optional string, to be associated with a graphical object, which viewers can display when the graphical cursor passes over the graphical object. This APS Attribute may occur within any valid APS of WebCGM, and there shall be at most one occurrence within any particular APS.

Parameters. The data record is a SDR of one member, containing one string (type SF, String Fixed).

Viewer Behavior. Viewers shall be capable of displaying the screen tip, if one is defined for a graphical object, visible to the user when the cursor passes over the graphical object, in the common style of Web browsers.

3.2.2.6 Name

Description. The 'name' APS Attribute provides an optional string, that defines a "common name" associated with an object. Unlike the APS 'id' parameter, the 'name' APS attribute need not be unique within a metafile. This is the same as the Name ("common name") APS Attribute of ATA Grexchange 2.4.

Parameters. The data record is a SDR of one member, containing one string (type SF, String Fixed).

Viewer Behavior. The 'name' gives applications a way to associate common names withobjects. The object can optionally be addressed by the value of the 'name' attribute. See 3.1.1.

3.2.2.7 Content

Description. The 'content' APS Attribute provides a means to declare what is the first priority searchable text content of a 'para' APS. The 'content' APS Attribute may occur only within APS of type 'para', and there shall be at most one occurrence within any such APS.

Parameters. The data record is a SDR of one member, containing one string (type SF, String Fixed).

Viewer Behavior. See the description under the 'para' APS, 3.2.1.3.

3.2.2 8 About General MetaData Elements

Description. This version and level of WebCGM do not allow additional APS Attribute elements to occur, other than as enumerated above. Private metadata may be associated with WebCGM objects by keeping the metadata outside of the CGM, and associating it with objects within the CGM. The methods, structures, and results of such private intelligent graphics architectures are not specified by WebCGM 1.0, and are outside the scope of standardized interchange under WebCGM 1.0.

3.3 Content Model

This is the formal specification of the content model of the CGM Version 4 functionality of WebCGM - the "Intelligence" content. XML has been chosen as the specification language, as validating parsers are widely available which could be adapted to perform content validation checking against WebCGM instances (either via modification of the readers, or via transformation of the intelligent content of WebCGM instance).

<!-- To document the structure of the CGM Version 4      -->
<!-- content of WebCGM the following DTD fragment        -->
<!-- has been developed.                                 -->
<!--                                                     -->
<!-- PICBODY is included in this DTD fragment for        -->
<!-- purposes of demonstrating that the layer, grobject, -->
<!-- and para structures can exist within the picture    -->
<!-- body level in a CGM instance. The gdata element     -->
<!-- is intended to represent CGM element data stored    -->
<!-- an external entity.                                 -->
<!--                                                     -->
<!-- Note: of the attributes listed below, all           -->
<!-- correspond to APS Attribute elements of CGM, except -->
<!-- the 'ID', which corresponds to the 'id' parameter   -->
<!-- of the CGM APS element.

<!NOTATION cgm PUBLIC '-//USA-DOD//NOTATION Computer Graphics Metafile//EN' >

<!ELEMENT picbody - - (layer+ | (grobject | para | gdata)*)>

<!ELEMENT layer - - (grobject | para | gdata)+             >
<!ATTLIST layer
  id           ID         #REQUIRED
  layername    CDATA      #REQUIRED
  layerdesc    CDATA      #IMPLIED                         >

<!ELEMENT grobject - - (grobject | para | gdata)*          >
<!ATTLIST grobject
  id           ID         #REQUIRED
  region       CDATA      #IMPLIED
  viewcontext  CDATA      #IMPLIED
  linkuri      CDATA      #IMPLIED
  screentip    CDATA      #IMPLIED
  name         CDATA      #IMPLIED                         >

<!ELEMENT para - - (subpara | gdata)*                      >
<!ATTLIST para
  id           ID         #REQUIRED
  region       CDATA      #IMPLIED
  viewcontext  CDATA      #IMPLIED
  linkuri      CDATA      #IMPLIED
  screentip    CDATA      #IMPLIED
  content      CDATA      #IMPLIED                         >

<!ELEMENT subpara - - (gdata)*                             >
<!ATTLIST subpara
 id           ID         #REQUIRED
 region       CDATA      #IMPLIED
 viewcontext  CDATA      #IMPLIED
 linkuri      CDATA      #IMPLIED
 screentip    CDATA      #IMPLIED
 content      CDATA      #IMPLIED                          >
<!ELEMENT gdata - o EMPTY                                  >
<!ATTLIST gdata
 cgmprim       ENTITY     #REQUIRED                        >

Up to cover page | Back to WebCGM Concepts | On to WebCGM Profile

Valid HTML 4.0!  Made with CSS