Basic Computer Notions Beyond HTML

Introduction

Web stuff beyond HTML, with some medical implications:

Intellectual property

Respect the intellectual-property rights of others.

Consider alternatives to the All rights reserved model for copyright.

Style sheets

Cascading Style Sheets (CSS) permit control over appearance while still allowing HTML to focus on structure and meaning.

Style specifications for an HTML page can be included

  1. in a separate style-sheet file,
  2. within the head, or
  3. within the body

External style-sheet file

For example, this page refers to the external style-sheet file bacon.css. The style-sheet file is invoked with this line:

<link rel=stylesheet type="text/css" href="../bacon.css">

The style-sheet file contains things like the following:

body { background-color: pink }
h1,h2 { font-family: sans-serif; color: brown }
code { font-family: sans-serif; color:green }
ul { list-style-image: url("icons/obullet.gif") }

This example defines display attributes for the body of the page, for 1st and 2nd-level headings, and for any text which is tagged as code, and specifies an image to use as the bullets for unordered lists.

Styles within the head

Style specifications like those above can also be included directly within the head of an individual HTML page, with the style specifications enclosed in a <style> element. E.g.,

<style type="text/css">
p { font-family: gill, arial, helvetica, sans-serif ; font-size:80% }
p.intro { color:blue ; font-family: gill, arial, helvetica, sans-serif ; font-size:80% }
</style>

This example specifies that text within paragraphs will be displayed with a small sans-serif font, unless the <p> tag of a paragraph has a class attribute of "intro", i.e., <p class=intro>, in which case the text in the paragraph will be displayed as blue.

Note the possibility (and importance) of specifying alternative font names.

Styles within the body

A style specification can also be included directly within the body.
For example, <p style="color:red"> would cause the following paragraph to be displayed in red.

Note that specifying the style directly in the text this way loses some of the advantage of using styles.

It might be better to define, for example, a p.special style in the head, and then introduce the paragraph with a <p class=special> tag.
This would definitely be better if the style is applied to more than one paragraph.

A style can be applied to individual words or phrases within the text by using the <span> tag. For example, <span style="color:red">test</span> would result in test.

Again, <span class=special>test</span> might be better.

Similarly, a <div> tag can be used to apply a style to a block of HTML code.

Controlling spacing

 _______________________________________
|                                       |
|           margin (transparent)        |
|   _________________________________   |
|  |                                 |  |
|  |        border                   |  |
|  |   ___________________________   |  |
|  |  |                           |  |  |
|  |  |     padding               |  |  |
|  |  |   _____________________   |  |  |
|  |  |  |                     |  |  |  |
|  |  |  |  content            |  |  |  |
|  |  |  |_____________________|  |  |  |
|  |  |___________________________|  |  |
|  |_________________________________|  |
|_______________________________________|

          |    element width    |
|               box width               |
From w3c.org

CSS can also be used for controlling the vertical and horizontal spacing around elements of content.

For example:

Here is the HTML code for a table: Here is the table as displayed with no explicit styles defined: Here is the same table with some styles defined:
    <table border>
      <tr>
	<td>row 1,column 1
	<td>row 1,column 2
      <tr>
	<td colspan=2 align=center>row 2
    </table>
row 1,column 1 row 1,column 2
row 2
row 1,column 1 row 1,column 2
row 2

CSS2

Includes

Further information

XML

The Extensible Markup Language (XML) allows user-defined tags, facilitating the inclusion of structured data in Web documents.

XML allows user-defined tags. For example, tags for a bibliographic database might be defined and used as follows:

<book>
  <author>Deafenbaker, J.</author>
  <author>Earson, L.P.</author>
  <title>The existential philosophy of eardrums</title>
  <publisher>TM-Life Books</publisher>
  <year>1998</year>
</book>
<article>
  <author>Canteer, I.</author>
  <title>The critique of poor reasons</title>
  <journal>Hearing Science</journal>
  <year>1999</year>
</article>

The latest version of HTML is actually XHTML, a reformulation of HTML 4.01 in XML.

There was early hype about sharing word-processing documents between different commercial word-processing applications via XML, but it didn't happen.

Microsoft Word was perhaps the first word processor to export XML, but it wasn't usable by any other application.

Now OpenOffice.org version 2 and KOffice both use the XML-based Open Document Format as their native file format. AbiWord and TextMaker can import ODF files.

Microsoft is working on ‘Office Open XML’ for their Office 2007. There are debates about why they don't use the ODF format.

MathML

The Mathematical Markup Language (MathML) is intended to facilitate the inclusion of equations and technical symbols in Web documents.

For example, Sample mathematical expression could be described using presentational tags as follows:

<math>
  <mroot>
    <mrow>
      <mo>(</mo>
      <msup>
        <mi>x</mi><mn>2</mn>
      </msup>
      <mo>+</mo>
      <msup>
        <mi>y</mi><mn>2</mn>
      </msup>
      <mo>)</mo>
    </mrow>
    <mn>3</mn>
  </mroot>
</math>

The mi, mn and mo tags represent identifiers, numbers and operators, respectively.

If your browser can display MathML, you should be able to view the equation here.

Alternatively, the same equation could be described using semantic tags something like the following:

<math>
  <apply>
    <root/>
    <apply>
      <plus/>
      <apply>
        <power/><ci>x</ci><cn>2</cn>
      </apply>
      <apply>
        <power/><ci>y</ci><cn>2</cn>
      </apply>
    </apply>
    <cn>3</cn>
  </apply>
</math>

Semantic markup is designed to allow software to interpret the meaning and perform mathematical manipulations.

The adoption of MathML in mainstream Web browsers has been slow.

XML for other areas

Chemistry

Common Data Format ‘for the storage and manipulation of scalar and multidimensional data’

X3D for interactive 3-D models; incl. MedX3D project

Extract from example:

<subject>
  <manufacturedProduct>
    <manufacturedLabeledDrug>
      <name>Xalatan</name>
      <formCode code="TBD"
       displayName="ophthalmic solution"
       codeSystem="1.2.3.4" codeSystemName="FDA"/>
      <activeIngredient>
        <quantity>
          <numerator value="50" unit="micrograms"/>
          <denominator value="1" unit="mL"/>
        </quantity>
        <activeIngredientIngredientEntity>
          <code code="TBD" codeSystem="1.2.3.4"
           codeSystemName="FDA"/>
          <name>latanoprost</name>
          <activeMoiety>
            <activeMoiety>
              <code code="TBD" codeSystem="1.2.3.4"
               codeSystemName="FDA"/>
              <name>latanoprost</name>
            </activeMoiety>
          </activeMoiety>
        </activeIngredientIngredientEntity>
      </activeIngredient>
      <playedDrugWithGeneric>
        <genericGenericDrug>
          <code code="TBD"
           codeSystem="2.16.840.1.113883.5.1060"
           codeSystemName="EntityCode"/>
          <name>latanoprost</name>
        </genericGenericDrug>
      </playedDrugWithGeneric>
      <inactiveIngredient>
        <inactiveIngredientIngredientEntity>
          <code code="TBD"
           codeSystem="1.2.3.4"
           codeSystemName="FDA"/>
          <name>benzalkonium chloride</name>
        </inactiveIngredientIngredientEntity>
      </inactiveIngredient>
    ...
    </manufacturedLabeledDrug>
    <consumedIn>
      <substanceAdministration>
        <routeCode code="OPHTHALTA"
         codeSystem="2.16.840.1.113883.5.112"
         codeSystemName="RouteOfAdministration"
         displayName="Ophthalmic"/>
      </substanceAdministration>
    </consumedIn>
  </manufacturedProduct>
</subject>

Structured Product Labeling

SPL will ‘Reduce medical errors and improve patient care’:


XSL and XSLT

XSL = XML Stylesheet Language, includes

For defining appearance based on XML.

Example XML file

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE catalog>
<?xml-stylesheet type="text/xsl" href="cdcat.xsl"?>
<catalog>
  <cd>
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <price>10.90</price>
    <year>1985</year>
  </cd>
  <cd>
    <title>Itsy Bitsy Spider</title>
    <artist>Geneviève</artist>
    <country>Canada</country>
    <company>UnoHoo</company>
    <price>0.00</price>
    <year>2002</year>
  </cd>
</catalog>

Corresponding XSL file

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" />
<xsl:template match="/">
  <html>
  <body>
    <table border>
      <tr>
        <th>Title</th>
        <th>Artist</th>
      </tr>
      <xsl:for-each select="catalog/cd">
      <tr>
        <td><xsl:value-of select="title"/></td>
        <td><xsl:value-of select="artist"/></td>
      </tr>
      </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

Resulting HTML

TitleArtist
Empire BurlesqueBob Dylan
Itsy Bitsy SpiderGeneviève
<?xml version="1.0"?>
<html>
  <body>
    <table border>
      <tr>
	<th>Title</th>
	<th>Artist</th>
      </tr>
        <tr><td>Empire Burlesque</td>
        <td>Bob Dylan</td></tr>
      <tr>
        <td>Itsy Bitsy Spider</td>
        <td>Genevi&egrave;ve</td>
      </tr>
    </table>
  </body>
</html>

(Don't take the details of this example too seriously)

Javascript

Javascript is a scripting language for use within Web pages.

Example

Java

Java is a programming language, intended to be platform independent, which can be used to write applets for downloading as part of a Web page.

Example

Cookies

Cookies are small files stored on your computer by your Web browser. Cookies store information about you and your Web browsing. Your browser can later be requested to send them to a Web server, which can be useful for keeping track of your interactions with a particular Web site.

You can restrict how they're used. You can disable them completely, which may interfere with your access to some Web sites, or you can ask your browser to warn you about them. You can also delete them from your computer.

(The term cookies is sometimes also used for information about users which is stored on a server.)

Push vs. pull

Push technology is (was?) a method of automatically notifying you about new Web content. What appears to be 'pushing' is often really automated 'pulling' by your Web browser.

Microsoft and Netscape advocate two incompatible approaches.

For Microsoft, a channel is a Web site described by a Channel Definition Format (CDF) file (using XML). The CDF file defines a hierarchy of pages, how the pages will be used or displayed, and when they should be updated.

Netscape's Netcaster uses standard HTML, Java and JavaScript to define and control channels.

There are (were?) also other approaches.

It now seems that all of the above describes a bright idea which didn't work out. E-mail works just fine as a way of pushing information to people (so well that it often degenerates into spam).

RSS

‘RSS (Really Simple Syndication, or RDF Site Summary) is a format for syndicating news and the content of news-like sites’ (What is RSS?).

An ‘RSS feed’ is an XML file containing information about news items. It is intended to be used by an RSS reader programme, or aggregator, which can combine news items from multiple servers by processing their RSS files.

There are several incompatible versions of RSS.

Semantic Web

There is a tremendous amount of information on the Web, but it is often difficult to find what you want.

The goal of the ‘Semantic Web’ is to give well-defined meaning to the items of information on the Web.

Based on URI's, XML and RDF.

Uniform Resource Identifiers

Uniform Resource Identifiers (URI's) are generalized URL's and can point to resources other than Web files.

URI's are specified using various schemes:

Within the URN scheme there are several official URN namespaces:

OID's

Example 1: urn:oid:2.16.124.10.1000 refers to Hydro-Québec: Example 2: urn:oid:1.3.6.1.4.1.18236 refers to McGill University: Example 3: urn:oid:1.2.840.10008.5.1.4.1.1.2 refers to an entry in a DICOM file header: Example 4: urn:oid:1.2.840.113619.2.55... refers to an entry in a GE DICOM file header:

Use of OID's in HL7

HL7 version 3 requires the use of OID's for all

XML

XML provides a general way of marking the meanings of terms.

E.g.,
<xml xmlns:all="http://x.y.z/everything/">
<all:animal>cat</all:animal>
<all:plant>catnip</all:plant>
</xml>

The URL points to a Web page which defines the required namespace everything.

Resource Description Framework

The Resource Description Framework (RDF) provides a formal way of making statements (using URI's and XML) about resources.

An RDF statement is of the form
‘The thing has a property which has a specified value’.

The thing, property and value parts of the statement are referred to as
the ‘subject’, ‘predicate’ and ‘object’.

The subject and predicate are both specified using URI's;
the object can be specified using either a URI or a plain text string.

The URI used for the predicate (property) could, for example, point to the Dublin Core definitions for metadata elements:

As an example, if I want to state that my home page is written in Canadian English, I can specify the RDF subject/predicate/object triplet as something like
http://audilab.bmed.mcgill.ca/~funnell/
dc:language
rfc1766:en-CA

where dc: specifies that a Dublic Core property is being used
and rfc1766: specifies a standard for how the language value is encoded.
In actual use there would also need to be explicit pointers (URL's) to the formal specifications of the dc and rfc1766 namespaces.

An RDF Schema is used to define a vocabulary: a set of certain types or classes of resources, and which specific properties will be used to describe each of those types or classes.

E.g., the classes of resources might include Animal, Plant, Mammal, Conifer, etc.
The properties might include numberOfEyes, typeOfLeaf, etc.
Mammal would indicate a type of Animal, which could have numberOfEyes as a property.

The RDF Schema language is rather restricted and various groups are working on more powerful languages.
DAML+OIL and OWL are two such languages.

The Topic Maps approach works rather differently. Cf. discussions by Garshol and Pepper.

Other approaches also exist.

Ontologies

A collection of related RDF statements (an ‘ontology’) allows one to describe the relationships among a large number of resources. Many such ontologies have been developed in a variety of fields; e.g., the DAML Ontology Library contains ontologies for art, beer, composers and scores of others.

See

Applications in medicine

Potential importance in medicine:

Ref: OpenClinical

Cf. Ontologies in medicine, D.M. Pisanelli (ed.), IOS Press (Amsterdam), 2004, ix+165 pp., W 26.5 O59

W3C Semantic Web Health Care and Life Sciences Interest Group

Examples:

Web services

A Web service is a service made available by one computer programme and designed to be used by another computer programme, rather than directly by a human.

The ‘loosely coupled’ programme-to-programme communication uses layers of standards in order to specify the meaning of shared information:

Typical application

Vacation reservations

The various programmes can be written in different languages and run on different kinds of servers, as long as they all use the same communication standards.

Standardize access rather than standardizing coding, software, etc.

Potential medical applications


Bacon home page

Valid HTML 4.01! Valid CSS!

Creative Commons
License
This work is licensed under a Creative Commons License.
R. Funnell

Last modified: 2012-09-23 10:10:47