Examples of Ontology


Examples of au.csiro.ontology.Ontology

                }
            }

            log.info("Finished building ontology");

            return new Ontology(rootModuleId, rootModuleVersion, statedAxioms, null);
        }
View Full Code Here

Examples of au.csiro.ontology.Ontology

                }
            }
           
            Statistics.INSTANCE.setTime("rf1 loading", System.currentTimeMillis() - start);
            accessed = true;
            return new Ontology("snomed", vr.getVersionName(), axioms, null);
        }
View Full Code Here

Examples of au.csiro.ontology.Ontology

                id = "incremental";
            }
           
            String version = sdf.format(new Date());
           
            Ontology res = new Ontology(id, version, ont, null);
            Statistics.INSTANCE.setTime("owl loading", System.currentTimeMillis() - start);
            accessed = true;
            return res;
        }
View Full Code Here

Examples of au.csiro.ontology.Ontology

                }
            }

            log.info("Finished building ontology");

            return new Ontology(rootModuleId, rootModuleVersion, statedAxioms, null);
        }
View Full Code Here

Examples of au.csiro.ontology.Ontology

        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

Examples of au.csiro.ontology.Ontology

        reasoner.classify();
       
        // If classification worked properly then Endocarditis should be
        // classified not only as an Inflammation but also as a HeartDisease
        // and a CriticalDisease
        Ontology t = reasoner.getClassifiedOntology();
       
        // We use the same id that was used to create the concept to look for
        // the corresponding node in the taxonomy
        Node endocarditisNode = t.getNode("Endocarditis");
        System.out.println("Node for endocarditis:\n  "+
                endocarditisNode.getEquivalentConcepts());
       
       
        // We can now print the equivalent concepts in the node and the parent
        // nodes
        Set<Node> parentNodes = endocarditisNode.getParents();
        System.out.println("Parents of endocarditis:");
        for(Node parentNode : parentNodes) {
            System.out.println("  "+parentNode.getEquivalentConcepts());
        }
       
        // We can now add more axioms to the ontology and re-run the
        // classification
        Set<Axiom> additionalAxioms = new HashSet<Axiom>();
       
        Concept heartInflammation = f.createNamedConcept("HeartInflammation");
       
        lhs = heartInflammation;
        rhs = inflammation;
        additionalAxioms.add(f.createConceptInclusion(lhs, rhs));
       
        lhs = endocarditis;
        rhs = f.createConjunction(
                heartInflammation,
                f.createExistential(hasLoc, endocardium)
        );
        additionalAxioms.add(f.createConceptInclusion(lhs, rhs));
       
        // Subsequent invocations will trigger an incremental classification
        System.out.println("Running incremental classification:");
        reasoner.loadAxioms(additionalAxioms);
        reasoner.classify();
       
        // Now Endocarditis should be a HeartInflammation instead of an
        // Inflammation
        t = reasoner.getClassifiedOntology();
        endocarditisNode = t.getNode("Endocarditis");
        System.out.println("Node for endocarditis:\n  "+
                endocarditisNode.getEquivalentConcepts());

        parentNodes = endocarditisNode.getParents();
        System.out.println("Parents of endocarditis:");
View Full Code Here

Examples of au.csiro.ontology.Ontology

        // a full (and not very useful) classification will be excuted.
        reasoner.loadAxioms(axioms);
        reasoner.classify();
       
        // The taxonomy contains the inferred hierarchy
        Ontology t = reasoner.getClassifiedOntology();
       
        // We can look for nodes using the concept ids.
        Node newNode = t.getNode("pce_24220");
        System.out.println("Node for HISTORY_CARDIO_Standard_Non_Anginal_" +
            "Chest_Pain_Exertion:\n  "+
                newNode.getEquivalentConcepts());
       
       
View Full Code Here

Examples of au.csiro.ontology.Ontology

        reasoner.loadAxioms(axioms);
        reasoner.classify();
       
        // 5. Retrieve taxonomy
        System.out.println("Retrieving taxonomy");
        Ontology ont = reasoner.getClassifiedOntology();
       
        // 6. Get node for new concept
        Node specialAppendicitisNode = ont.getNodeMap().get(appendicitsUuid);
       
        // 7. Print the new node
        Utils.printTaxonomy(
                specialAppendicitisNode.getParents().iterator().next(),
                ont.getBottomNode(),
                uuidToDescMap
        );
    }
View Full Code Here

Examples of au.csiro.ontology.Ontology

        IReasoner r = new SnorocketReasoner();
        r.loadAxioms(axioms);
        r = r.classify();
       
        // Get only the taxonomy
        Ontology res = r.getClassifiedOntology();
        Utils.printTaxonomy(res.getTopNode(), res.getBottomNode());
    }
View Full Code Here

Examples of au.csiro.ontology.Ontology

       
        OWLImporter oi = new OWLImporter(root);
       
        Iterator<Ontology> it = oi.getOntologyVersions(new NullProgressMonitor());
        while(it.hasNext()) {
            Ontology ont = it.next();
            IReasoner r = new SnorocketReasoner();
            r.loadAxioms(ont);
            r = r.classify();
            Ontology co = r.getClassifiedOntology();
            int numConcepts = co.getNodeMap().keySet().size();
            System.out.println("numConcepts: "+numConcepts);
        }
       
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.