How to use the owlrl.RDFS_Semantics 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 BrickSchema / Brick / tests / util / reasoner.py View on Github external
def reason_rdfs(g):
    """
    Applies RDFS reasoning. Takes a few seconds.

    Lets us use:
    - class hierarchy (rdf:type, not rdf:type/rdfs:subClassOf*)
    """
    start_time = time.time()
    owlrl.DeductiveClosure(owlrl.RDFS_Semantics).expand(g)
    end_time = time.time()
    print('owlrl reasoning took {0} seconds.'.format(int(end_time - start_time)))
github BrickSchema / Brick / brickschema / brickschema / inference.py View on Github external
def expand(self, graph):
        for triple in graph:
            self.g.add(triple)
        owlrl.DeductiveClosure(owlrl.RDFS_Semantics).expand(self.g.g)
        return self.g

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 23 days ago

Package Health Score

67 / 100
Full package analysis