Another Word For It Patrick Durusau on Topic Maps and Semantic Diversity

July 20, 2011

Growing a DSL with Clojure

Filed under: Clojure,DSL — Patrick Durusau @ 12:58 pm

Growing a DSL with Clojure by Ambrose Bonnaire-Sergeant.

From the post:

From seed to full bloom, Ambrose takes us through the steps to grow a domain-specific language in Clojure.

Lisps like Clojure are well suited to creating rich DSLs that integrate seamlessly into the language.

You may have heard Lisps boasting about code being data and data being code. In this article we will define a DSL that benefits handsomely from this fact.

We will see our DSL evolve from humble beginnings, using successively more of Clojure’s powerful and unique means of abstraction.

You know, the “…code being data and data being code” line reminds me of DATATAG in ISO 8879 (SGML).

I suspect this gets us keys being first class citizens but that will have to await another post.

July 18, 2011

Introduction to Logic Programming with Clojure

Filed under: Clojure,Logic — Patrick Durusau @ 6:41 pm

Introduction to Logic Programming with Clojure

From the post:

How to use this Tutorial

This tutorial is meant to be used with a Clojure REPL handy. An example project has been set up.

You should be able to run all code examples in the logic-introduction.core namespace.

Won’t hurt you and could prove to be useful when having a go at logicians.

July 14, 2011

MapReduce with MongoDB and Clojure

Filed under: Clojure,MapReduce,MongoDB — Patrick Durusau @ 4:12 pm

MapReduce with MongoDB and Clojure

From the post:

A few days ago, we decided to create a dashboard in order to better visualize some statistics of our production systems. One important function is to plot the average latency as a time-series graph, so we can see the trend over time. Since MongoDB implemented MapReduce, and we store our logs in MongoDB, MapReduce seems a natural fit for log analysis.

One issue with MongoDB’s implementation of MapReduce is that no matter what language you use, you have to pass JavaScript code as strings to MongoDB. Storing code written in another language as strings in a program is … inelegant, to say the least.

Fortunately, Clojure being a homoiconic language, it is relatively easy to transform Clojure forms into code snippets of other languages using Clojure itself in the same program. In other words, it is possible to embed JavaScript programs in a Clojure program without actually seeing any JavaScript syntax. There are already a number of libraries, with different level of maturity, that allow you to transform Clojure forms to JavaScript. I haven’t done an extensive survey, but ClojureJS is good enough for our purpose.

Emphasis on homoiconic nature of Clojure.

July 10, 2011

Joy of Clojure – Bibliography

Filed under: Bibliography,Clojure — Patrick Durusau @ 3:38 pm

Joy of Clojure – Bibliography

OK, I’m an academic. I like bibliographies. 😉

I noticed it repeats what you will find in the The Joy of Clojure. That’s useful if you are at the library without your copy of Joy and can’t remember a particular citation. But not very useful otherwise.

Suggestion: Make the bibliography a dynamic one that accepts suggested annotated references from readers that point to particular sections or discussions in the text. Posting subject to the judgment of the authors.

Could prove to be useful in the event of a second or following edition.

Jark

Filed under: Clojure,Java — Patrick Durusau @ 3:38 pm

Jark

From the webpage:

A tool to manage classpaths and clojure namespaces on a persistent JVM

Why Jark

Startup time of the Java Virtual Machine(JVM) is too slow and thereby command-line applications on the JVM are sluggish and very painful to use. And there is no existing simple way for multiple clients to access the same instance of the JVM. Jark is an attempt to run a persistent JVM daemon and provide a set of utilities to control and operate on it.

Jark is intended to

  • deploy, maintain and debug clojure programs on remote hosts
  • provide an easy interface to run clojure programs on the command-line
  • provide a set of useful namespace and classpath utilities
  • provide a secure and robust implementation of a JVM daemon that multiple clients can connect to, seamlessly
  • provide a thin client that can run on any OS platform and with minimum runtime dependencies.
  • be VM agnostic: support for all VMs that clojure runs on in the future

In case you need a persistent JVM daemon.

July 8, 2011

Exposing Databases…

Filed under: Clojure,R2RML — Patrick Durusau @ 3:56 pm

Exposing databases as linked data using clojure, compojure and R2RML

From the post:

Some of these problems could be solved using some of the technologies developed as part of the semantic web initiative in the past decade. People have started referring to this pragmatic approach to the semantic web with a new title: Linked Data. The pragmatic approach here means putting less emphasis in the inference and ontological layers of the semantic web and just focusing in offer a simple way to expose data in the web linking resources across different web application and data sources.

Many interesting technologies are being developed under the linked data monicker or are commonly associated to it, RDFa for instance. Another of these technologies is R2RML: RDB to RDF Mapping Language.

R2RML describes a standard vocabulary to lift relational data to a RDF graph. It also provides a standard mapping for the relational data. This RDF graph can be serialized to some transport format: RDFa, Turtle, XML and then retrieved by the client. The client can store the triples in the graph locally and use the standard query language SPARQL to retrieve the information. Data from different applications using the same vocabulary (FOAF, GoodRelations) can be easily mixed and manipulated by the client in the same triple store. Furthermore, links to other resources can be inserted inside the RDF graph leading to the discovery of additional information.

Exposing data, even as an RDF graph, is a good thing.

Discovering additional information is also a good thing.

But they fall short of specifying the semantics of data, which is necessary to enable reliable identification of data with the same semantics.

Clojure – PragPub July 2011

Filed under: Clojure — Patrick Durusau @ 3:52 pm

Clojure – PragPub July 2011

Where you will find:

Clojure Building Blocks
by Jean-François “Jeff” Héon
Jeff introduces Clojure fundamentals and uses them to show why you might want to explore this language further.

Clojure Collections
by Steven Reynolds
Steven explains the benefits of immutability and explores how Clojure’s data collections handle it.

Create Unix Services with Clojure
by Aaron Bedra
Aaron is the coauthor (with Stuart Halloway) of the forthcoming Programming Clojure, Second Edition. Here he gives a practical, hands-on experience with Clojure.

Growing a DSL with Clojure
by Ambrose Bonnaire-Sergeant
From seed to full bloom, Ambrose takes us through the steps to grow a domain-specific language in Clojure.

disclojure

Filed under: Clojure — Patrick Durusau @ 7:55 am

disclojure: public disclosure of all things Clojure

Collection of pointers to resources, projects and groups.

July 6, 2011

Building a Database-Backed Clojure Web
Application

Filed under: Clojure,Cloud Computing — Patrick Durusau @ 2:15 pm

Building a Database-Backed Clojure Web Application

From the webpage:

This article will explore creating a database-backed Clojure web application and deploying it to the Heroku Cedar stack.

The app we’ll be building is called Shouter, a small Twitter clone that lets users enter in “shouts” which are stored in a PostgreSQL database and displayed on the front page of the app. You can see an example of the finished Shouter deployed to Heroku or view the finished source.

See Heroku to sign up for its cloud application platform.

I started to tease the DevCenter about the article Building a Facebook Application since Google is attempting to do the same thing. 😉

The I found that the article covers, however briefly, the Graph API and Open Graph Protocol, which makes it of more than passing interest for topic map applications.

July 4, 2011

Visualizing Mahout’s Output…

Filed under: Clojure,Mahout,Visualization — Patrick Durusau @ 6:05 pm

Visualizing Mahout’s output with Clojure and Incanter

From the post:

Some Clojure code to visualize clusters built using Apache Mahout implementation of the K-Means clustering algorithm.

The code retrieves the output of the algorithm (clustered-points and centroids) from HDFS, builds a Clojure friendly representation of the output (a map and a couple of lazy-seqs) and finally uses Incanter’s wrapper around JFreeChart to visualize the results.

Another tool for data miners and visualizers.

July 3, 2011

Clojure – Functional Programming for the JVM

Filed under: Clojure,Functional Programming — Patrick Durusau @ 7:31 pm

Clojure – Functional Programming for the JVM by R. Mark Volkmann.

From the introduction:

The goal of this article is to provide a fairly comprehensive introduction to the Clojure programming language. A large number of features are covered, each in a fairly brief manner. Feel free to skip around to the sections of most interest. The section names in the table of contents are hyperlinks to make this easier when reading on-line.

July 2, 2011

10+ Free Resources for Learning Clojure

Filed under: Clojure — Patrick Durusau @ 3:10 pm

10+ Free Resources for Learning Clojure

From the webpage:

Clojure is a dialect of the LISP programming language that runs on the Java Virtual Machine. It’s becoming increasingly popular as a modern functional programming language. This week O’Reilly Radar blogger Stuart Sierra called it “the hot new language of the moment.” He describes Clojure as “Lisp meets Java with a side of Erlang.” Interested? Here are a few free resources to get you started.

Let me add one to that list:

Clojure Libraries: Not a learning resource per se but one that you will find useful soon enough.

June 30, 2011

Guide to Programming in Clojure for Beginners

Filed under: Clojure,Functional Programming — Patrick Durusau @ 4:05 pm

Guide to Programming in Clojure for Beginners

Now there’s a learn a programming language exercise! Write a blogging platform in it!

Any Clojure experts want to venture an evaluation?

June 26, 2011

Hickey and the Associative Data Model

Filed under: Associative Model,Clojure — Patrick Durusau @ 4:11 pm

Rich Hickey Q&A by Michael Fogus appears in Code Quarterly, The Hackademic Journal.

The interview is entertaining but I mention it because of Hickey’s remarks on associative models, which reads in part:

When we drop down to the algorithm level, I think OO can seriously thwart reuse. In particular, the use of objects to represent simple informational data is almost criminal in its generation of per-piece-of-information micro-languages, i.e. the class methods, versus far more powerful, declarative, and generic methods like relational algebra. Inventing a class with its own interface to hold a piece of information is like inventing a new language to write every short story. This is anti-reuse, and, I think, results in an explosion of code in typical OO applications. Clojure eschews this and instead advocates a simple associative model for information. With it, one can write algorithms that can be reused across information types.

Topic maps are about semantic reuse.

June 25, 2011

Hammock-driven Development

Filed under: Authoring Topic Maps,Clojure — Patrick Durusau @ 8:51 pm

Hammock-driven Development

From the description:

Rich Hickey’s second, “philosophical” talk at the first Clojure Conj, in Durham, North Carolina on October 23rd, 2010.

The presentation reminded me of this story in Peopleware (p. 67):

In my years at Bell Labs, we worked in two-person offices. They were spacious, quiet, and the phones could be diverted. I shared my office with Wendl Thomis who went on to build a small empire as an electronic toy maker. In those days, he was working on the ESS fault dictionary. The dictionary scheme relied on the notion of n-space proximity, a concept hairy enough to challenge even Wendl’s powers of concentration. One afternoon, I was bent over a program listing while Wendl was staring into space, his feet propped up on the desk. Our boss came in and asked, “Wendl! What are you doing?” Wendl said, “I’m thinking.” And the boss said, “Can’t you do that at home?”

If you liked that story, you will like the presentation.

Everything that is said about software development is directly applicable to authoring topic maps and standards.

June 24, 2011

Clojure/core Reading List

Filed under: Clojure — Patrick Durusau @ 10:48 am

Clojure/core Reading List

Haven’t looked at all of them but the relational algebra with Clojure datatypes was excellent!

June 18, 2011

Jiraph

Filed under: Clojure,Graphs — Patrick Durusau @ 5:44 pm

Jiraph

From README:

Jiraph is an embedded graph database for Clojure. It is extremely fast and can walk 100,000 edges in about 3 seconds on my laptop. It uses Tokyo Cabinet for backend storage.

Multi-layer Graph

For performance and scalability, graphs in Jiraph are multi-layer graphs. Nodes exist on every layer. In this way, node data can be partitioned across all layers (similar to column families in some nosql databases). For our purposes, we’ll call the node data on a particular layer a node slice. Edges, on the other hand, can only exist on a single layer. All edges on a specific layer generally correspond in some way. The layer name can be thought of as the edge type, or alternatively, multiple similar edge types can exist on one layer.

Though layers can be used to organize your data, the primary motivation for layers is performance. All data for each layer is stored in a separate data store, which partitions the graph and speeds up walks by allowing them to load only the subset of the graph data they need. This means you should strive to put all graph data needed for a particular walk in one layer. This isn’t always possible, but it will improve speed because only one disk read will be required per walk step.

A Jiraph graph is just a clojure map of layer names (keywords) to datatypes that implement the jiraph.layer/Layer protocol.

Nodes and Edges

Every node slice is just a clojure map of attributes. It is conventional to use keywords for the keys, but the values can be arbitrary clojure data structures. Each edge is also a map of attributes. Internally, outgoing edges are stored as a map from node-ids to attributes in the :edges attribute on the corresponding node slice. This way, a node and all its outgoing edges can be loaded with one disk read.
…(more follows)

I like the rewind feature, that could be very helpful.

June 17, 2011

Clojure Tutorial For the Non-Lisp Programmer

Filed under: Clojure — Patrick Durusau @ 7:15 pm

Clojure Tutorial For the Non-Lisp Programmer

From the post:

Clojure is a new programming language that uses the Java Virtual Runtime as its platform. Clojure is a dialect of Lisp. The language home page is at http://clojure.org/.

It is all written that directly.

June 14, 2011

Clojure Tutorial for Clojure Newbies

Filed under: Clojure,Searching — Patrick Durusau @ 9:19 am

Clojure Tutorial for Clojure Newbies

From the webpage:

If, like so many other developers, you suffer from a mild addition to Hacker News, then you’ve surely run across a reference to the Clojure language (pronounced “closure”) more than once while perusing the latest headlines. A Lisp dialect targeting the JVM runtime, Clojure users stand to gain from the portability and stability of the JVM, the rich syntax of a functional language, and the ability to integrate with the enormous Java ecosystem. These advantages have clearly resonated with the programming community, as a swarm of activity has amassed around the language in the four years since its inception.

If you’ve been wondering what all the buzz is about, this article offers a practical, hands-on overview to Clojure, covering the installation process, basic syntax, and potential for Web development.

This isn’t really a tutorial in the sense that you get very far but it does have a good list of resources on page 2.

Looking for something better to recommend, I got the following search results:

  • clojure tutorial – 468,000 “hits”
  • “clojure tutorial” – 2,040 “hits”

The third “hit” on the last query was Clojure Tutorials at Learn Clojure.

Maybe I should do something more systematic on the power of parentheses. What do you think?

May 4, 2011

Clojure Atlas

Filed under: Clojure — Patrick Durusau @ 12:10 pm

Clojure Atlas

From the website:

Learn Clojure faster, use Clojure wisely.

Instant access to documentation, source, lovingly-crafted conceptual relationships, and a dynamic visualization of how everything ties together.

Because a great language deserves to be paired with a great way to understand it.

For viewing:

Clojure Atlas requires a “modern” browser. Specifically, Chrome, Safari, Internet Explorer 9, or Firefox 3+ (in that order of preference; Firefox is sadly quite the dog when it comes to SVG).

BTW, years ago I suggested to someone that topic maps would be a great way to visualize Java in general and in particular with regard to its application in programs.

The response:

Why do that? We have Javadocs.

The Clojure Atlas is my somewhat belated response.

Imagine being able to drill down from the Clojure language to examples in running code?

Or drilling up from running code to the Clojure language?

Or stopping along the way to see other running code with the same concepts?

I don’t know if those sort of features are planned for the Clojure Atlas, but they certainly are possible with topic maps.

April 18, 2011

Perception and Action: An Introduction to Clojure’s Time Model

Filed under: Clojure,Subject Identity,Time — Patrick Durusau @ 1:54 pm

Perception and Action: An Introduction to Clojure’s Time Model

Summary:

Stuart Halloway discusses how we use a total control time model, proposing a different one that represents the world more accurately helping to solve some of the concurrency and parallelism problem.

To tempt you into watching this video, consider the following slide:

identity

  • continuity over time
    • built by minds
  • sameness across a series of perceptions
  • not a name, but can be named
  • can be composite

I will be posting other material from this presentation (as well as watching the video more than once).

(BTW, I saw the reference to this presentation in a tweet from Alex Popescu, myNoSQL.)

February 19, 2011

ElephantDB

Filed under: Clojure,ElephantDB — Patrick Durusau @ 4:30 pm

ElephantDB

From the website:

ElephantDB is a database that specializes in exporting key/value data from Hadoop. ElephantDB is composed of two components. The first is a library that is used in MapReduce jobs for creating an indexed key/value dataset that is stored on a distributed filesystem. The second component is a daemon that can download a subset of a dataset and serve it in a read-only, random-access fashion. A group of machines working together to serve a full dataset is called a ring.

Since ElephantDB server doesn’t support random writes, it is almost laughingly simple. Once the server loads up its subset of the data, it does very little. This leads to ElephantDB being rock-solid in production, since there’s almost no moving parts.

ElephantDB server has a Thrift interface, so any language can make reads from it. The database itself is implemented in Clojure.

I rather like that, “…almost no moving parts.”

That has to pay real dividends over the id shuffle in some topic map implementations. Both in terms of processing overhead as well as in auditing.

December 11, 2010

Cascalog

Filed under: Cascalog,Clojure,Hadoop,TMQL — Patrick Durusau @ 3:23 pm

Cascalog

From the website:

Cascalog is a tool for processing data on Hadoop with Clojure in a concise and expressive manner. Cascalog combines two cutting edge technologies in Clojure and Hadoop and resurrects an old one in Datalog. Cascalog is high performance, flexible, and robust.

Most query languages, like SQL, Pig, and Hive, are custom languages — and this leads to huge amounts of accidental complexity. Constructing queries dynamically by doing string manipulation is an impedance mismatch and makes usual programming techniques like abstraction and composition difficult.

Cascalog queries are first-class within Clojure and are extremely composable. Additionally, the Datalog syntax of Cascalog is simpler and more expressive than SQL-based languages.

Follow the getting started steps, check out the tutorial, and you’ll be running Cascalog queries on your local computer within 5 minutes.

Seems like I have heard the term datalog in TMQL discussions. 😉

I wonder what it would be like to define TMQL operators in Cascalog so that all the other capabilities of Cascalog are also available?

When the next draft appears that will be an interesting question to explore.

Accidental Complexity

Filed under: Clojure,Data Mining,Software — Patrick Durusau @ 3:22 pm

Nathan Marz in Clojure at Backtype uses the term accidental complexity.

accidental complexity: Complexity caused by the tool to solve a problem rather than the problem itself

According to Nathan, Clojure helps avoid accidental complexity, something that would be useful in any semantic integration system.

The presentation is described as:

Clojure has led to a significant reduction in complexity in BackType’s systems. BackType uses Clojure all over the backend, from processing data on Hadoop to a custom database to realtime workers. In this talk Nathan will give a crash course on Clojure and using it to build data-driven systems.

Very much worth the time to view it, even more than once.

« Newer Posts

Powered by WordPress