How to use the owlrl.OWLRL_Extension function in owlrl

To help you get started, we’ve selected a few owlrl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tetherless-world / whyis / whyis / commands / run_rl_reasoner.py View on Github external
def run(self, closure_bool = False, axiomatic_bool = False, datatype_axiom_bool = False):
        app = flask.current_app # set app to be current flask app 
        new_graph = rdflib.ConjunctiveGraph() # create new empty graph to run reasoner
        new_graph += app.db # add current graph to new graph
        owlrl.DeductiveClosure(owlrl.OWLRL_Extension, rdfs_closure = closure_bool, axiomatic_triples = axiomatic_bool, datatype_axioms = datatype_axiom_bool).expand(new_graph) # run reasoner using specified options
        new_graph -= app.db # remove content from initial graph from the new graph
        # output graph (for testing purposes mostly)
        new_graph.serialize("inferred_graph.ttl", format="turtle")

owlrl

A simple implementation of the OWL2 RL Profile, as well as a basic RDFS inference, on top of RDFLib. Based mechanical forward chaining.

W3C
Latest version published 8 days ago

Package Health Score

67 / 100
Full package analysis