|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.owl.utils.OntologyDatasetUtils
public class OntologyDatasetUtils
Utilities for operating on ontology data within a Dataset. Contains a cache of the classes Hierarchy.
| Constructor Summary | |
|---|---|
OntologyDatasetUtils()
Create a new OntologyDataUtils |
|
| Method Summary | |
|---|---|
java.util.List<_Property> |
findDeclaredProperties(Class clazz)
Get the set of properties whose domain matches the class |
java.util.List<_Property> |
findDeclaredProperties(Class clazz,
java.lang.String label)
Get the set of properties whose domain matches the class and has an rdf:label that matches the provided label |
java.util.Set<Class> |
getAllClasses(IDataset dataset)
Get all classes from a dataset |
java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> |
getAllClasses(IDataset dataset,
org.openrdf.model.Resource clazzUri,
boolean directlyAssertedOnly)
Get all classes from the dataset with the given type |
java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> |
getAllClasses(IDataset dataset,
java.lang.String label,
boolean directlyAssertedOnly)
Get all classes within a dataset whose label matches the provided label |
java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> |
getAllImplementors(IDataset dataset,
Class clazz,
boolean directlyAssertedOnly)
Within an IDataset, retrieve all the individuals of the given class type |
java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> |
getAllImplementors(IDataset dataset,
Class clazz,
java.lang.String label,
boolean directlyAssertedOnly)
Get all things within a dataset that are of a given type and whose label matches the provided label |
java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> |
getAllImplementors(org.openrdf.model.URI namedGraphUri,
IDataset dataset,
java.lang.String label,
boolean directlyAssertedOnly)
Get all things within a dataset whose label matches the provided label |
java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> |
getAllImplementors2(IDataset dataset,
Class clazz,
boolean directlyAssertedOnly)
Within an IDataset, retrieve all the individuals of the given class type. |
java.util.Collection<Individual> |
getAllIndividuals(IDataset dataset,
Class clazz,
boolean directlyAssertedOnly)
Get all individuals that are of a given type |
java.util.Collection<Individual> |
getAllIndividuals(IDataset dataset,
Class clazz,
java.lang.String label,
boolean directlyAssertedOnly)
Get all individuals that are of a given type |
java.util.Collection<Individual> |
getAllIndividuals(IDataset dataset,
org.openrdf.model.URI namedGraphUri,
java.lang.String label,
boolean directlyAssertedOnly)
Get all individuals that are of a given type |
java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> |
getAllThings(IDataset dataset)
Get all things within dataset, where a thing is something other than an ontology definition object. |
java.util.List<Class> |
getDomain(_Property property)
Get the set of Classes that make up the Domain of a property |
java.util.List<Class> |
getRange(_Property property)
Get the set of Classes that make up the Range of a property |
java.util.List<Class> |
getSubClasses(Class clazz,
boolean adjacent,
boolean directlyAssertedOnly)
Get subclasses for a given Class. |
java.util.List<org.openrdf.model.Resource> |
getSubClasses(IDataset dataset,
org.openrdf.model.Resource clazz,
boolean directlyAssertedOnly)
Get subclasses for a given Class |
java.util.List<org.openrdf.model.Resource> |
getSubClasses(IDataset dataset,
org.openrdf.model.URI namedGraphUri,
org.openrdf.model.Resource clazz,
boolean directlyAssertedOnly)
Get subclasses for a given Class |
java.util.List<_Property> |
getSubProperties(_Property property,
boolean directlyAssertedOnly)
Get all sub properties of the given property. |
java.util.List<Class> |
getSuperClasses(Class clazz,
boolean directlyAssertedOnly)
Get superclasses for a given Class |
java.util.List<Class> |
getSuperClasses(Class clazz,
boolean adjacent,
boolean directlyAssertedOnly)
Get superclasses for a given Class. |
void |
registerDatasetListener(IDataset dataset)
Register this OntologyDatasetUtils instance as a listener to a dataset's events. |
void |
registerOntologyChangeListener(IOntologyChangeListener listener)
Register an ontology change listener |
void |
unregisterOntologyChangeListener(IOntologyChangeListener listener)
Unregister an ontology change listener |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OntologyDatasetUtils()
| Method Detail |
|---|
public void registerOntologyChangeListener(IOntologyChangeListener listener)
listener - IOntologyChangeListener listener to registerpublic void unregisterOntologyChangeListener(IOntologyChangeListener listener)
listener - IOntologyChangeListener listener to unregisterpublic void registerDatasetListener(IDataset dataset)
dataset - dataset to which this class will register for events
public java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> getAllImplementors(IDataset dataset,
Class clazz,
boolean directlyAssertedOnly)
dataset - dataset containing dataclazz - class for which whose type must matchdirectlyAssertedOnly - only include individuals that directly assert the class's type
public java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> getAllImplementors2(IDataset dataset,
Class clazz,
boolean directlyAssertedOnly)
dataset - dataset containing dataclazz - class for which whose type must matchdirectlyAssertedOnly - only include individuals that directly assert the class's type
public java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> getAllThings(IDataset dataset)
dataset - dataset containing data
public java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> getAllImplementors(IDataset dataset,
Class clazz,
java.lang.String label,
boolean directlyAssertedOnly)
dataset - dataset containing dataclazz - type of things to look forlabel - only return things that have an RDFS:Label with the given valuedirectlyAssertedOnly - only return things that directly assert the given class type
public java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> getAllImplementors(org.openrdf.model.URI namedGraphUri,
IDataset dataset,
java.lang.String label,
boolean directlyAssertedOnly)
namedGraphUri - URI of namedGraph where thing must residedataset - dataset containing datalabel - only return things that have an RDFS:Label with the given valuedirectlyAssertedOnly - only return things that directly assert the given class type
public java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> getAllClasses(IDataset dataset,
java.lang.String label,
boolean directlyAssertedOnly)
dataset - dataset containing datalabel - only return things that have an RDFS:Label with the given valuedirectlyAssertedOnly - only return things that directly assert the given class type
public java.util.Map<org.openrdf.model.Resource,org.openrdf.model.Resource> getAllClasses(IDataset dataset,
org.openrdf.model.Resource clazzUri,
boolean directlyAssertedOnly)
dataset - dataset containing dataclazzUri - URI of classes to getdirectlyAssertedOnly - only include classes that directly assert that they are of type Class
public java.util.Set<Class> getAllClasses(IDataset dataset)
dataset - dataset containing data
public java.util.List<_Property> getSubProperties(_Property property,
boolean directlyAssertedOnly)
property - property for which to find sub propertiesdirectlyAssertedOnly - only include properties that are directly asserted sub properties
public java.util.Collection<Individual> getAllIndividuals(IDataset dataset,
Class clazz,
boolean directlyAssertedOnly)
dataset - dataset of dataclazz - class for which to find individualsdirectlyAssertedOnly - only include individuals that directly asserted a type
public java.util.Collection<Individual> getAllIndividuals(IDataset dataset,
org.openrdf.model.URI namedGraphUri,
java.lang.String label,
boolean directlyAssertedOnly)
dataset - dataset of datanamedGraphUri - uri of graph where individuals residedirectlyAssertedOnly - only include individuals that directly asserted a typelabel - value of rdf:label that must match
public java.util.Collection<Individual> getAllIndividuals(IDataset dataset,
Class clazz,
java.lang.String label,
boolean directlyAssertedOnly)
dataset - dataset of dataclazz - class for which to find individualslabel - value of rdf:label that must matchdirectlyAssertedOnly - only include individuals that directly asserted a type
public java.util.List<Class> getDomain(_Property property)
property - property of which to find the Domain classes
public java.util.List<_Property> findDeclaredProperties(Class clazz)
throws JastorException
clazz - class for which to find properties
JastorException
public java.util.List<_Property> findDeclaredProperties(Class clazz,
java.lang.String label)
throws JastorException
clazz - class for which to find propertieslabel - value of label to match
JastorExceptionpublic java.util.List<Class> getRange(_Property property)
property - property of which to find the Range classes
public java.util.List<org.openrdf.model.Resource> getSubClasses(IDataset dataset,
org.openrdf.model.Resource clazz,
boolean directlyAssertedOnly)
dataset - dataset containing dataclazz - class of which to find subclassesdirectlyAssertedOnly - only include classes that directly asserted subclasses
public java.util.List<org.openrdf.model.Resource> getSubClasses(IDataset dataset,
org.openrdf.model.URI namedGraphUri,
org.openrdf.model.Resource clazz,
boolean directlyAssertedOnly)
dataset - dataset containing datanamedGraphUri - the URI of the namedgraph where to look first for sub classesclazz - class of which to find subclassesdirectlyAssertedOnly - only include classes that directly asserted subclasses
public java.util.List<Class> getSubClasses(Class clazz,
boolean adjacent,
boolean directlyAssertedOnly)
Example: (A->B denotes A is a superClass of B)
ClassA -> ClassB
ClassB -> ClassC
ClassA -> ClassC
if adjacent is true, subclasses of ClassA would be ClassB, but if false, it would be both ClassB and ClassC
clazz - class of which to find subclassesadjacent - only include classes that are directly adjacent to their parent class. Filter out subclasses that have more
than one path to the parent.directlyAssertedOnly - only include classes that directly asserted subclasses
public java.util.List<Class> getSuperClasses(Class clazz,
boolean directlyAssertedOnly)
clazz - class of which to find superclassesdirectlyAssertedOnly - only include classes that directly asserted superclasses
public java.util.List<Class> getSuperClasses(Class clazz,
boolean adjacent,
boolean directlyAssertedOnly)
Example: (A->B denotes A is a superClass of B)
ClassA -> ClassB
ClassB -> ClassC
ClassA -> ClassC
if adjacent is true, superclasses of ClassC would be ClassB, but if false, it would be both ClassA and ClassB
clazz - class of which to find superclassesadjacent - only include classes that are directly adjacent to their child class. Filter out superclasses that have more
than one path to the child.directlyAssertedOnly - only include classes that directly asserted superclasses
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||