Inference examples

Could anyone here help point to some good, concise examples of using inference based on OWL, RDFS, SKOS, etc.?

[ And, ideally, related Py code – though any lang will do! ]

There’s the OWL-2-RL spec, and we’ve integrated rdflib/OWL-RL and parts of Skosify into kglab to support inference cases. So far, there are some relatively simple examples given in although I’d love to show something more substantial – without having to get into RIF just yet, or integrating a more complex reasoning system in this Py example code.

FWIW, I’ve seen riftr but was looking for code that’s a wee bit more “production ready” that this :slight_smile: Also looked into owlready2 although that gets into “ontology-oriented programming” which appears to be a bit challenging to integrate the PyData-ish pipelines (pandas, numpy, spacy, etc.) that we’re focused on.

Related Q&A:

Many thanks -

This demonstrates some inferencing inside of Blazegraph: Triplestores are often the best place to find inferencing engines. It’s all using standard RDFS and a tiny bit of OWL, so it should work in GraphDB the same way. (The beauty of standards…) shows an example of doing inferencing with Python to make it fit into a Hadoop infrastructure. It takes advantage of the rdflib Python library’s ability to do inferencing. Apart from doing this on a Hadoop infrastructure, the example also demos how inferencing can be useful for data integration projects, and it demos the ease of using a model-driven approach for the application: after writing and running a conversion routine that uses inferencing, adding a few triples to the RDFS data model lets the application convert and do inferencing with even more data with no changes to the Python script.

1 Like

Many thanks Bob! I appreciate the RDFS examples and pointers to your blog especially.

1 Like