Data Projection Model: Notations |
The Perspector Notation
|
Every process can be expressed as a binary relation between two operands, the "x-operand" and the "y-operand". The relation itself is represented by an operator "o".
< x | o | y > represents a process, and is called a "perspector". The operands x and y are unique within a global name space, and the operator has its own name space. If two perspectors have the same x, o and y, there is only one perspector.
|
Perspectors can be combined: each perspector in turn can serve as an operand within another perspector. The perspectors can be expressed in other notations, such as XML, RDF, or Topic Maps.
A query language is also available for finding information among a set of perspectors. The way the queries are formulated is what defines and distinguishes perspectives.
|
|
XML Notation for Perspectors: Instance |
|
Below is an instance of an XML document representing two perspectors: p1 = < 2 | + | 3 > and p2= < p1 | is_a | perspector >. This example also shows how a perspector can be embedded into another perspector. The XML document instance is followed by three equivalent declarations for the document structure: one expressed as a document type definition (DTD), one as a Relax-NG grammar, one as a Relax-NG Compact Notation, one as an XML Schema.
|
XML Instance
<perspectors>
<p id="p1">
<x>2</x>
<o>+</o>
<y>3</y>
</p>
<p id="p2">
<x>p1</x>
<o>is_a</o>
<y>perspector</y>
</p>
</perspectors>
|
|
DTD
<?xml encoding="UTF-8"?>
<!ELEMENT perspectors (p)+ >
<!ATTLIST perspectors
id ID #IMPLIED>
<!ELEMENT p (x,o,y)>
<!ATTLIST p
id ID #REQUIRED>
<!ELEMENT x (#PCDATA)>
<!ELEMENT o (#PCDATA)>
<!ELEMENT y (#PCDATA)>
RELAXNG
<?xml version="1.0" encoding="UTF-8"?>
<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<element name="perspectors">
<oneOrMore>
<element name="p">
<attribute name="id">
<data type="NCName"/>
</attribute>
<element name="x">
<text/>
</element>
<element name="o">
<text/>
</element>
<element name="y">
<text/>
</element>
</element>
</oneOrMore>
</element>
</start>
</grammar>
RELAX-NG Compact Notation
default namespace = ""
start =
element perspectors {
element p {
attribute id { xsd:NCName },
element x { text },
element o { text },
element y { text }
}+
}
XML SCHEMA
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="perspectors">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="p"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="p">
<xs:complexType>
<xs:sequence>
<xs:element ref="x"/>
<xs:element ref="o"/>
<xs:element ref="y"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:NCName"/>
</xs:complexType>
</xs:element>
<xs:element name="x" type="xs:string"/>
<xs:element name="o" type="xs:string"/>
<xs:element name="y" type="xs:string"/>
</xs:schema>
|