A paradigm for uniting the diverse strands of XML-based Web technologies by allowing them to be incorporated within a single document.
XML without a description of its processing is not fully describing
By embedding the minimal number of constructs in XML we can extend XML into functional processing language, that uses the Semantic Web as a type system and can access Web Services.
So many stacks to choose from!
Would the company with the game-plan in their closet please stand-up?
What's the processing model for XML?
[See Answer Here from XML Processing Working Group]Is XML self-describing?
Tim Berners-Lee noted that XML documents are not self-describing since they do not provide a description of their preferred method of processing or their meaning.Element and attribute names provide a hint as to their usage...
Every schema is a public agreement, and the details of this agreement are usually not described by the document itself or known to outside parties.Only formats like Atom, RSS, OPML (and non-XML ones like vCard) are well-understood by everybody on the Web since as the meaning and usage of microformats are well-known due to the clear and easily-accessible description of these formats and their widespread adoption.
Are all but the most popular of microformats doomed to be misunderstood?Not without explicit semantics and self-describing processing
cat input.xml | xsv someschema.xsd | saxon xhtmlout.xsl > output.xml
The One Damn Thing After Another model
<param name="target" select="result"/>
<process id="p2" type="transform">
<input name="stylesheet" label="xhtmlout.xsl"/>
<input name="document" label="valid"/>
<output name="result" label="result"/>
</process>
<process id="p1" type="validate">
<input name="document" label="input.xml"/>
<input name="schema" label="someschema.xsd"/>
<output name="psvi" label="valid"/>
</process>
The processing instructions are outside the document itself, and
so cannot take advantage of the natural compositionality of XML (trees).
<page xmlns:fx="http://www.ltg.ed.ac.uk/~ht/functionalXML">
<fx:transform xmlns:xi="http://www.w3.org/2001/XInclude"
stylesheet="xmlhtmlout.xsl">
<fx:validate schemaDocument="someschema.xsd">
<document version="2.0">
<head profile="http://www.w3.org/2003/g/data-view">
<link rel="transformation"
href="http://www.example.org/xml2rdf.xsl" />
</head>
<body>
<title>Some Document</title>
<author = "Brian Suda" />
<title>
My input data is below!
</title>
<data>
The <b>data itself</b>!
</data>
</body>
</document>
</fx:validate>
</fx:transform>
XML pipeline languages such Orbeon's XPL and NetKernel have already gone to the Turing-Complete stage.
No complex programming should be done in XML.Pipelines are simple languages that encapsulate more complex processors.
A powerful but lightweight option that allows us to add processing components (not instructions) to the nodes of an XML document, and so make XML self-describing.
<fx:let xmlns:fx="http://www.ltg.ed.ac.uk/~ht/functionalXML">
<fx:bind name="myvariable">
<fx:include href="document.xml"/>
</fx:bind>
<fx:cond>
<fx:case test="$myvariable/document/@version > 1.0">
<fx:transform stylesheet="xhtmlout.xsl">
<fx:validate schemaDocument="someschema.xsd">
<fx:include href="$myvariable"/>
</fx:validate>
</fx:transform>
</fx:case>
</fx:cond>
</fx:let>
We should be able to create functions and assign functions to variables.
<fx:let xmlns:fx="http://www.ltg.ed.ac.uk/~ht/functionalXML">
<fx:defun name="myGrddl">
<fx:lambda>
<fx:args>
<fx:arg name="inputXML" />
</fx:args>
<fx:processdef grounding= "glean.py --output $stdout $inputXML" />
</fx:lambda>
</fx:defun>
<fx:bind name="myvariable">
<fx:validate schemaDocument="someschema.xsd">
<fx:include href="document.xml"/>
</fx:validate>
</fx:bind>
<fx:cond>
<fx:case test="$myvariable/head/link/@rel
&eq; "transformation"">
<fx:apply name="myGrddl">
<fx:include href="$myvariable" />
</fx:apply>
</fx:case>
</fx:cond>
</fx:let>
(let ((myvariable "input.xml"))
(cond ([$myvariable/document/@version > 1]
(transform (validate myvariable "someschema.xsd")
"xhtmlout.xsl"))))
<fx:let>
<fx:defun name="wsValidate">
<fx:lambda>
<fx:args>
<fx:arg name="inputXML" />
<fx:arg name="schemaDocument" />
</fx:args>
<fx:restWebService
location="http://www.example.org/SchemaValidator" />
</fx:lambda>
</fx:defun>
<fx:transform stylesheet="xhtml.out">
<fx:apply name="wsValidate" schemaDocument="someschema.xsd">
<fx:include href="input.xml"/>
</fx:apply>
</fx:transform>
</fx:let>
And why not have a soapWebService that helps abstract away from the WS stack?
The problem of the hour for the Semantic Web is data integration.
So we can have a Semantic FunctionalXML where some functions map from infosets to triples.
<document xmlns:sfx="http://www.ibiblio.org/hhalpin/sfXML"
xmlns:fx="http://www.ltg.ed.ac.uk/~ht/functionalXML">
<sfx:grddl>
<fx:include href="neworder.xml" />
</sfx:grddl>
<fx:include href="bookdata.rdf" />
</document>
Explicitly model the world semantics of your data, not just give them data types.
<fx:let xmlns:sfx="http://www.ibiblio.org/hhalpin/sfXML"
xmlns:storeOnt="http://www.example.org/StoreOntology/" >
<sfx:bind name="myPerson" type="storeOnt:StoreCustomer">
<fx:include href="customerOrder121.xml" />
</sfx:bind>
</fx:let>
Invoke Web Services not just by their URI, but by the type of information they output and input.
All we require is that WSDL inputs and outputs can be annotated with RDF - just like WSDL-SA.<body>
<fx:let xmlns:fx="http://www.ibiblio.org/hhalpin/sfXML"
xmlns:dirOnt="http://www.example.org/DirectionsOntology/">
<sfx:bind name="myAddress" type="dirOnt:Address">
<sfx:include href="myaddr.rdf"/>
</sfx:bind>
<sfx:bind name="yourAddress" type="dirOnt:Address">
<sfx:include href="your_addr.rdf"/>
</sfx:bind>
<h1>Welcome to My Web Page</h1>
<p>The <b>directions</b> to my House are here:</p>
<sfx:defun name="doDir">
<sfx:lambda type="dirOnt:Directions">
<sfx:args>
<sfx:arg name="origin" type="dirOnt:Origin"/>
<sfx:arg name="destination" type="dirOnt:Destination"/>
</sfx:args>
</sfx:lambda>
</sfx:defun>
<sfx:defun name="doMap">
<sfx:lambda outputType="dirOnt:Map">
<sfx:args>
<sfx:arg name="address" type="dirOnt:Location"/>
</sfx:args>
</sfx:lambda>
</sfx:defun>
<sfx:apply name="doDir" origin="$yourAddress" destination="$myAddress" />
<p>You may find this <b>map</b> useful as well!</p>
<sfx:apply name="doMap" address="$myAddress"/>
</fx:let>
</body>
Curry-Howard Isomorphism = Proofs are Programs
Typed Functional Programming Languages = Intuitionistic Predicate Logic
<fx:let xmlns:fx="http://www.ltg.ed.ac.uk/~ht/functionalXML">
<fx:bind name="myvariable">
<fx:include href="document.xml"/>
</fx:bind>
<fx:cond>
<fx:case test="$myvariable/document/@version > 1.0">
<fx:transform stylesheet="http://www.example.com/xhtmlout.xsd">
<fx:authenticate stylesheet="http://www.me.com/key.gpg.asc">
<fx:include href="$myvariable"/>
</fx:authenticate>
</fx:transform>
</fx:case>
</fx:cond>
</fx:let>
Sort of like a formally well-founded and low budget Semantic Web Service processing - but not for business processes.
Obviously related to functional programming and Lisp.Lots of formal work to be done and implementation.
Typed Lambda Calculus = A model of computation
sfXML documents = Typed Lambda Calculus
A universal computer = the Web