com.bbn.swede.core.dom
Class GenericPredicate

java.lang.Object
  extended bycom.bbn.swede.core.dom.OASTNode
      extended bycom.bbn.swede.core.dom.TagNode
          extended bycom.bbn.swede.core.dom.PropertyNode
              extended bycom.bbn.swede.core.dom.GenericPredicate

public class GenericPredicate
extends PropertyNode

Property node implementation for general non-language predicates. Tags that are not recognized as an element from the rdf, rdfs, or owl namespace are treated as either generic predicates or generic things based on their context. That is, if a generic tag's parent is a class node, the generic is treated as a predicate; if the generic's parent is a property node, the generic is treated as a thing.

Author:
jlerner
See Also:
ClassNode, PropertyNode, GenericThing

Nested Class Summary
 
Nested classes inherited from class com.bbn.swede.core.dom.OASTNode
OASTNode.NodeCleanupVisitor, OASTNode.NodeInitVisitor
 
Field Summary
protected  String _sQName
          The qualified name of the generic predicate.
 
Fields inherited from class com.bbn.swede.core.dom.PropertyNode
_reified, _stmtAssoc
 
Fields inherited from class com.bbn.swede.core.dom.OASTNode
_iLength, _iOffset, _nodeParent, _tree, AS_OWL, AS_RDF, AS_RDFS, BASE, COMMENT, DOCTYPE, DOCUMENT, GENERICATTRIBUTE, GENERICPREDICATE, GENERICTHING, LITERAL, NAMESPACE, OWL, OWL_ALLDIFFERENT, OWL_ALLVALUESFROM, OWL_ANNOTATIONPROPERTY, OWL_BACKWARDCOMPATIBLEWITH, OWL_CARDINALITY, OWL_CLASS, OWL_COMPLEMENTOF, OWL_DATARANGE, OWL_DATATYPEPROPERTY, OWL_DEPRECATEDCLASS, OWL_DEPRECATEDPROPERTY, OWL_DIFFERENTFROM, OWL_DISJOINTWITH, OWL_DISTINCTMEMBERS, OWL_EQUIVALENTCLASS, OWL_EQUIVALENTPROPERTY, OWL_FUNCTIONALPROPERTY, OWL_HASVALUE, OWL_IMPORTS, OWL_INCOMPATIBLEWITH, OWL_INTERSECTIONOF, OWL_INVERSEFUNCTIONALPROPERTY, OWL_INVERSEOF, OWL_MAXCARDINALITY, OWL_MINCARDINALITY, OWL_NOTHING, OWL_OBJECTPROPERTY, OWL_ONEOF, OWL_ONPROPERTY, OWL_ONTOLOGY, OWL_ONTOLOGYPROPERTY, OWL_PRIORVERSION, OWL_RESTRICTION, OWL_SAMEAS, OWL_SOMEVALUESFROM, OWL_SYMMETRICPROPERTY, OWL_THING, OWL_TRANSITIVEPROPERTY, OWL_UNIONOF, OWL_VERSIONINFO, PROCESSING_INSTRUCTION, RDF, RDF_ABOUT, RDF_ALT, RDF_BAG, RDF_DATATYPE, RDF_DESCRIPTION, RDF_FIRST, RDF_ID, RDF_LIST, RDF_NODEID, RDF_OBJECT, RDF_PARSETYPE, RDF_PREDICATE, RDF_PROPERTY, RDF_RDF, RDF_RESOURCE, RDF_REST, RDF_SEQ, RDF_STATEMENT, RDF_SUBJECT, RDF_TYPE, RDF_VALUE, RDF_XMLLITERAL, RDFS, RDFS_CLASS, RDFS_COMMENT, RDFS_CONTAINER, RDFS_CONTAINERMEMBERSHIPPROPERTY, RDFS_DATATYPE, RDFS_DOMAIN, RDFS_ISDEFINEDBY, RDFS_LABEL, RDFS_LITERAL, RDFS_MEMBER, RDFS_RANGE, RDFS_RESOURCE, RDFS_SEEALSO, RDFS_SUBCLASSOF, RDFS_SUBPROPERTYOF, S_OWL_URI, S_RDF_URI, S_RDFS_URI, S_XSD_URI, UNPARSEABLE, XML_VERSION
 
Constructor Summary
GenericPredicate(String sQName)
          Creates a GenericPredicate node as a singleton tag.
GenericPredicate(String sQName, boolean bSingleton)
          Creates a GenericPredicate node as either a singleton or with descrete begin and end tags.
 
Method Summary
protected  int[] allowedChildren()
          Returns an array of node types indicating what is allowed as a child of the node.
 String getName()
          Returns the node's local name.
 String getNamespace()
          Returns the namespace abbreviation for the node.
 int getNodeType()
          Returns an integer indicating a node's type.
 String getQName()
          Retrieves the qualified name of the generic predicate.
 String getUri()
          Returns the full URI of the node.
 void setQName(String sQName)
          Sets the qualified name of the generic predicate.
 
Methods inherited from class com.bbn.swede.core.dom.PropertyNode
createJenaStatement, getAssociatedStatement, getObject, getReification, removeJenaStatement, setAssociatedStatement, setObjectLiteral, setObjectResource, setObjectTag, setReification
 
Methods inherited from class com.bbn.swede.core.dom.TagNode
addAttribute, appendChildAttribute, appendChildTag, clone, create, create, createRegions, createSingletonRegion, displace, duplicateType, generateNodeText, getAttribute, getAttributes, initRegions, isSingleton, prependChildAttribute, prependChildTag, removeAttribute, removeAttribute, setAttribute, setBeginRegion, setEndRegion, simplePartitioning, splitSingleton
 
Methods inherited from class com.bbn.swede.core.dom.OASTNode
accept, appendChild, attach, cleanup, createChild, createChildAttribute, detach, displace, endsBefore, findCommonAncestor, findXmlBase, getChildren, getContainingChild, getDefaultNamespace, getFirstChild, getLastAttribute, getLength, getLevel, getLockObject, getNamespaces, getNextChild, getNodesOfType, getNodesOfType, getOffset, getOWLAbstractSyntaxTree, getOWLDocument, getParent, getPreviousChild, getQName, getRoot, getXmlBase, init, insert, match, remove, replace, setLength, setOffset, startsAfter, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_sQName

protected String _sQName
The qualified name of the generic predicate.

Constructor Detail

GenericPredicate

public GenericPredicate(String sQName)
Creates a GenericPredicate node as a singleton tag.

Parameters:
sQName - The qualified name of the generic predicate tag.

GenericPredicate

public GenericPredicate(String sQName,
                        boolean bSingleton)
Creates a GenericPredicate node as either a singleton or with descrete begin and end tags.

Parameters:
sQName - The qualified name of the node's tag.
bSingleton - true to create a singleton tag, false to create discrete begin and end tags.
Method Detail

allowedChildren

protected int[] allowedChildren()
Description copied from class: OASTNode
Returns an array of node types indicating what is allowed as a child of the node. Node types are defined as public static fields in OASTNode. This method is not currently used, but will eventually become important for real-time syntax checking.

Specified by:
allowedChildren in class OASTNode
Returns:
An array of allowed node types.

getNodeType

public int getNodeType()
Description copied from class: OASTNode
Returns an integer indicating a node's type. Subclasses must override this method to return one of the node types defined as public static fields in OASTNode. There is a distinct node type for each langauge element as well as several additional types for generics and XML constructs.

Specified by:
getNodeType in class OASTNode
Returns:
The type of this node

getUri

public String getUri()
Description copied from class: OASTNode
Returns the full URI of the node. This implementation returns URIs only for language nodes, and null for everything else. Subclasses that represent non-language tags and attributes should override this method to return a non-null URI.

Overrides:
getUri in class OASTNode
Returns:
The node's URI, or null if it is not a language node.

getNamespace

public String getNamespace()
Description copied from class: OASTNode
Returns the namespace abbreviation for the node. This implementation returns one of "owl", "rdfs", or "rdf" for language nodes or null for anything else. Subclasses that represent non-language tags or attributes should override this method to return a non-null namespace.

Overrides:
getNamespace in class OASTNode
Returns:
The namespace abbreviation for the node, or null if it is not a language node

setQName

public void setQName(String sQName)
Sets the qualified name of the generic predicate.

Parameters:
sQName - The new QName.

getQName

public String getQName()
Retrieves the qualified name of the generic predicate.

Overrides:
getQName in class OASTNode
Returns:
The node's QName.

getName

public String getName()
Description copied from class: OASTNode
Returns the node's local name. This implementation returns local names for language nodes, and null for everything else. Subclasses that represent non-language tags and attributes should override this method to return a non-null local name.

Overrides:
getName in class OASTNode
Returns:
The local name of the node, or null if it is not a language node


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.