RDFLib / OWL-RL

A simple implementation of the OWL2 RL Profile on top of RDFLib: it expands the graph with all possible triples that OWL RL defines. It can be used together with RDFLib to expand an RDFLib Graph object, or as a stand alone service with its own serialization.
http://www.ivan-herman.net/Misc/2008/owlrl/
Other
139 stars 30 forks source link

Domain (and range) of rdfs:subClassOf #21

Closed wartaal closed 5 years ago

wartaal commented 5 years ago

I try to extend the following fragment

    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    @prefix hsh: <http://hsh.de/bim3#> .

    rdfs:subClassOf rdfs:domain rdfs:Class .

    hsh:dog  rdfs:subClassOf hsh:animal.

In the extended graph, now there is a statement:

hsh:dog a rdfs:Class,
        rdfs:Resource ;
    rdfs:subClassOf hsh:animal,
        hsh:dog,
        rdfs:Resource .

This is what I expected. However, wehen I leave out the first triple (rdfs:subClassOf rdfs:domain rdfs:Class .) which is already part of rdfs definition, the result does not include the fact that hsh:dog a rdfs:Class anymore. Is this a feature or a bug?

wartaal commented 5 years ago

Sorry, I found the soultion in the source code:

RDFClosure.DeductiveClosure(RDFClosure.RDFS_Semantics, axiomatic_triples=True)

would be nice to have some documentation (not on the implementation but on the functions that can be used) making it easier to just use the library!

nicholascar commented 5 years ago

We are getting there with the documentation! We hope to have a readthedoc.io-style documentation built out of the source code up by later December. Just want to complete a few integration tests first and publish this as a module on PyPI.