RDFox allows the user to control semantic reasoning, otherwise known as knowledge based AI, by adding Datalog rules to a data store.
Rules are essentially if-then statements that add data to the graph when certain conditions are met.
These rules can specify a pattern that is matched to triples, like this:
(This rule assigns the nickname “Bob” to all people named “Robert”)
They can also use expressions borrowed from SPARQL (like BIND or FILTER) as well as SPARQL functions:
(This rule concatenates a person’s first and last names to create their full name)
(This rule assigns the position of manager to anyone who has “manager” in their job description)
The functions allow the user to manipulate strings, numbers, dates, and IRIs. Some of the examples include:
RDFox also extends Datalog to include negation:
(This rule assigns the class “unemployed” to all people without jobs)
And aggregation:
(This rule adds a property assigning the number of children to each person who has any)