ilog.rules.vocabulary.model.bom.io

Class IlrBOMVocabularyXMLHelper

  • java.lang.Object
    • ilog.rules.vocabulary.model.bom.io.IlrBOMVocabularyXMLHelper


  • public class IlrBOMVocabularyXMLHelper
    extends java.lang.Object
    IlrBOMVocabularyXMLHelper provides a helper API for the Vocx XML schema. You call getIdentifier to retrieve a vocabulary element identification as described in a vocx XML document.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static java.lang.String getIdentifier(IlrVocabularyElement vocElt)
      Provides an identifier for the given vocabulary element.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IlrBOMVocabularyXMLHelper

        public IlrBOMVocabularyXMLHelper()
    • Method Detail

      • getIdentifier

        public static java.lang.String getIdentifier(IlrVocabularyElement vocElt)
        Provides an identifier for the given vocabulary element. You use the identifier returned by this method to link this vocabulary element to the XML fragment that created it when the vocabulary has been read from a Vocx compatible XML document.

        The identifier returned by this method has the following protocol:

        • For a concept, returns the identifier of the concept as specified in <Concept> XML element.
        • For a concept instance, returns the identifier of the concept instance as specified in <Instance> XML element.
        • For a sentence, returns an identifier that corresponds to the <Phrase> XML element that defined this sentence. This identifier is made from:
                  the Holder attribute + ( + the list of role types separated with ',' + ) + # + the phrase index.
           
          Note: (...) is optional if no role is defined for the phrase element.

        Examples

        The following XML fragment:
                        <Phrase Holder="example.customer.name"...>
                        ...
                        </Phrase>
         

        generates example.customer.name#0 if the phrase element for this attribute is the first one in the XML document.

        The following XML fragment:

                        <Phrase Holder="example.customer.name"...>
                                <Role Index="0" Type="int"/>
                                <Role Index="1" Type="string"/>
                        </Phrase>
         

        Generates example.customer.name(int,string)#0 if the phrase element for this method was the first one in the XML document.

        Note: this method does not return any identifier for a fact type.

        Parameters:
        vocElt - A vocabulary element.
        Returns:
        A string identifier. If the given vocabulary element is not a concept, a concept instance or a sentence, null is returned.

© Copyright IBM Corp. 1987, 2017