linikujp / owltools

Automatically exported from code.google.com/p/owltools
0 stars 0 forks source link

Shouldn't combinedQuantifiedPropertyPair combine properties over super properties? #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I was wondering whether the method 
OWLGraphWrapperEdges.combinedQuantifiedPropertyPair should combine 
OWLQuantifiedProperty over transitive super properties (so that combineEdgePair 
combines this kind of relations), e.g.: 

transformation_of o develops_from -> develops_from
(currently, those would not be combined)

The code modification could be something along the line: 

...
else if (x.isSomeValuesFrom() &&
y.isSomeValuesFrom() && 
(getSuperPropertyClosureOf(x.getProperty()).contains(y.getProperty()) || 
getSuperPropertyClosureOf(y.getProperty()).contains(x.getProperty()))) {

//also check for transitivity   
...     
}
...

This test could be performed just before the test using the "chain" method, and 
should also check for the transitivity of the common super property (and should 
be optimized :p)

What do you think?

Original issue reported on code.google.com by frederic...@gmail.com on 28 May 2013 at 11:07

GoogleCodeExporter commented 9 years ago
I wrote a method to combine properties over super properties (see attached 
file). 

In case you don't think it is appropriate to modify 
combinedQuantifiedPropertyPair, could I kindly request the following changes to 
keep using my own method?

- could combinedQuantifiedPropertyPair be made public?

- could getSuperPropertyClosureOf return a LinkedHashSet raster than a Set, so 
that super properties are ordered from the more precise one to the more general 
one?

- could getSuperPropertyReflexiveClosureOf return a LinkedHashSet raster than a 
Set, where the source property is the first element, not the last one?

- In getOWLGraphEdgeSubsumers, there is a piece of code useful when creating a 
new OWLQuantifiedProperty. Could you externalize that code in a public method?

if (pe.equals(this.getDataFactory().getOWLTopObjectProperty()))
    continue;
if (pe instanceof OWLObjectProperty) {
    OWLQuantifiedProperty newQp = new OWLQuantifiedProperty(pe, qp.getQuantifier());
    if (!isExcluded(newQp)) {
        superQps.add(newQp);
    }
}

- or alternatively, could you make public the method isExcluded?

Thanks a lot, let me know what you think.

Original comment by frederic...@gmail.com on 29 May 2013 at 2:00

Attachments:

GoogleCodeExporter commented 9 years ago
The class owltools.graph.OWLGraphWrapperEdgesExtended now implements these 
features.

Original comment by frederic...@gmail.com on 20 Nov 2013 at 8:45