We exploit the Python eco-system to make a GUI for a Prolog program, run with SWI-Prolog, in under 10 minutes
When we start doing knowledge representation in Prolog, we start needing to describe the properties of relations so we can infer more than is in our recorded data. Symmetry, reflexivity and transitivity are the three main relationship properties you'll end up using. In this interactive post we take a look at how they can be encoded.
Knowledge Graphs are a hot topic, no wonder considering how powerful they can be. However, learning how to create, develop, and use them can be a bit of a minefield. In this post we provide a high-level overview and recommend some learning resources.
Simple, classic games like Rock, Paper, Scissors are good to code when learning a new language. The lovely thing about making this game in Prolog is you’re just encoding what it is, not how it is. It’s a subtle difference, but I’ll point it out during this explanation.
Some folks don’t make their data available through RDF formats, or nice SPARQL endpoints, instead they provide a (REST/RESTFUL) API and will return JSON data for your request. It can be a little tricky figuring out how to get this data into your SWI-Prolog program. So in this post I demonstrate with a simple example.
Reading the docs for plunit, it can be quite tricky to figure out how to setup a nice unit testing environment and actually run those tests. In this post I demonstrate how I do it, keeping my tests separate from my code, and running them with a handy command.
Another little known Python feature that deserves more love. This time we’re looking at the send function that lets you input values into your generator as it’s running. It works through yield and is awesome!
In Python we have for loops and list comprehension. In this post we’ll examine the semantic difference between the two in order to determine when it is appropriate to use each one.
It’s tricky to find out how to set up RDFLib Graph to use a RDBS backend, but it can be done using SQLAlchemy and RDFLib-SQLAlchemy. This means it’ll support all the engines SQLAlchemy does, including MySQL and Postgres. I’ll highlight two gotchas to look out for when using RDFLib-SQLAlchemy and walk you through getting setup using a wrapper class to RDFLIB Graph.
Many of the unusual symbols we use when writing Description Logics are sadly not found on the keyboard. I wrote myself a little cheat sheet to remind myself of the correct unicode or LaTeX for the common symbols and added a short description of each symbol as well. It’s very useful to print out and keep near your keyboard so you can type Description Logics quickly and painlessly.