story.dbcore.links
Class LinkProperties

java.lang.Object
  extended by story.dbcore.links.LinkProperties

public class LinkProperties
extends java.lang.Object

A reference for other classes to determine the semantic rules associated with links.

An instance of this class is created in the DB-CORE with an application-level LinkPropertiesInterface class, because the rules are application-specific. That is, each application gets to define its own types of links, and its own rules for using those link types, so each application should create a LinkProperties class implementing LinkPropertiesInterface.


Constructor Summary
LinkProperties(LinkPropertiesInterface LPI)
           
 
Method Summary
 boolean canHaveCircularLinks(LinkType lt)
          Does a certain link type allow a node to link indirectly to itself (i.e., passing through one or more nodes in a circuit)?
 boolean canHaveMultipleLabels(LinkType lt)
          Does a certain link type allow two nodes to be linked several times with different labels?
 boolean canHaveReflexiveLinks(LinkType lt)
          Does a certain link type allow a node to link directly to itself?
 boolean cannotRemoveIfLinkedTo(LinkType lt)
          Is it critically bad to remove a node if it is linked to by another node for a certain link type?
 boolean cannotRemoveIfLinks(LinkType lt)
          Is it critically bad to remove a node if it links to another node for a certain link type?
 boolean inferFromSideNodesInheritLinksFromSubtypes(LinkType lt)
          When querying a node for nodes it links to, are the nodes linked from the given node's subnodes also results?
 boolean inferFromSideNodesInheritLinksFromSupertypes(LinkType lt)
          When querying a node for nodes it links to, are the nodes linked from the given node's super-nodes also results?
 boolean inferSupertypesOfFromSideNodesAreLinked(LinkType lt)
           
 boolean inferSupertypesOfToSideNodesAreLinked(LinkType lt)
          When querying a node for its linked nodes, are the supertypes of the result nodes also result nodes?
 boolean inferToSideNodesInheritLinksToSubtypes(LinkType lt)
          When querying a node for nodes that link to it, are the nodes linked to the the given node's subnodes also results?
 boolean inferToSideNodesInheritLinksToSupertypes(LinkType lt)
          When querying a node for nodes that link to it, are the nodes linked to the the given node's super-nodes also results?
 boolean isValidLeftType(NodeType nt, LinkType lt)
          Can some node type appear to the left of some link type?
 boolean isValidRightType(NodeType nt, LinkType lt)
          Can some node type appear to the left of some link type?
 boolean isValidTypeForLink(NodeType nt, LinkType lt, LinkDirection ld)
          Can some node type appear on a particular side of some link type?
 boolean linksToInstancingsIncludeArguments(LinkType lt)
          For which link types is it desirable to link to the arguments of an instsancing as well as the frame node?
 boolean missingAttributesInheritedBackward(LinkType lt)
          For which link types is it desirable for a node to inherit an attribute from another node to which it links (i.e., inheriting over a backward link) if it lacks the attribute entirely?
 boolean missingAttributesInheritedForward(LinkType lt)
          For which link types is it desirable for a node to inherit an attribute from another node linked to it (i.e., inheriting over a forward link) if it lacks the attribute entirely?
 boolean multipleBackwardLinksAllowed(LinkType lt)
          Can a node have more than one node linked to it by a certain link type?
 boolean multipleForwardLinksAllowed(LinkType lt)
          Can a node link to more than one other node by a certain link type?
 boolean mustHaveSameTypes(LinkType lt)
          Does a certain link type need to have the same type of node on both sides?
 java.util.HashSet validLeftTypes(LinkType lt)
          What types of nodes can appear to the left of a certain link type?
 java.util.HashSet validRightTypes(LinkType lt)
          What types of nodes can appear to the right of a certain link type?
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkProperties

public LinkProperties(LinkPropertiesInterface LPI)
Method Detail

multipleForwardLinksAllowed

public boolean multipleForwardLinksAllowed(LinkType lt)
Can a node link to more than one other node by a certain link type?


multipleBackwardLinksAllowed

public boolean multipleBackwardLinksAllowed(LinkType lt)
Can a node have more than one node linked to it by a certain link type?


validLeftTypes

public java.util.HashSet validLeftTypes(LinkType lt)
                                 throws Scheherexception
What types of nodes can appear to the left of a certain link type?

Throws:
Scheherexception

validRightTypes

public java.util.HashSet validRightTypes(LinkType lt)
                                  throws Scheherexception
What types of nodes can appear to the right of a certain link type?

Throws:
Scheherexception

isValidLeftType

public boolean isValidLeftType(NodeType nt,
                               LinkType lt)
                        throws Scheherexception
Can some node type appear to the left of some link type?

Throws:
Scheherexception

isValidRightType

public boolean isValidRightType(NodeType nt,
                                LinkType lt)
                         throws Scheherexception
Can some node type appear to the left of some link type?

Throws:
Scheherexception

isValidTypeForLink

public boolean isValidTypeForLink(NodeType nt,
                                  LinkType lt,
                                  LinkDirection ld)
                           throws Scheherexception
Can some node type appear on a particular side of some link type? (LinkDirection.FromNode implies left of link; ToNode, right.)

Throws:
Scheherexception

mustHaveSameTypes

public boolean mustHaveSameTypes(LinkType lt)
Does a certain link type need to have the same type of node on both sides?


canHaveMultipleLabels

public boolean canHaveMultipleLabels(LinkType lt)
Does a certain link type allow two nodes to be linked several times with different labels?


canHaveReflexiveLinks

public boolean canHaveReflexiveLinks(LinkType lt)
Does a certain link type allow a node to link directly to itself?


canHaveCircularLinks

public boolean canHaveCircularLinks(LinkType lt)
Does a certain link type allow a node to link indirectly to itself (i.e., passing through one or more nodes in a circuit)?


inferSupertypesOfToSideNodesAreLinked

public boolean inferSupertypesOfToSideNodesAreLinked(LinkType lt)
When querying a node for its linked nodes, are the supertypes of the result nodes also result nodes?


inferSupertypesOfFromSideNodesAreLinked

public boolean inferSupertypesOfFromSideNodesAreLinked(LinkType lt)

inferToSideNodesInheritLinksToSubtypes

public boolean inferToSideNodesInheritLinksToSubtypes(LinkType lt)
When querying a node for nodes that link to it, are the nodes linked to the the given node's subnodes also results?


inferToSideNodesInheritLinksToSupertypes

public boolean inferToSideNodesInheritLinksToSupertypes(LinkType lt)
When querying a node for nodes that link to it, are the nodes linked to the the given node's super-nodes also results?


inferFromSideNodesInheritLinksFromSupertypes

public boolean inferFromSideNodesInheritLinksFromSupertypes(LinkType lt)
When querying a node for nodes it links to, are the nodes linked from the given node's super-nodes also results?


inferFromSideNodesInheritLinksFromSubtypes

public boolean inferFromSideNodesInheritLinksFromSubtypes(LinkType lt)
When querying a node for nodes it links to, are the nodes linked from the given node's subnodes also results?


cannotRemoveIfLinkedTo

public boolean cannotRemoveIfLinkedTo(LinkType lt)
Is it critically bad to remove a node if it is linked to by another node for a certain link type?


cannotRemoveIfLinks

public boolean cannotRemoveIfLinks(LinkType lt)
Is it critically bad to remove a node if it links to another node for a certain link type?


linksToInstancingsIncludeArguments

public boolean linksToInstancingsIncludeArguments(LinkType lt)
For which link types is it desirable to link to the arguments of an instsancing as well as the frame node? For example: if movie1 = example(protection(health)), should an example link be drawn between movie1 and health as well as between movie1 and example?


missingAttributesInheritedForward

public boolean missingAttributesInheritedForward(LinkType lt)
For which link types is it desirable for a node to inherit an attribute from another node linked to it (i.e., inheriting over a forward link) if it lacks the attribute entirely?


missingAttributesInheritedBackward

public boolean missingAttributesInheritedBackward(LinkType lt)
For which link types is it desirable for a node to inherit an attribute from another node to which it links (i.e., inheriting over a backward link) if it lacks the attribute entirely?



Copyright © 2011 David K. Elson. All Rights Reserved.