Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a --include-indirect option to materialize #1213

Open
cmungall opened this issue Aug 14, 2024 · 6 comments · May be fixed by #1215
Open

Add a --include-indirect option to materialize #1213

cmungall opened this issue Aug 14, 2024 · 6 comments · May be fixed by #1215

Comments

@cmungall
Copy link
Contributor

cmungall commented Aug 14, 2024

From slack:

Hi all, I have a question about the use of the materialize command. Let's consider the following axioms:

car SubclassOf has part some wheel
convertible SubclassOf car

I would like to assert the inferred axiom:

convertible SubclassOf has part some wheel

My comprehension is that I should use the materialize command like this: robot materialize -i input.owl --reasoner ELK --term IRI:convertible -o output.owl

However, I don't see any difference between input and output (Robot v1.9.6)

@cmungall
Copy link
Contributor Author

cmungall commented Aug 14, 2024

My response:

Materialize still produces an ontology that is in some sense non-redundant. It lacks the analog of --include-indirect in reason

However, we should clarify the intended semantics. the words "direct" and "redundant" are often used imprecisely

consider:

car SubclassOf has part some wheel
convertible SubclassOf car
wheel SubClassOf has part some hubcap
Transitive(has part)

visualized as:
image

Would you also expect to see convertible has-part hubcap?

This is in some sense the most straightforward scenario and is the output of relation-graph

If you want the most specific relationships materialized, currently this is only handled by OAK:

runoak -i car.db relationships .all --non-redundant-entailed

subject predicate object subject_label predicate_label object_label
EXAMPLE:car BFO:0000051 EXAMPLE:wheel car has part wheel
EXAMPLE:convertible BFO:0000051 EXAMPLE:wheel convertible has part wheel
EXAMPLE:convertible rdfs:subClassOf EXAMPLE:car convertible None car
EXAMPLE:wheel BFO:0000051 EXAMPLE:hubcap wheel has part hubcap

runoak -i car.db relationships .all --include-entailed

subject predicate object subject_label predicate_label object_label
EXAMPLE:car BFO:0000051 EXAMPLE:hubcap car has part hubcap
EXAMPLE:car BFO:0000051 EXAMPLE:wheel car has part wheel
EXAMPLE:car rdfs:subClassOf EXAMPLE:car car None car
EXAMPLE:convertible BFO:0000051 EXAMPLE:hubcap convertible has part hubcap
EXAMPLE:convertible BFO:0000051 EXAMPLE:wheel convertible has part wheel
EXAMPLE:convertible rdfs:subClassOf EXAMPLE:car convertible None car
EXAMPLE:convertible rdfs:subClassOf EXAMPLE:convertible convertible None convertible
EXAMPLE:hubcap rdfs:subClassOf EXAMPLE:hubcap hubcap None hubcap
EXAMPLE:wheel BFO:0000051 EXAMPLE:hubcap wheel has part hubcap
EXAMPLE:wheel rdfs:subClassOf EXAMPLE:wheel wheel None wheel

@cmungall
Copy link
Contributor Author

Note: it's OK to close this as out of scope, as robot doesn't have a very graphy view of the universe, but I wanted to capture the discussion where it won't be swallowed by the slack memory vortex

@cmungall
Copy link
Contributor Author

An alternative is the plain reason command with emr as the reasoner:

robot reason --include-indirect true --reasoner emr -i car.owl -o car2.owl

this includes things like 'car has-part hubcap`

@souzadevinicius
Copy link

I want to start a bit with robot development, so I decided to pick this issue.
However, it didn't work, the key is this:

Set<OWLClassExpression> sces = emr.getSuperClassExpressions(c, !includeIndirect);

@cmungall you know how better how emr works. Can you help me with that?

@pfabry
Copy link

pfabry commented Aug 15, 2024

An alternative is the plain reason command with emr as the reasoner:

robot reason --include-indirect true --reasoner emr -i car.owl -o car2.owl

this includes things like 'car has-part hubcap`

Unfortunately, this adds also a lot of "noise" such as 'convertible subClassOf owl:thing'

@balhoff
Copy link
Contributor

balhoff commented Aug 26, 2024

One option would be to use relation-graph and then merge the output using ROBOT:

relation-graph --ontology-file input.owl --mode OWL --output-file relations.nt --property 'http://purl.obolibrary.org/obo/RO_0002162' --output-subclasses false

or leave off the property argument if you want all properties materialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants