As You Wish

If you’re a Princess Bride movie fan, you likely keep your distance from Iocane Powder, have a lot of fun shouting "INCONCEIVABLE" and often respond to your significant other with "As you wish."

Recently, I was at a customer site and asked to demonstrate how MarkLogic’s Enterprise NoSQL database was also a bonafide, W3C-compliant triplestore. Although my esteemed customer was not Princess Buttercup, I dutifully replied, "As you wish."

My first action was to navigate to DBpedia via the following URL,, and select the N3/Turtle link at the bottom of the page. This displayed the information in RDF-compliant Turtle format, a snippet of which is shown here:

dbpedia-owl:abstract "The Princess Bride is a 1987 American romantic comedy fantasy adventure film directed and co-produced by Rob Reiner... "

After an easy copy/paste into a file named /tmp/princess.ttl I was ready.

MarkLogic's query console is an excellent tool for creating magic, and the out-of-the-box "Documents" database is a handy repository for quick storage, retrieval and code testing. In this case, I ensured its triple index was set to true and ran the following few lines of code.

The response was a list of documents created in the /triplestore directory.

  • /triplestore/4a129b8c1da22733.xml
  • /triplestore/44c261eff97882a1.xml
  • /triplestore/be39182b56e34d14.xml

Next we looked at this file’s representation in the MarkLogic database with the following line of Query Console code:


The output is what you see here:

Any self-respecting Princess Bride aficionado would recognize that as a proprietary format and say, "prepare to die!"

However, one only needs to run the following code in Query Console to see that the internal representation can easily reproduce the original Turtle representation of the documents, along with a variety of other RDF serializations such as N-Quad, N-Triple, RDF/XML, RDF/JSON, N3, TriG and Triple XML.

It’s important to note that MarkLogic stores the information in this format in order to natively integrate the triplestore with its document store and to deliver its industry-leading enterprise NoSQL database features such as performance, government-grade security and ACID transactions at scale. This is unique in the industry, as our customer base will attest.

Furthermore, MarkLogic’s support for the W3C standard SPARQL 1.1 language, allowed me to display all the Princess Bride triples with the following snippet of code:

select * where {?s ?p ?o }

Combined, these features helped put MarkLogic in the Leaders quadrant of Gartner’s "Operational Database Management Report."

After running these code samples a few times my customer rewarded me with an enthusiastic "INCONCEIVABLE!" He made my day!