org.openanzo.owl.utils
Class OntologyUtils

java.lang.Object
  extended by org.openanzo.owl.utils.OntologyUtils

public class OntologyUtils
extends java.lang.Object

Utilities for operating on ontology data within a INamedGraph

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
OntologyUtils()
           
 
Method Summary
static java.util.List<_Property> findDeclaredProperties(Class clazz)
          Get the set of properties whose domain matches the class
static java.util.Collection<org.openrdf.model.Resource> getAllClasses(INamedGraph graph, boolean directlyAssertedOnly)
          Get the set of all defined Classes within the INamedGraph
static java.util.Collection<org.openrdf.model.Resource> getAllImplementors(INamedGraph graph, Class clazz, boolean directlyAssertedOnly)
          Within an INamedGraph, retrieve all the individuals of the given class type
static java.util.Collection<Individual> getAllIndividuals(INamedGraph graph, Class clazz)
          Get all individuals for the given class type.
static java.util.List<Class> getDomain(_Property property)
          Get the set of Classes that make up the Domain of a property
static java.util.List<Class> getRange(_Property property)
          Get the set of Classes that make up the Range of a property
static java.util.List<Class> getSubClasses(Class clazz, boolean directlyAssertedOnly)
          Get subclasses for a given Class
static java.util.List<org.openrdf.model.Resource> getSubClasses(INamedGraph graph, org.openrdf.model.Resource clazz, boolean directlyAssertedOnly)
          Get subclasses for a given Class
static java.util.List<_Property> getSubProperties(_Property property, boolean directlyAssertedOnly)
          Get set of sub properties for the property
static java.util.List<Class> getSuperClasses(Class clazz, boolean directlyAssertedOnly)
          Get super classes for a given Class
static java.util.List<_Property> getSuperProperties(_Property property, boolean directlyAssertedOnly)
          Get set of super properties for the property
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntologyUtils

public OntologyUtils()
Method Detail

getAllImplementors

public static java.util.Collection<org.openrdf.model.Resource> getAllImplementors(INamedGraph graph,
                                                                                  Class clazz,
                                                                                  boolean directlyAssertedOnly)
Within an INamedGraph, retrieve all the individuals of the given class type

Parameters:
graph - graph containing data
clazz - class for which whose type must match
directlyAssertedOnly - only include individuals that directly assert the classes type
Returns:
set of Resources for the individuals that match

getAllClasses

public static java.util.Collection<org.openrdf.model.Resource> getAllClasses(INamedGraph graph,
                                                                             boolean directlyAssertedOnly)
Get the set of all defined Classes within the INamedGraph

Parameters:
graph - graph containing data
directlyAssertedOnly - only include classes that directly assert RDFS.CLASS type or OWL.CLASS type
Returns:
the set of Resources for all defined Classes within the INamedGraph

getSubClasses

public static java.util.List<org.openrdf.model.Resource> getSubClasses(INamedGraph graph,
                                                                       org.openrdf.model.Resource clazz,
                                                                       boolean directlyAssertedOnly)
Get subclasses for a given Class

Parameters:
graph - graph containing data
clazz - type of class of which to find subclasses
directlyAssertedOnly - only include classes that are directlyAssertedOnly subclasses
Returns:
set of Resources for subclasses for a given Class

getSubClasses

public static java.util.List<Class> getSubClasses(Class clazz,
                                                  boolean directlyAssertedOnly)
Get subclasses for a given Class

Parameters:
clazz - class of which to find subclasses
directlyAssertedOnly - only include classes that directly asserted subclasses
Returns:
set of subclasses for the Class

getSuperClasses

public static java.util.List<Class> getSuperClasses(Class clazz,
                                                    boolean directlyAssertedOnly)
Get super classes for a given Class

Parameters:
clazz - class of which to find super classes
directlyAssertedOnly - only include classes that directly asserted super classes
Returns:
set of super classes for the Class

getSubProperties

public static java.util.List<_Property> getSubProperties(_Property property,
                                                         boolean directlyAssertedOnly)
Get set of sub properties for the property

Parameters:
property - property of which to find sub properties
directlyAssertedOnly - only include directly asserted sub properties
Returns:
set of sub properties for the property

getSuperProperties

public static java.util.List<_Property> getSuperProperties(_Property property,
                                                           boolean directlyAssertedOnly)
Get set of super properties for the property

Parameters:
property - property of which to find super properties
directlyAssertedOnly - only include directly asserted super properties
Returns:
set of super properties for the property

getAllIndividuals

public static java.util.Collection<Individual> getAllIndividuals(INamedGraph graph,
                                                                 Class clazz)
Get all individuals for the given class type. Includes non direct implementors of the class type.

Parameters:
graph - graph containing data
clazz - class of which to find individuals
Returns:
set of Individuals of a given class type

getRange

public static java.util.List<Class> getRange(_Property property)
Get the set of Classes that make up the Range of a property

Parameters:
property - property of which to find the Range classes
Returns:
set of Classes that make up the Range of a property

getDomain

public static java.util.List<Class> getDomain(_Property property)
Get the set of Classes that make up the Domain of a property

Parameters:
property - property of which to find the Domain classes
Returns:
set of Classes that make up the Domain of a property

findDeclaredProperties

public static java.util.List<_Property> findDeclaredProperties(Class clazz)
                                                        throws JastorException
Get the set of properties whose domain matches the class

Parameters:
clazz - class for which to find properties
Returns:
the set of properties whose domain matches the class
Throws:
JastorException


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.