nl.tudelft.tbm.eeni.owlstructure.utils
Class OntologyUtils

java.lang.Object
  extended by nl.tudelft.tbm.eeni.owlstructure.utils.OntologyUtils

public final class OntologyUtils
extends Object


Constructor Summary
OntologyUtils()
           
 
Method Summary
static void closeIterator(Iterator<?> iterator)
          Closes an iterator if it has interface ClosableIterator.
static boolean containsClassSuperset(com.hp.hpl.jena.ontology.OntClass ontClass, Collection<com.hp.hpl.jena.ontology.OntClass> candidates)
          Check whether a list of candidate classes contains a partial superset of a given class In inheritance chains where each class extends at most one other class, this basically checks whether there is an (indirect) ancestor of the class in the candidates list.
static boolean containsCompleteClassSuperset(com.hp.hpl.jena.ontology.OntClass ontClass, Collection<com.hp.hpl.jena.ontology.OntClass> candidates)
          Check whether a list of candidate classes contains a defining superset of a given class In inheritance chains where each class extends at most one other class, this basically checks whether there is an (indirect) ancestor of the class in the candidates list.
static com.hp.hpl.jena.ontology.OntModel createOntology()
           
static com.hp.hpl.jena.ontology.OntClass getOwlThing(com.hp.hpl.jena.ontology.OntModel ontModel)
          Returns the OntClass instance of owl:Thing
static String getSparqlPrefixes(com.hp.hpl.jena.ontology.OntModel ontModel)
          This convenience function fetches all namespaces that are currently part of the ontology model and known to Jena and dumps them as a sparql prefix list
static Collection<com.hp.hpl.jena.ontology.OntClass> listClassAncestors(com.hp.hpl.jena.ontology.OntClass ontClass)
          List all (indirect) parents of an ontology class That is, list its parent, its parent's parent, etc.
static Collection<com.hp.hpl.jena.ontology.OntClass> listClassDescendants(com.hp.hpl.jena.ontology.OntClass ontClass)
          List all (indirect) descendants of an ontology class That is, list its children, its children's children, etc.
static com.hp.hpl.jena.ontology.OntModel loadOntology(String path)
           
static void saveOntologyRdf(com.hp.hpl.jena.ontology.OntModel ontModel, String path)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntologyUtils

public OntologyUtils()
Method Detail

closeIterator

public static void closeIterator(Iterator<?> iterator)
Closes an iterator if it has interface ClosableIterator. This is useful to avoid open iterator warnings when we're not interested in all results of a sparql query.


containsClassSuperset

public static boolean containsClassSuperset(com.hp.hpl.jena.ontology.OntClass ontClass,
                                            Collection<com.hp.hpl.jena.ontology.OntClass> candidates)
Check whether a list of candidate classes contains a partial superset of a given class In inheritance chains where each class extends at most one other class, this basically checks whether there is an (indirect) ancestor of the class in the candidates list. When multiple inheritance is allowed, this is recursively checked for any of the inheritance branches. Also returns false if a class has no superclass at all.


containsCompleteClassSuperset

public static boolean containsCompleteClassSuperset(com.hp.hpl.jena.ontology.OntClass ontClass,
                                                    Collection<com.hp.hpl.jena.ontology.OntClass> candidates)
Check whether a list of candidate classes contains a defining superset of a given class In inheritance chains where each class extends at most one other class, this basically checks whether there is an (indirect) ancestor of the class in the candidates list. When multiple inheritance is allowed, this is recursively checked for all inheritance branches. Also returns false if a class has no superclass at all.


getSparqlPrefixes

public static String getSparqlPrefixes(com.hp.hpl.jena.ontology.OntModel ontModel)
This convenience function fetches all namespaces that are currently part of the ontology model and known to Jena and dumps them as a sparql prefix list


getOwlThing

public static com.hp.hpl.jena.ontology.OntClass getOwlThing(com.hp.hpl.jena.ontology.OntModel ontModel)
Returns the OntClass instance of owl:Thing


listClassAncestors

public static Collection<com.hp.hpl.jena.ontology.OntClass> listClassAncestors(com.hp.hpl.jena.ontology.OntClass ontClass)
List all (indirect) parents of an ontology class That is, list its parent, its parent's parent, etc.


listClassDescendants

public static Collection<com.hp.hpl.jena.ontology.OntClass> listClassDescendants(com.hp.hpl.jena.ontology.OntClass ontClass)
List all (indirect) descendants of an ontology class That is, list its children, its children's children, etc.


createOntology

public static com.hp.hpl.jena.ontology.OntModel createOntology()

loadOntology

public static com.hp.hpl.jena.ontology.OntModel loadOntology(String path)

saveOntologyRdf

public static void saveOntologyRdf(com.hp.hpl.jena.ontology.OntModel ontModel,
                                   String path)


Copyright © 2011. All Rights Reserved.