Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reasoning doesn't recognize subClassOf

Tags:

owl

rdfs

stardog

in stardog studio, I have created a basic database. and added the following rdf data.

When I query this database with a reasoning "on", I don't find expected results.

I expect Alice, Charlie to be recognized as http://example.org/Person. When activating reasoning, everything is recognised as owl:Thing, and no inference is made about Alice being a Person

`<?xml version="1.0"?>
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:ex="http://example.org/">

<!-- Classes -->
<rdf:Description rdf:about="http://example.org/Person">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
    <rdfs:label>Person</rdfs:label>
</rdf:Description>
<rdf:Description rdf:about="http://example.org/Student">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
    <rdfs:subClassOf rdf:resource="http://example.org/Person"/>
    <rdfs:label>Student</rdfs:label>
</rdf:Description>
<!-- Instances -->
<rdf:Description rdf:about="http://example.org/Alice">
    <rdf:type rdf:resource="http://example.org/Student"/>
    <rdfs:label>Alice</rdfs:label>
</rdf:Description>
<rdf:Description rdf:about="http://example.org/Charlie">
    <rdf:type rdf:resource="http://example.org/Person"/>
    <rdfs:label>Charlie</rdfs:label>
</rdf:Description>
</rdf:RDF>`

Query

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 PREFIX ex: <http://example.org/>
 SELECT ?individual ?class
 WHERE {
 ?individual rdf:type ?class .
 }
like image 503
MaoZerhouni Avatar asked Feb 05 '26 03:02

MaoZerhouni


1 Answers

I think I found the reason. It seems that Stardog Studio separate between assertions and models. For reasoning, it only uses the relationships that are used in models, not databases.

When I add the classes in Models, reasoning produce the expected result.

like image 186
MaoZerhouni Avatar answered Feb 09 '26 03:02

MaoZerhouni