Skip to content

--include-indirect seems broken #1259

@joeflack4

Description

@joeflack4

I noticed oddities in one of my projects, and I decided to create a small experiment, and in this experiment, I also cannot get --include-indirect true to work.

Expected behavior:

If I reason on a chain of direct SC relationships, e.g. A ⊑ B ⊑ C, I should get indirect relationships, e.g. A ⊑ C in my output.

Actual behavior:

I don't.

Replicability

  1. Create files
    chain.ttl:
@prefix :       <http://example.org/chain#> .
@prefix owl:    <http://www.w3.org/2002/07/owl#> .
@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .

:A rdf:type owl:Class ;
  rdfs:subClassOf :B .

:B rdf:type owl:Class ;
  rdfs:subClassOf :C .

:C rdf:type owl:Class .

makefile:

direct.ttl: chain.ttl
	robot reason \
	  --input $< \
	  --output $@

direct2.ttl: chain.ttl
	robot reason \
	  --input $< \
	  --include-indirect false \
	  --output $@

indirect.ttl: chain.ttl
	robot reason \
	  --input $< \
	  --include-indirect true \
	  --output $@

.PHONY: check
check: direct.ttl direct2.ttl indirect.ttl
	@echo "=== direct.ttl ==="
	grep "subClassOf" direct.ttl
	md5 direct.ttl
	@echo "=== direct2.ttl ==="
	grep "subClassOf" direct2.ttl
	md5 direct2.ttl
	@echo "\n=== indirect.ttl ==="
	grep "subClassOf" indirect.ttl
	md5 indirect.ttl
  1. Run & observe
make check -B
robot reason \
	  --input chain.ttl \
	  --output direct.ttl
robot reason \
	  --input chain.ttl \
	  --include-indirect false \
	  --output direct2.ttl
robot reason \
	  --input chain.ttl \
	  --include-indirect true \
	  --output indirect.ttl
=== direct.ttl ===
grep "subClassOf" direct.ttl
                             rdfs:subClassOf <http://example.org/chain#B> .
                             rdfs:subClassOf <http://example.org/chain#C> .
                             rdfs:subClassOf owl:Thing .
md5 direct.ttl
MD5 (direct.ttl) = 217dcb5e672934375456a4586bb61fda
=== direct2.ttl ===
grep "subClassOf" direct2.ttl
                             rdfs:subClassOf <http://example.org/chain#B> .
                             rdfs:subClassOf <http://example.org/chain#C> .
                             rdfs:subClassOf owl:Thing .
md5 direct2.ttl
MD5 (direct2.ttl) = 217dcb5e672934375456a4586bb61fda

=== indirect.ttl ===
grep "subClassOf" indirect.ttl
                             rdfs:subClassOf <http://example.org/chain#B> .
                             rdfs:subClassOf <http://example.org/chain#C> .
                             rdfs:subClassOf owl:Thing .
md5 indirect.ttl
MD5 (indirect.ttl) = 217dcb5e672934375456a4586bb61fda

Observe that grep and md5 yield the same results whether include-indirect is true, false, or entirely absent.

I would've expected to see a second rdfs:subClassOf <http://example.org/chain#C> . in indirect.ttl.

Additional info

  • This behavior exists in version 1.9.0 (the one I tried first), and the latest version 1.9.8.
  • I'm using MacOS, if that matters.
  • robot reason docs
  • robot reason --help:
 -d,--include-indirect <arg>                       if true, assert direct and indirect axioms

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions