org.topbraid.core.composite
Class Composites

java.lang.Object
  extended by org.topbraid.core.composite.Composites

public class Composites
extends java.lang.Object

Static utility methods to operate on the composite ontology.

Author:
Holger Knublauch

Constructor Summary
Composites()
           
 
Method Summary
static int compareChildren(com.hp.hpl.jena.rdf.model.RDFNode n1, com.hp.hpl.jena.rdf.model.RDFNode n2)
           
static int compareIntegers(java.lang.Integer index1, java.lang.Integer index2)
           
static java.lang.Integer getChildIndex(com.hp.hpl.jena.rdf.model.Resource child)
           
static com.hp.hpl.jena.rdf.model.Statement getChildIndexStatement(com.hp.hpl.jena.rdf.model.Resource child)
           
static java.util.List<com.hp.hpl.jena.rdf.model.Resource> getChildren(com.hp.hpl.jena.rdf.model.Resource composite)
           
static java.util.List<com.hp.hpl.jena.rdf.model.Resource> getChildren(com.hp.hpl.jena.rdf.model.Resource composite, com.hp.hpl.jena.rdf.model.Property childProperty)
           
static java.util.List<com.hp.hpl.jena.rdf.model.Resource> getChildren(com.hp.hpl.jena.rdf.model.Resource composite, java.util.Set<com.hp.hpl.jena.rdf.model.Property> childProperties)
           
static com.hp.hpl.jena.rdf.model.Resource getNextChild(com.hp.hpl.jena.rdf.model.Resource parent, com.hp.hpl.jena.rdf.model.Resource child)
          Gets the next child from a list of statements with composite:child and its subproperties.
static com.hp.hpl.jena.rdf.model.Resource getNextChild(com.hp.hpl.jena.rdf.model.Statement childStatement)
          Gets the next child from a list of statements with the property from childStatement.
static com.hp.hpl.jena.rdf.model.Resource getPreviousChild(com.hp.hpl.jena.rdf.model.Resource parent, com.hp.hpl.jena.rdf.model.Resource child)
          Gets the previous child from a list of statements with composite:child and its subproperties.
static com.hp.hpl.jena.rdf.model.Resource getPreviousChild(com.hp.hpl.jena.rdf.model.Statement childStatement)
          Gets the previous child from a list of statements with the property from childStatement.
static boolean isChildProperty(com.hp.hpl.jena.rdf.model.Resource property)
           
static boolean isChildStatement(com.hp.hpl.jena.rdf.model.Statement childStatement)
           
static boolean isCompositeProperty(com.hp.hpl.jena.rdf.model.Resource currentProperty, com.hp.hpl.jena.rdf.model.Resource compositeProperty)
          Checks if the current property is a or subclass of a COMPOSITE property.
static boolean isFirstChild(com.hp.hpl.jena.rdf.model.Statement statement)
           
static boolean isLastChild(com.hp.hpl.jena.rdf.model.Statement statement)
           
static boolean isParentProperty(com.hp.hpl.jena.rdf.model.Resource property)
           
static void sort(java.util.List<com.hp.hpl.jena.rdf.model.Statement> statements)
           
static void sortChildren(java.util.List<com.hp.hpl.jena.rdf.model.Resource> resources)
           
static void sortProperties(java.util.List<com.hp.hpl.jena.rdf.model.Property> properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Composites

public Composites()
Method Detail

compareChildren

public static int compareChildren(com.hp.hpl.jena.rdf.model.RDFNode n1,
                                  com.hp.hpl.jena.rdf.model.RDFNode n2)

compareIntegers

public static int compareIntegers(java.lang.Integer index1,
                                  java.lang.Integer index2)

getChildIndex

public static java.lang.Integer getChildIndex(com.hp.hpl.jena.rdf.model.Resource child)

getChildIndexStatement

public static com.hp.hpl.jena.rdf.model.Statement getChildIndexStatement(com.hp.hpl.jena.rdf.model.Resource child)

getChildren

public static java.util.List<com.hp.hpl.jena.rdf.model.Resource> getChildren(com.hp.hpl.jena.rdf.model.Resource composite)

getChildren

public static java.util.List<com.hp.hpl.jena.rdf.model.Resource> getChildren(com.hp.hpl.jena.rdf.model.Resource composite,
                                                                             com.hp.hpl.jena.rdf.model.Property childProperty)

getChildren

public static java.util.List<com.hp.hpl.jena.rdf.model.Resource> getChildren(com.hp.hpl.jena.rdf.model.Resource composite,
                                                                             java.util.Set<com.hp.hpl.jena.rdf.model.Property> childProperties)

getNextChild

public static com.hp.hpl.jena.rdf.model.Resource getNextChild(com.hp.hpl.jena.rdf.model.Statement childStatement)
Gets the next child from a list of statements with the property from childStatement.

Parameters:
childStatement -
Returns:
next child instance

getNextChild

public static com.hp.hpl.jena.rdf.model.Resource getNextChild(com.hp.hpl.jena.rdf.model.Resource parent,
                                                              com.hp.hpl.jena.rdf.model.Resource child)
Gets the next child from a list of statements with composite:child and its subproperties.

Parameters:
parent -
child -
Returns:
next child instance

getPreviousChild

public static com.hp.hpl.jena.rdf.model.Resource getPreviousChild(com.hp.hpl.jena.rdf.model.Statement childStatement)
Gets the previous child from a list of statements with the property from childStatement.

Parameters:
childStatement -
Returns:
previous child instance

getPreviousChild

public static com.hp.hpl.jena.rdf.model.Resource getPreviousChild(com.hp.hpl.jena.rdf.model.Resource parent,
                                                                  com.hp.hpl.jena.rdf.model.Resource child)
Gets the previous child from a list of statements with composite:child and its subproperties.

Parameters:
parent -
child -
Returns:
previous child instance

isChildProperty

public static boolean isChildProperty(com.hp.hpl.jena.rdf.model.Resource property)

isChildStatement

public static boolean isChildStatement(com.hp.hpl.jena.rdf.model.Statement childStatement)

isCompositeProperty

public static boolean isCompositeProperty(com.hp.hpl.jena.rdf.model.Resource currentProperty,
                                          com.hp.hpl.jena.rdf.model.Resource compositeProperty)
Checks if the current property is a or subclass of a COMPOSITE property.

Parameters:
currentProperty - - the given property
compositeProperty - - has to be a COMPOSITE property
Returns:
true - if it is a composite property

isFirstChild

public static boolean isFirstChild(com.hp.hpl.jena.rdf.model.Statement statement)

isLastChild

public static boolean isLastChild(com.hp.hpl.jena.rdf.model.Statement statement)

isParentProperty

public static boolean isParentProperty(com.hp.hpl.jena.rdf.model.Resource property)

sort

public static void sort(java.util.List<com.hp.hpl.jena.rdf.model.Statement> statements)

sortChildren

public static void sortChildren(java.util.List<com.hp.hpl.jena.rdf.model.Resource> resources)

sortProperties

public static void sortProperties(java.util.List<com.hp.hpl.jena.rdf.model.Property> properties)