Thursday, August 10, 2017

Yet another reason for querying RDF with Prolog.

In a previous work position, I enjoyed querying entirely in Allegro Prolog rather than SPARQL.  At some point, I found that I needed the performance of their better query optimizer associated with their implementation of SPARQL.  Then I wrote my own layer over their SPARQL that made it look much like their Prolog.  In other posts I've talked about some of the advantages of a semantic Prolog for RDF queries.  In my current work, however, I've needed to use much more SPARQL for various reasons, and in that process, I've found an additional reason to value Prolog as a semantic query mechanism.   I have several issues with SPARQL, but, perhaps the biggest is the fact that it takes graph data and returns flat tuples - essentially spreadsheet data.  The CONSTRUCT construct is very useful that way but all of my present semantic query needs revolve around pulling semantic data into my application environments.  Prolog, on the other hand, can return nested data - lists within lists within lists - using bagof and setof.

No comments:

Post a Comment