Working with JSON in XQuery

Author: Dave Cassel  |  Category: Software Development

MarkLogic supports two native languages, XQuery and JavaScript. XQuery is a very natural way to work with XML, just as JavaScript is a very natural way to work with JSON. However, sometimes it’s useful to cross over and work with JSON using XQuery or vice versa. This post has some tips on using XQuery to […]

Data Hub Framework Flows

Author: Dave Cassel  |  Category: Software Development

The Data Hub Framework is a feature recently added to MarkLogic that makes it easier to gather data from a variety of sources and build a common representation across the original formats. I learned some useful things about working with the framework that I thought were worth writing down (partly so that I’ll remember them). […]

Evolution of modeling relationships in MarkLogic

Author: Dave Cassel  |  Category: Software Development

MarkLogic, as a multi-model database, can store data both as documents and as triples. We model entities as documents. Over time, the way we’ve modeled relationships has changed. In the Beginning Prior to MarkLogic 7, relationships were modeled by including either a URI or some other identifier as an element or attribute. In most cases, […]

Building a MarkLogic Data Model

Author: Dave Cassel  |  Category: Software Development

This post is an excerpt from a book I’m working on: MarkLogic for Node.js Developers. This section is part of a chapter on Data Modeling, falling after a comparison to relational database modeling and a discussion of denormalization. The goal is to address the question of what should be a document in MarkLogic. The next […]

Focusing on the community

Author: Dave Cassel  |  Category: Career

I’ve got a new focus — I’m now the Developer Community Manager for MarkLogic. I’m really excited about this – it’s a chance to work with a growing community of great developers. My new goal, in a nutshell, is to increase the community of developers who know how to work with MarkLogic. I’ve got a bunch […]

Memoization in XQuery

Author: Dave Cassel  |  Category: Software Development

Memoization is tracking partial solutions so that they don’t have to be recalculated. A good example of where this is handy is the Fibonacci sequence. You may remember that the definition of this is: F(n) = F(n -1) + F(n – 2) F(1) = 1 F(2) = 1 Clearly, this is a recursive function. Let’s take a […]

Loading JSON into MarkLogic 7

Author: Dave Cassel  |  Category: Software Development

This post shows how to ingest JSON into MarkLogic 7 using mlcp. Unlike many, this one is very specific to MarkLogic 7. Since the release of MarkLogic 6, MarkLogic Content Pump (mlcp) has been the supported tool for importing, exporting, and copying content. One feature that’s missing from it is the ability to load JSON files […]

MarkLogic, Angular, and node: Authentication

Author: Dave Cassel  |  Category: Software Development

My first effort with the DemoCat application had a pretty simple architecture: node hosted static resources and passed REST requests straight through to MarkLogic. This approach is more in keeping with the three-tier architecture that MarkLogic’s customers typically use, but my middle tier was doing almost nothing. I’ve made some improvements, especially related to user management. […]

mlFacets directive

Author: Dave Cassel  |  Category: Software Development

My group within MarkLogic is moving to using AngularJS for the front-end code of our MarkLogic applications. One of the things I like about AngularJS is how many directives are already out there, and thus available for us to use in MarkLogic-driven web applications. Of course, not everything is already out there, and I want […]

Fixing a slow XQuery function

Author: Dave Cassel  |  Category: Software Development

Sometimes an application is slower to respond than we like. There are a variety of reasons this can happen — hardware, indexes, algorithms. MarkLogic offers some tools to investigate the software aspects of code running too slow. The rest of this post is a case study investigating slow responses on a project I worked on […]