Package au.csiro.ontology

Examples of au.csiro.ontology.Ontology


                        "/res1_StatedRelationships_Core_INT_20110731.txt"),
                version);
       
        Iterator<Ontology> it = imp.getOntologyVersions(new NullProgressMonitor());
       
        Ontology ont = null;
        while(it.hasNext()) {
            Ontology o = it.next();
            if(o.getVersion().equals("snomed")) {
                ont = o;
                break;
            }
        }
View Full Code Here


        InputStream relsFile = this.getClass().getResourceAsStream("/"+relsBase);
        RF1Importer imp = new RF1Importer(conceptsFile, relsFile, version);
       
        Iterator<Ontology> it = imp.getOntologyVersions(new NullProgressMonitor());
       
        Ontology ont = null;
        while(it.hasNext()) {
            Ontology o = it.next();
            if(o.getVersion().equals("snomed")) {
                ont = o;
                break;
            }
        }
       
        if(ont == null) {
            System.out.println("Could not find version " + version + " in input files");
        }
        System.out.println("Loading axioms");
        no.loadAxioms(new HashSet<Axiom>(ont.getStatedAxioms()));
        System.out.println("Running classification");
        no.classify();
        System.out.println("Computing taxonomy");
        no.buildTaxonomy();
        System.out.println("Done");

        // If a relationship that is part of a role group is added incrementally
        // on its own then it will not be added to the correct role group
        // because that information is missing. Therefore care must be taken to
        // remove all relationships that belong to a role group when deriving
        // a test case for incremental classification using RF1.

        System.out.println("Running incremental classification");
        imp = new RF1Importer(
                this.getClass().getResourceAsStream("/"+conceptsInc),
                this.getClass().getResourceAsStream("/"+relsInc),
                version);

        long start = System.currentTimeMillis();
        System.out.println("Transforming axioms");
       
        it = imp.getOntologyVersions(new NullProgressMonitor());
       
        ont = null;
        while(it.hasNext()) {
            Ontology o = it.next();
            if(o.getVersion().equals("snomed")) {
                ont = o;
                break;
            }
        }
       
View Full Code Here

       
        Iterator<Ontology> it = null;
        try {
            it = oi.getOntologyVersions(monitor);
            while(it.hasNext()) {
                Ontology o = it.next();
                canAxioms.addAll(o.getStatedAxioms());
            }
            List<String> problems = oi.getProblems();
            if(!problems.isEmpty()) {
                StringBuilder sb = new StringBuilder();
                sb.append("Some warnings were detected while importing the ontology: ");
View Full Code Here

            log.error(sb.toString(), e);
            monitor.taskEnded();
            return null;
        }
        while(it.hasNext()) {
            Ontology o = it.next();
            canAxioms.addAll(o.getStatedAxioms());
        }
       
        return canAxioms;
    }
View Full Code Here

        log.info("Building taxonomy");
        no.buildTaxonomy();
        Map<String, Node> taxonomy = no.getTaxonomy();
        Set<Node> affectedNodes = no.getAffectedNodes();

        return new Ontology(null, null, null, taxonomy, affectedNodes);
    }
View Full Code Here

TOP

Related Classes of au.csiro.ontology.Ontology

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.