You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Jérémy Coulon <je...@gmail.com> on 2017/02/13 16:17:16 UTC

Missing inferred triples with RDFS Reasoner

Hello,

It seems like some triples are missing when using Jena RDFS reasoner.
With the following code:

Model xsdOntModel = ModelFactory.createDefaultModel();
xsdOntModel.add(XSD.xboolean, RDF.type, RDFS.Datatype);
Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
InfModel infModel = ModelFactory.createInfModel(reasoner, xsdOntModel);
infModel.write(System.out, "TTL");

I can see in the results:
xsd:boolean a rdfs:Datatype, rdfs:Class, rdfs:Resource .

However the following triple is missing:
xsd:boolean rdfs:subClassOf xsd:boolean .

Is it a bug in Jena ? (I am using Jena 3.0).

Thank you for your help.

Re: Missing inferred triples with RDFS Reasoner

Posted by Dave Reynolds <da...@gmail.com>.
On 13/02/17 16:17, J�r�my Coulon wrote:
> Hello,
>
> It seems like some triples are missing when using Jena RDFS reasoner.
> With the following code:
>
> Model xsdOntModel = ModelFactory.createDefaultModel();
> xsdOntModel.add(XSD.xboolean, RDF.type, RDFS.Datatype);
> Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
> InfModel infModel = ModelFactory.createInfModel(reasoner, xsdOntModel);
> infModel.write(System.out, "TTL");
>
> I can see in the results:
> xsd:boolean a rdfs:Datatype, rdfs:Class, rdfs:Resource .
>
> However the following triple is missing:
> xsd:boolean rdfs:subClassOf xsd:boolean .
>
> Is it a bug in Jena ? (I am using Jena 3.0).

Well, certainly an incompleteness. Jena doesn't guarantee completeness 
of RDFS (or OWL) reasoning. The rules try to balance "useful" inferences 
against performance and don't always get the perfect balance.

Though it's not immediately obviously why in this case the "all classes 
are subclasses of themselves" axiom is getting missed out.

You would work around this by explicitly declaring that XSD.xboolean is 
a class:

         xsdOntModel.add(XSD.xboolean, RDF.type, RDFS.Class);

Dave