#71 Lack of support in OWLOntologyManager for version IRIs

closed
nobody
None
5
2012-11-17
2012-09-12
No

OWLOntologyManager does not currently support an easy method for querying the version IRIs, as it focuses on either the ontology IRI or the document IRI, which may not be the same as the version IRI depending on the method that was used to load the ontology.

In order to fit a pattern where one directly imports ontologies based on the version IRI, I extended the OWLOntologyManager interface with two new methods, along with the corresponding implementations for OWLOntologyManagerImpl

@Override
public boolean containsVersion(IRI ontologyVersionIRI) {
for (OWLOntologyID ont : ontologiesByID.keySet()) {
if(ontologyVersionIRI.equals(ont.getVersionIRI())) {
return true;
}
}
return false;
}

@Override
public Set<OWLOntologyID> getOntologyIDsByVersion(IRI ontologyVersionIRI) {
Set<OWLOntologyID> result = new TreeSet<OWLOntologyID>();

for (OWLOntologyID ont : ontologiesByID.keySet()) {
if(ontologyVersionIRI.equals(ont.getVersionIRI())) {
result.add(ont);
}
}
return result;
}

Discussion

  • Peter Ansell

    Peter Ansell - 2012-09-12

    Attaching a patch that works for me, it is currently based on top of a large number of other patches, including the patch for 3536150

    Let me know when you get around to applying the patch and I can rebase it or otherwise clean it up.

     
  • Ignazio Palmisano

    This is likely useful but it's an interface change. What if it was another unrelated interface implemented by the impl class, or an extension to OWLOntologyManager? I'm trying to think how to do it without breaking existing implementations of OWLOntologyManager.

     
  • Peter Ansell

    Peter Ansell - 2012-09-17

    Adding the methods to another interface would require casting whenever the user wanted to use versions instead of the other OWLOntologyManager methods.

    As I mentioned, the additional methods were only used for debugging, the most important part of the patch was to fix the internal use of the HashSet.get(new OWLOntologyID(IRI)) pattern that would never, by design, be compatible with versioned ontologies.

    If you want to incorporate the internal changes initially and then incorporate the additional methods when you next plan for an interface breakage/extension point then it would be fine with me. Another temporary method may be to patch the methods directly into OWLOntologyManagerImpl without exposing them on the interface initially.

     
  • Ignazio Palmisano

    I'll try to add this for the 3.5 release.

     
  • Ignazio Palmisano

    These methods are implemented, but the interface changes are commented out until we decide to make more radical changes.

     
  • Ignazio Palmisano

    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks