September interim release of MLJS – more semantics!…

OK So I know I promised to keep to two monthly publishing schedules – but I’ve fixed so much in the ML7 widgets, and they seem to be getting used so much, that I thought it worth doing an interim release. Read on for the changes…

We’ve ran an internal demo competition which meant I had some motivation to fixing a few niggling issues in the Sparql bar interactive query widget. These occurred through using innerHTML += rather than appendChild. All is working well now in this September release of version 0.9 of MLJS.

I’ve also added a couple of neat features to the sparqlbar. The first is auto complete suggestions. As you type three of more characters the widget will now execute SPARQL based on the current entity you’re providing a property value for and perform a simple regex match to provide 10 suggestions. Works nice and fast.

The second addition is support for comparison operators like <, >, <=, >= and != in integer and double typed properties. This meant adding some features to the semantic context. More on that in my next blog post, as its currently horrendously complex to use. I hope to simplify it greatly in the V7 October release. Still, it’s a cool feature. I used it to restrict query results for a bank balance to less than 100.00 GBP. Under the hood this is generating a FILTER statement for the property.

There was a bug I unintentionally introduced to the mldbwebtest app. The fix was in the mljs.js file in the root on GitHub, but not the test Roxy hybrid app. Thus those that downloaded the test app found they couldn’t do a content search. This has been rectified and is serious enough to warrant an interim release in its own right.

I’ve added the ability to provide a structured query to the content context rather than always replace it. This means multiple widgets can contribute query terms and the context will join them together in an AND query prior to submission. This is a neat feature I needed so that a simple term query (word search) from a searchbar could be combined with a list of document URIs provided out the back of a sparql search. (Linking customer to documents). A neat feature that will probably help with including geospatial queries from maps in the future.

The Entity Facts widget has been improved to be a bit more resilient and use more common sense when displaying entity data. This is especially useful in situations where you’ve not defined the entire ontology in the UI but still want to browse all the data. This is now fully supported.

As for new features, I’ve also added the ability to lookup any old sets of triples in the semantic context (queryFacts) and display these in the Google Kratu table widget. Thus Kratu is my first visualisation over the MarkLogic triplestore! HighCharts are next on the list…

A really new, and very cool, feature that myself and my colleagues Ken Tune and Jochen Joerg have created is an rdb2rdf widget and rest extension. These form the basis of our entry to the internal demo comp. Basically rdb2rdf is a W3C standard for taking RDBMS data and importing it in to a triple store. I’ve implemented the Direct Mapping to keep it simple for now. You use MLSAM to provide a database connection, and this rest extension introspects the database.

Rdb2rdf relies on ANSI SQL for retrieving data, the ` character for escaping column names, DESCRIBE and Information Schema support. I hope to reduce these dependencies to just Information Schema and ANSI SQL in the future.

This extension works surprisingly well, with a database consisting of around 14 tables and something like 5000 rows averaging 10 fields taking only 8 seconds to import over a WAN connection. The extension and MLJS support listing the schema on the MLSAM URL, describing each schema (listing tables and relationships and row counts), and performing an import (single table, all or specified columns, offset and limit as to how much data to ingest, and provision of a graph name for the triples).


RDBMS migrations is a hot topic, as is MarkLogic 7’s triple store and semantic query support. Internally and externally several people are starting to use MLJS for real projects to save time in development. I hope to provide a significant resource to the MarkLogic community next month in a wide ranging set of widgets to cover off most common MarkLogic usage scenarios. They should provide all that AppBuilder supports, plus a bunch of semantic capabilities and unique visualisations, not to mention document upload/ingest support!

Let me know what features you want from the next release as it helps me prioritise my massive todo list!

If you’re interested in seeing the demo we built, It’s below from my YouTube account! Go see it in all its glory here also:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s