Tuesday, February 8, 2011

XML (CIS-20A) Vocabularies

QName:

Qualified Name (QName) is a syntactic construct for representing an expanded name, which describes a pair of strings: the local part and the namespace separated with ":".


DTD:

A Document Type Definition (DTD) defines the legal building blocks of an XML document. It defines the document structure with a list of legal elements and attributes.

A DTD can be declared inline inside an XML document, or as an external reference.


XML Attribute and Element:

Attribute provides additional infomation that is not part od data.
XML attribute value must to be quoted, double or single.

Examples:

<person sex="female">
  <firstname>Anna</firstname>
  <lastname>Smith</lastname>
</person>


<person>
  <sex>female</sex>
  <firstname>Anna</firstname>
  <lastname>Smith</lastname>
</person>


The first sex is attribute.
The second one is element.

Some of the problems with using attributes are:
  • attributes cannot contain multiple values (elements can)
  • attributes cannot contain tree structures (elements can)
  • attributes are not easily expandable (for future changes)
Attributes are difficult to read and maintain. Use elements for data. Use attributes for information that is not relevant to the data.



Semantics of Data: 

from lecture note,
Defining the semantics of data means defining its meaning. To define the purpose the sematics of data, need to identify the allowable values for data attributes and the relationships between those values.

For example, the industry standard of ice cream DTD has two tags, {volume and flavor}. Like {3, Chocolate}, {400, Vanilla}, etc. What's 400? Litters? Ounces? Knowing the structure of data isn't sufficient enough. We also need to knoe the semantics.

Taxnomy: 

from lecture note,
For example, Rocky Road, Mocha Fudge, and Swiss Fudge are all types of chocolate. Ultra Strawberry is a type of strawberry. Without knowing the taxonomy - calssification of flavors, it would be difficult to map the data of ice cream.

Ontology: 

from wiki,
The philosophical study of the nature of being, existence or reality as such, as well as the basic categories of being and their relations.


from wiki,
In computer science and information science, an ontology is a formal representation of knowledge as a set of concepts within a domain, and the relationships between those concepts. It is used to reason about the entities within that domain, and may be used to describe the domain.
In theory, an ontology is a "formal, explicit specification of a shared conceptualisation".[1] An ontology provides a shared vocabulary, which can be used to model a domain — that is, the type of objects and/or concepts that exist, and their properties and relations.[2].
Ontologies are the structural frameworks for organizing information and are used in artificial intelligence, the Semantic Web, systems engineering, software engineering, biomedical informatics, library science, enterprise bookmarking, and information architecture as a form of knowledge representation about the world or some part of it. The creation of domain ontologies is also fundamental to the definition and use of an enterprise architecture framework.


ummm... well said :)

from lecture,
Ontology goes beyond taxonomy.  Where taxonomy addresses classification hierarchies ontologies will represent and communicate knowledge about a topic as well as a set of relationships and properties that hold for the entities included within that topic.


Schema: 

An XML Schema describes the structure of an XML document.

from wiki,
A schema (pl. schemata or schemas), in psychology and cognitive science, describes any of several concepts including:
  • An organized pattern of thought or behavior.
  • A structured cluster of pre-conceived ideas.
  • A mental structure that represents some aspect of the world.
  • A specific knowledge structure or cognitive representation of the self.
  • A mental framework centering on a specific theme, that helps us to organize social information.
  • Structures that organize our knowledge and assumptions about something and are used for interpreting and processing information.
A schema for oneself is called a "self schema". Schemata for other people are called "person schemata". Schemata for roles or occupations are called "role schemata", and schemata for events or situations are called "event schemata" (or scripts).


Oh!
This is where "script" came from.


from wiki,

XML Schema, published as a W3C recommendation in May 2001, is one of several XML schema languages. It was the first separate schema language for XML to achieve Recommendation status by the W3C. Because of confusion between XML Schema as a specific W3C specification, and the use of the same term to describe schema languages in general, some parts of the user community referred to this language as WXS, an initialism for W3C XML Schema, while others referred to it as XSD, an initialism for XML Schema Document—a document written in the XML Schema language, typically containing the "xsd" XML namespace prefix and stored with the ".xsd" filename extension. In the draft of the next version, 1.1, the W3C has chosen to adopt XSD as the preferred name, and that is the name used in this article.

Like all XML schema languages, XSD can be used to express a set of rules to which an XML document must conform in order to be considered 'valid' according to that schema. However, unlike most other schema languages, XSD was also designed with the intent that determination of a document's validity would produce a collection of information adhering to specific data types. Such a post-validation infoset can be useful in the development of XML document processing software, but the schema language's dependence on specific data types has provoked criticism.



Persisting XML: 

Persisting XML?
What does it mean???

from wiki,
In computing, a persistent data structure is a data structure which always preserves the previous version of itself when it is modified; such data structures are effectively immutable, as their operations do not (visibly) update the structure in-place, but instead always yield a new updated structure.

A persistent data structure is not a data structure committed to persistent storage, such as a disk; this is a different and unrelated sense of the word "persistent."

A data structure is partially persistent if all versions can be accessed but only the newest version can be modified. The data structure is fully persistent if every version can be both accessed and modified. If there is also a meld or merge operation that can create a new version from two previous versions, the data structure is called confluently persistent. Structures that are not persistent are called ephemeral.



I see!!!


from lecture,
XML databases are a new option for persisting your data.  The XML:DB Project indicates that a native XML database (NXD) should define a logical model for XML documents, natively support XML documents, but is not required to have any particular underlying technology.

An XML database (XEDB) is a database that has an XML mapping layer added on to it.  Data manipulation in an XEDB happens with either XML technologies (e.g. XPath) or database technologies (e.g SQL).  Finally, a Hybrid XML Database (HXD) is one that can be treated as either a NXD or a XEDB depending on the requirements of the application.
The XML Schema language is also referred to as XML Schema Definition (XSD).

Friday, February 4, 2011

AJAX

When I heard the word "AJAX", I thought they were talking about this.


Then later found out, it stands for:
Asynchronous JavaScript and XML

Oh..., I see...

Note:
The keystone of AJAX is the XMLHttpRequest object


Wait!
I found Comet!
It does opposite of what Ajax does - data goes back to server.  

Ajax, Comet...
What's next? Cascade?
oh...
that's right!
CCS stands for Cascading Style Sheet.


C++ control statements

C++ has only three control statements:
  • sequence statement
  • selection statement
  • repetition statement

What's this "X" stuff, anyway?

Extensible... ?

A system desing priciple where the implementation takes into consideratoin future growth.

I see...



XML: Extensible Markup Language

XSL: Extensible Stylesheet Language
To present data in a paginated format, just like CSS.

XSLT: Extensible Stylesheet Language Transformation
It's not XSL+T.
It's a method of transfering data document to presentation document. Then, it can be interfaced with XSL or CSS.

enumeration

enumeration constants start from 0, if not specified otherwise.

enum Colors {RED=2, ORG, YEL};

This makes it, RED=2, ORG=3, and YEL=3.

Declaration

int x;

This is called a declaration, and it assigns a type, this case "int", to a varible.

Vertual Funtion

The type of the object being pointed to, not the type of the hundle, determines which version of a vertual function to invoke.