org.daml.validator.model
Class DAMLModelImpl.Node

java.lang.Object
  |
  +--org.daml.validator.model.DAMLModelImpl.Node
Enclosing class:
DAMLModelImpl

public class DAMLModelImpl.Node
extends java.lang.Object

A Node exists for a RDF-API Resource and contains all incoming and outgoing predicates as well as any equivalent Nodes.


Field Summary
 com.hp.hpl.mesa.rdf.jena.model.Model incoming
          All Statements where this node is the object.
 com.hp.hpl.mesa.rdf.jena.model.Model outgoing
          All Statements where this node is the subject.
 com.hp.hpl.mesa.rdf.jena.model.Resource resource
          Resource from RDF-API model.
 
Method Summary
 boolean equals(DAMLModelImpl.Node node)
          Returns true if the nodes are equal (refer to the same URI?).
 boolean equals(com.hp.hpl.mesa.rdf.jena.model.RDFNode rdfnode)
           
 boolean equals(com.hp.hpl.mesa.rdf.jena.model.Resource resource)
           
 boolean equivalentTo(DAMLModelImpl.Node node)
          Returns true if the nodes are equal or declared equivalent.
protected  void findAllInternal(java.lang.String path, java.util.Vector retval)
          Returns all statements that match the given query.
 java.util.Set getAncestors(boolean useEquivalence)
          Returns a set of ancestors for the current Node.
 DAMLModelImpl.Node getDatatypeInstanceType()
          Returns the first type Node of the instance that is a datatype.
 java.util.Vector getDomain()
           
 java.util.Collection getDomainStatements()
           
 java.util.Collection getEquivalentToStatements()
           
 com.hp.hpl.mesa.rdf.jena.model.Model getImpliedStatements(com.hp.hpl.mesa.rdf.jena.model.Model model)
          Returns a model of the implied statements for this node.
 java.util.Vector getOutgoingStatements(java.util.Collection predicateResources, boolean useInheritance, boolean useEquivalence)
          Determine outgoing statements for the Node.
 java.util.Vector getOutgoingStatements(DAMLModelImpl.Node predicateNode, boolean useInheritance, boolean useEquivalence)
           
 java.util.Vector getOutgoingStatements(com.hp.hpl.mesa.rdf.jena.model.Resource predicateResource, boolean useInheritance, boolean useEquivalence)
           
 DAMLModelImpl.Node getProperty()
          Returns the property that a restriction is on.
 java.util.Vector getRange()
          Returns a vector of ClassNodes for the Range of this PropertyNode (predicate)
 java.util.Collection getRangeStatements()
           
 java.util.Set getRestrictions(boolean useEquivalence)
          Returns a set of restriction nodes for the class Node.
 java.util.Collection getSamePropertyAsStatements()
           
 java.util.Collection getSubPropertyOfStatements()
           
 DAMLModelImpl.Node getType()
          Returns the type of a Node if one exists.
 java.util.Set getTypes()
          Returns a vector of Nodes that are the type classes of this Node.
 com.hp.hpl.mesa.rdf.jena.model.Statement getTypeStatement()
           
 java.util.Set getTypeStatements()
          Returns a set of statements that assert the type classes of this Node.
 java.util.Set getValues()
          Returns a set of RDFNodes from the resource via the rdf:value predicate.
 java.util.Collection getValueStatements()
           
 com.hp.hpl.mesa.rdf.jena.model.Model implies(DAMLModelImpl.Node node, com.hp.hpl.mesa.rdf.jena.model.Model model)
           
 boolean isClassNode()
          Returns true if the Node is a class node.
 boolean isDatatypeInstance()
          Returns true if the node has a type that is a Datatype.
 boolean isDatatypeNode()
          Returns true if this Node is a XML Schema Simple Datatype.
 boolean isInstanceOf(DAMLModelImpl.Node superclass)
          Returns true if this Node is an instance of the class
 boolean isInstanceOfResources(java.util.Collection superclasses)
          Returns true of this Node is an instance of one of the superclasses.
 boolean isType(java.util.Collection typeCollection)
           
 void printInfo()
          Prints out information about this node.
 boolean subClassOf(java.util.Collection superclass)
          Returns true if the node is a subclass of the given collection of Resources.
 boolean subClassOf(DAMLModelImpl.Node superclass)
          Returns true if the node is a subclass of the given node.
 boolean subClassOf(com.hp.hpl.mesa.rdf.jena.model.Resource superclass)
          Returns true if the node is a subclass of the given Resource.
 java.lang.String toString()
          Returns the string representation of the contained Resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

resource

public com.hp.hpl.mesa.rdf.jena.model.Resource resource
Resource from RDF-API model.


incoming

public com.hp.hpl.mesa.rdf.jena.model.Model incoming
All Statements where this node is the object.


outgoing

public com.hp.hpl.mesa.rdf.jena.model.Model outgoing
All Statements where this node is the subject.

Method Detail

findAllInternal

protected void findAllInternal(java.lang.String path,
                               java.util.Vector retval)
                        throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Returns all statements that match the given query.

com.hp.hpl.mesa.rdf.jena.model.RDFException

toString

public java.lang.String toString()
Returns the string representation of the contained Resource.

Overrides:
toString in class java.lang.Object

printInfo

public void printInfo()
Prints out information about this node.


equals

public boolean equals(DAMLModelImpl.Node node)
Returns true if the nodes are equal (refer to the same URI?).


equals

public boolean equals(com.hp.hpl.mesa.rdf.jena.model.Resource resource)

equals

public boolean equals(com.hp.hpl.mesa.rdf.jena.model.RDFNode rdfnode)

equivalentTo

public boolean equivalentTo(DAMLModelImpl.Node node)
Returns true if the nodes are equal or declared equivalent. Assumes that all equivalent nodes are in the equivalence list.


getType

public DAMLModelImpl.Node getType()
Returns the type of a Node if one exists.


getTypes

public java.util.Set getTypes()
Returns a vector of Nodes that are the type classes of this Node.


getTypeStatements

public java.util.Set getTypeStatements()
Returns a set of statements that assert the type classes of this Node.


subClassOf

public boolean subClassOf(DAMLModelImpl.Node superclass)
Returns true if the node is a subclass of the given node. Takes into account equivalence between nodes.


subClassOf

public boolean subClassOf(com.hp.hpl.mesa.rdf.jena.model.Resource superclass)
Returns true if the node is a subclass of the given Resource. Takes into account equivalence between nodes.


subClassOf

public boolean subClassOf(java.util.Collection superclass)
Returns true if the node is a subclass of the given collection of Resources. Takes into account equivalence between nodes.


getRestrictions

public java.util.Set getRestrictions(boolean useEquivalence)
                              throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Returns a set of restriction nodes for the class Node.

com.hp.hpl.mesa.rdf.jena.model.RDFException

getAncestors

public java.util.Set getAncestors(boolean useEquivalence)
                           throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Returns a set of ancestors for the current Node.

com.hp.hpl.mesa.rdf.jena.model.RDFException

getProperty

public DAMLModelImpl.Node getProperty()
                               throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Returns the property that a restriction is on.

com.hp.hpl.mesa.rdf.jena.model.RDFException

getDomainStatements

public java.util.Collection getDomainStatements()
                                         throws com.hp.hpl.mesa.rdf.jena.model.RDFException
com.hp.hpl.mesa.rdf.jena.model.RDFException

getDomain

public java.util.Vector getDomain()
                           throws com.hp.hpl.mesa.rdf.jena.model.RDFException
com.hp.hpl.mesa.rdf.jena.model.RDFException

getRange

public java.util.Vector getRange()
                          throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Returns a vector of ClassNodes for the Range of this PropertyNode (predicate)

com.hp.hpl.mesa.rdf.jena.model.RDFException

isClassNode

public boolean isClassNode()
Returns true if the Node is a class node.


isDatatypeNode

public boolean isDatatypeNode()
                       throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Returns true if this Node is a XML Schema Simple Datatype.

com.hp.hpl.mesa.rdf.jena.model.RDFException

isInstanceOfResources

public boolean isInstanceOfResources(java.util.Collection superclasses)
Returns true of this Node is an instance of one of the superclasses.

Parameters:
superclasses - a Vector of Resources

isInstanceOf

public boolean isInstanceOf(DAMLModelImpl.Node superclass)
Returns true if this Node is an instance of the class


getTypeStatement

public com.hp.hpl.mesa.rdf.jena.model.Statement getTypeStatement()

isDatatypeInstance

public boolean isDatatypeInstance()
                           throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Returns true if the node has a type that is a Datatype. For detecting typed literals.

com.hp.hpl.mesa.rdf.jena.model.RDFException

getDatatypeInstanceType

public DAMLModelImpl.Node getDatatypeInstanceType()
                                           throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Returns the first type Node of the instance that is a datatype.

com.hp.hpl.mesa.rdf.jena.model.RDFException

getValues

public java.util.Set getValues()
Returns a set of RDFNodes from the resource via the rdf:value predicate.


getValueStatements

public java.util.Collection getValueStatements()

getSubPropertyOfStatements

public java.util.Collection getSubPropertyOfStatements()

getRangeStatements

public java.util.Collection getRangeStatements()

getSamePropertyAsStatements

public java.util.Collection getSamePropertyAsStatements()

getEquivalentToStatements

public java.util.Collection getEquivalentToStatements()

isType

public boolean isType(java.util.Collection typeCollection)
               throws com.hp.hpl.mesa.rdf.jena.model.RDFException
com.hp.hpl.mesa.rdf.jena.model.RDFException

getOutgoingStatements

public java.util.Vector getOutgoingStatements(java.util.Collection predicateResources,
                                              boolean useInheritance,
                                              boolean useEquivalence)
Determine outgoing statements for the Node. Use of inheritance and equivalence can be turned on or off.


getOutgoingStatements

public java.util.Vector getOutgoingStatements(com.hp.hpl.mesa.rdf.jena.model.Resource predicateResource,
                                              boolean useInheritance,
                                              boolean useEquivalence)

getOutgoingStatements

public java.util.Vector getOutgoingStatements(DAMLModelImpl.Node predicateNode,
                                              boolean useInheritance,
                                              boolean useEquivalence)

getImpliedStatements

public com.hp.hpl.mesa.rdf.jena.model.Model getImpliedStatements(com.hp.hpl.mesa.rdf.jena.model.Model model)
                                                          throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Returns a model of the implied statements for this node.

Parameters:
model - - the model to add the statements to
Returns:
the model
com.hp.hpl.mesa.rdf.jena.model.RDFException

implies

public com.hp.hpl.mesa.rdf.jena.model.Model implies(DAMLModelImpl.Node node,
                                                    com.hp.hpl.mesa.rdf.jena.model.Model model)
                                             throws com.hp.hpl.mesa.rdf.jena.model.RDFException
com.hp.hpl.mesa.rdf.jena.model.RDFException