Changeset 454


Ignore:
Timestamp:
05/17/11 22:29:59 (2 years ago)
Author:
tadamusiak
Message:

fix for the object properties URIs

Location:
trunk/ontoCAT/src/uk/ac/ebi/ontocat/file
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ontoCAT/src/uk/ac/ebi/ontocat/file/ReasonedFileOntologyService.java

    r450 r454  
    2323import org.semanticweb.owlapi.model.OWLObjectProperty; 
    2424import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; 
    25 import org.semanticweb.owlapi.model.OWLOntology; 
    2625import org.semanticweb.owlapi.reasoner.OWLReasoner; 
    2726import org.semanticweb.owlapi.reasoner.OWLReasonerFactory; 
    28 import org.semanticweb.owlapi.util.OWLEntityURIConverter; 
    2927 
    3028import uk.ac.ebi.ontocat.OntologyService; 
     
    9795        } 
    9896 
    99         // FIXME: Apply the URI conversion strategy to fix 
    100         // the OWL API 3.2.2 object property issue 
    101         // this fixes the uris and merges the duplicated 
    102         // object properties 
     97        // FIXME: fix for OWL API 3.2.2 object property bug 
     98        // which duplicates object properties by introducing 
     99        // incorrect URIs in OBOConsumer 
     100        // this goes through all the properties and removes 
     101        // the ones that are not used anywhere (duplicates) 
    103102        private void fixPropertiesURIs() { 
    104                 Set<OWLOntology> ontologies = new HashSet<OWLOntology>(); 
    105                 ontologies.add(ontology); 
    106                 OWLEntityURIConverter converter = new OWLEntityURIConverter( 
    107                                 loader.getManager(), ontologies, 
    108                                 new FixBrokenObjectPropertiesIRIStrategy()); 
    109                 loader.getManager().applyChanges(converter.getChanges()); 
     103                for (OWLObjectProperty prop : ontology.getObjectPropertiesInSignature()) { 
     104                        if (prop.getReferencingAxioms(ontology).size() == 1) { 
     105                                loader.getManager().removeAxiom( 
     106                                                ontology, 
     107                                                loader.getManager().getOWLDataFactory() 
     108                                                .getOWLDeclarationAxiom(prop)); 
     109                        } 
     110                } 
    110111        } 
    111112 
Note: See TracChangeset for help on using the changeset viewer.