Author Archives: icorda
Originally posted on What's The Big Data?:
Two years ago, Fast Company reported on the “great tech war” of the four leading horsemen of the Internet–Facebook, Amazon, Google, and Apple (let’s call them the FAGA Four). The race for Internet dominance has intensified since then, with Amazon pitting the Kindle Fire against the iPad and Google responding to Facebook with Google+. Each of these four companies has moved from its base to capture more social, mobile, local, delivery, advertising, devices, and design dominions.
Even their emergent competition for the enterprise IT market has intensified lately, when Google introduced its Compute Engine and slashed the prices for its cloud services. Looks like it finally decided to make a more serious attempt to diversify from the $0.5 trillion global advertising market—where it gets almost all of its revenues—to the $3.7 trillion IT market. Facebook is the only one of the “Gang of Four” (Eric Schmidt’s term) that has stayed away from the enterprise. But for how long? After all, it has been leading the Open Compute project for the past two years, aiming to “spark a collaborative dialog” about designing and enabling “the delivery of the most efficient server, storage and data center hardware designs for scalable computing.”
A visionary statement like this befits a leading horseman of the Internet. In the rapidly changing Internet landscape, when new, attention-grabbing companies rise from nowhere every few months (and have the audacity to refuse Facebook’s $3 billion acquisition offer), you sustain your leadership by pursuing a vision or at least being perceived as having one. “Vision envy” is how one of Leo Laporte’s guests on a recent This Week in Tech described the latest moves of the Internet’s leaders.
A list of excellent Open Source resources to build a Data Science curriculum for self-study learners:
Interesting article for whoever wants to embark on a journey of coding delights. My personal opinion is that Python is probably the best programming language to get started, although I was first exposed to programming with Prolog. Well, I can proudly say: “I survived”!
Link to the Article:
There are a number of Accessors and Functions for manipulating and outputting URIs as described in XPath and XQuery Data Model :
|fn:base-uri||The base URI of a node|
|fn:document-uri||The URI of a document|
|fn:encode-for-uri||Encodes reserved characters for use in the path of a URI|
|fn:escape-html-uri||Escapes all characters except printable ASCII characters|
|fn:iri-to-uri||Converts an IRI into a URI|
|fn:resolve-uri||Resolves a relative URI to a base URI, returning an absolute URI|
|fn:static-base-uri||The base URI from the static context|
Fn:base-uri returns the base URI for a specified node. If the node is part of a document and its base-uri attribute is not explicitly set,
fn:base-uri defaults to the base URI of the document node.
Fn:base-uri - Signature-
The zero-argument version of the function returns the base URI of the context node and it is equivalent to calling
fn:base-uri(.) The single-argument version of the function follows the below rules:
$argis the empty sequence, the function returns an empty sequence.
- Otherwise, the function returns the value of the
dm:base-uriaccessor applied to the node
Assume that $foo = ‘http://example.org/test/test.xml’
Fn:document-uri takes a document node and returns the absolute URI associated with it. It is, in fact, the inverse of fn:doc, which returns a document node based on an absolute URI.
Fn:document-uri - Signature -
If $arg is empty, it returns an empty sequence.
Assume that $foo=’doc(http://example.org/test/test.xml)’
Fn:encode-for-uri encodes reserved characters for use in the path of a URI. URIs require some characters (ASCII and non-ASCII) to be escaped with their hexadecimal Unicode code point preceded by the percentage sign (%). All characters can be escaped, exception made for the following:
- letters a through z and A through Z
- digits 0 through 9
- hyphen (-), underscore (_), period (.), tilde (~)
If $uri-part is an empty sequence, it returns a zero-length string.
Fn:encode-for-uri – Examples-
Input: concat("http://www.mypage.org/", encode-for-uri("~résumé")) Output: "
Fn:escape-html-uri escapes all characters, except made for printable US-ASCII coded character set. The function enables HTML user agents to handle attribute values that expect URIs, by replacing each character with an escape sequence.
The escape sequence takes the form of: %
Fn:iri-to-uri transforms a xs:string containing an IRI into a URI. This function replaces each special character with an escape sequence in the form
xx is two hexadecimal digits (in uppercase) representing the character in UTF-8.
All characters except the following are escaped:
- Letters a through z and A through Z
- Digits 0 through 9
- Hyphen (-), underscore (_), period (.), exclamation point (!), tilde (~), asterisk (*), apostrophe(‘), parentheses (‘(‘ and ‘)’) and hash mark (#)
- Semicolon (;), forward slash (/), question mark (?), colon (:), at sign (@), ampersand (&), equals sign (=), plus sign (+), dollar sign ($), comma (,), square brackets (‘[' and ']‘), and percent sign (%).
If only a specific part of a UR needs to escapedI (as opposed to an entire URI), it is recommended to use the function fn:encode-for-uri .
Fn:iri-to-uri – Examples-
Fn:resolve-uri returns an absolute URI by taking a base URI ($base) and a relative($relative) URI as arguments. In case $base is not provided, then the the base URI of the static context is used. The main difference between $base and $relative is detailed here
Fn:static-base-uri returns the base URI of the static context. The static context of an expression is the information that is available during static analysis of the expression, prior to its evaluation. If the base URI is undefined, an empty sequence is returned.
- XQuery 1.0 and XPath 2.0 Functions and Operators (Second Edition), W3C Recommendation 14 December 2010. Available at: http://www.w3.org/TR/xpath-functions/
- XQuery, Priscilla Walmsley, O’Reilly Media, 2007
- Michael Kay, XSLT 2.0 and XPath 2.0 Programmer’s Reference (Programmer to Programmer), Wrox; 4 edition, 2008IETF.
- RFC 3987: Internationalized Resource Identifiers (IRIs). Available at: http://www.ietf.org/rfc/rfc3987.txtMozilla Developer Network XPath: https://developer.mozilla.org/en-US/docs/XPath
- XQuery Library: http://www.xqueryfunctions.com/xq/