You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Gregor Müllegger <gr...@muellegger.de> on 2014/01/16 19:15:43 UTC

Understanding the difference between classify and enrich reasoning behaviour.

Hi together,

I'm playing around with the stanbol reasoners lately, however I don't find
the
behaviour very intuitive nor compliant to the docs.

The docs say:
  * classify: to materialize all inferred rdf:type statements.
  * enrich: to materialize all inferred statements.

So in my understanding, the enrich task will always be a superset of (and
therefore include) the results of classify.

However I get other results!

The classification takes place for "classify" but not for "enrich". Here is
my
`tmp.xml` test file:

    <?xml version="1.0" encoding="UTF-8"?>
    <rdf:RDF
       xmlns="http://example.com/labels/"
       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    >
      <rdf:Description rdf:about="http://example.com/labels/Document">
        <rdfs:subClassOf rdf:resource="http://example.com/labels/ContentItem
"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://example.com/labels/item1">
        <rdf:type rdf:resource="http://example.com/labels/Article"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://example.com/labels/author">
        <rdfs:domain rdf:resource="http://example.com/labels/Author"/>
        <rdfs:range rdf:resource="http://example.com/labels/ContentItem"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://example.com/labels/myname">
        <author rdf:resource="http://example.com/labels/item1"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://example.com/labels/Article">
        <rdfs:subClassOf rdf:resource="http://example.com/labels/Document"/>
      </rdf:Description>
    </rdf:RDF>

Basically I'm looking for an inference that states `:item1 rdf:type
:Document`. Here are the requests I fire on the `owl` end point:

    $ curl -s -X POST -H "Content-type: multipart/form-data" -H "Accept:
text/turtle" -F file=@tmp.xml "http://localhost:8080/reasoners/owl/classify"
| grep "item1" -A 1
    <http://example.com/labels/item1>
          a       <http://example.com/labels/Article> , <
http://www.w3.org/2000/01/rdf-schema#Resource> , <
http://example.com/labels/Document> , <http://example.com/labels/ContentItem>
.
    $ curl -s -X POST -H "Content-type: multipart/form-data" -H "Accept:
text/turtle" -F file=@tmp.xml "http://localhost:8080/reasoners/owl/enrich"
| grep "item1" -A 1
    $ # not that there was no output by the second command

That irritates me quite much. Do you know what the desired behaviour of the
endpoints are?

This behaviour is the same for `rdfs`, `owlmini` and `owl`. However not for
`owl2`:

    $ curl -s -X POST -H "Content-type: multipart/form-data" -H "Accept:
text/turtle" -F file=@tmp.xml "http://localhost:8080/reasoners/owl2/classify"
| grep "item1" -A 3
    ###  http://example.com/labels/item1

    <http://example.com/labels/item1> rdf:type <
http://example.com/labels/Article> ,
                                               <
http://example.com/labels/ContentItem> ,
                                               <
http://example.com/labels/Document> ,
                                               owl:NamedIndividual ,
    $ curl -s -X POST -H "Content-type: multipart/form-data" -H "Accept:
text/turtle" -F file=@tmp.xml "http://localhost:8080/reasoners/owl2/enrich"
| grep "item1" -A 3
    ###  http://example.com/labels/item1

    <http://example.com/labels/item1> rdf:type <
http://example.com/labels/Article> ,
                                               <
http://example.com/labels/ContentItem> ,
                                               <
http://example.com/labels/Document> ,
                                               owl:NamedIndividual ,

For the reference: I'm using a build of the 0.12 release branch.

Best regards,
Gregor