public final class IlrVocabularyHelper
extends java.lang.Object
| Constructor and Description |
|---|
IlrVocabularyHelper() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.List |
allSentencesList(IlrVocabulary vocabulary)
Returns the list of all sentences defined in the specified vocabulary.
|
static void |
cleanDeleteConcept(IlrConcept concept)
Removes a concept and all related concepts, fact types, sentences and concept instances.
|
static IlrVocabulary |
copyVocabulary(IlrVocabulary vocabulary)
Creates a deep copy of the specified vocabulary.
|
static void |
copyVocabularyContents(IlrVocabulary source,
IlrVocabulary target)
Clones a source vocabulary and puts the result into a
target vocabulary.
|
static IlrBusinessArtifact |
findArtifact(java.lang.String name,
IlrVocabulary vocabulary)
Finds a business artifact by its name from the given vocabulary.
|
static IlrConcept |
findConceptByLabel(java.lang.String label,
IlrVocabulary vocabulary)
Finds a concept by its label.
|
static IlrConceptInstance |
findConceptInstanceByLabel(java.lang.String label,
IlrVocabulary vocabulary)
Finds a concept instance by its label.
|
static IlrVocabularyElement |
findElement(java.lang.String identifier,
IlrVocabulary vocabulary)
Finds a vocabulary element by its identifier from the given vocabulary.
|
static IlrSentence |
findSentence(java.lang.String identifier,
IlrFactType factType)
Finds a sentence from its identifier, from the specified fact type.
|
static IlrSentence |
findSentence(java.lang.String fullName,
IlrVocabulary vocabulary)
Finds a sentence by its full name from the specified vocabulary.
|
static java.util.List |
findSentencesForCategory(IlrSentenceCategory category,
IlrFactType factType)
Gets the list of sentences of the specified sentence category, from the given
fact type.
|
static java.util.Collection |
getAllParents(IlrConcept concept,
IlrVocabulary vocabulary)
Gets the collection of all direct and indirect parents of the specified concept, for the given vocabulary.
|
static java.util.Map |
getAllProperties(IlrBaseElement element,
IlrVocabulary vocabulary)
Returns all properties defined on the element as a map.
|
static java.util.List |
getArgumentsSyntacticRoles(java.util.List syntacticRoles)
Returns the sublist of syntactic roles that are not owned nor owner.
|
static IlrConcept |
getBooleanValueType(IlrVocabulary voc) |
static int |
getHolderRoleIndex(IlrSentence sentence)
Returns the index of the holder role in the given sentence.
|
static IlrRole[] |
getNonHolderRoles(IlrFactType factType)
Returns all non holder roles of the specified fact type.
|
static java.util.List |
getObjectRoleConcepts(IlrSentence sentence,
IlrVocabulary vocabulary)
Returns the list of the concepts of all object roles of the specified
sentence.
|
static java.util.List |
getObjectRoles(IlrSentence sentence)
Returns the list of all object roles of the specified sentence.
|
static IlrRole |
getOwnedRole(IlrFactType factType)
Returns the owned role of a fact type.
|
static IlrSyntacticRole |
getOwnedSyntacticRole(IlrSentence sentence)
Gets the owned syntactic role for the specified sentence.
|
static IlrSyntacticRole |
getOwnedSyntacticRole(java.util.List syntacticRoles)
Gets the owned syntactic role from the specified list of
getOwnerSyntacticRole. |
static IlrRole |
getOwnerRole(IlrFactType factType)
Returns the owner role of a fact type.
|
static IlrSyntacticRole |
getOwnerSyntacticRole(IlrSentence sentence)
Gets the owner syntactic role for the specified sentence.
|
static IlrSyntacticRole |
getOwnerSyntacticRole(java.util.List syntacticRoles)
Gets the owner syntactic role from the specified list of
getOwnerSyntacticRole. |
static IlrVerbalizable |
getPrototypeSentenceRoleLabel(IlrSyntacticRole role)
Returns the label of the role in a way to be verbalized.
|
static java.util.List |
getRepresentedSyntacticRoles(IlrSentence sentence)
This helper method returns the syntactic roles that are represented in the sentence template.
|
static IlrRole |
getRole(java.lang.String roleIdentifier,
IlrVocabulary vocabulary)
Returns a role from its identifier.
|
static java.lang.String |
getRoleIdentifier(IlrRole role)
Returns the string identifier of a fact type role.
|
static IlrCardinality |
getSentenceCardinality(IlrSentence sentence)
Returns the cardinality of the subject role.
|
static IlrRole |
getSubjectRole(IlrSentence sentence)
Returns the subject role of the specified sentence.
|
static IlrSyntacticRole |
getSubjectSyntacticRole(IlrSentence sentence)
Gets the subject syntactic role from the specified sentence.
|
static IlrSyntacticRole |
getSyntacticRoleForRole(IlrRole role,
IlrSentence sentence)
Gets the syntactic role corresponding to role from sentence.
|
static IlrVocabulary |
getSystemVocabulary(IlrVocabulary vocabulary)
Retrieves the Boot vocabulary stored in the vocabulary set, if the vocabulary is
a vocabulary set.
|
static IlrSyntacticRole |
getThisSyntacticRole(IlrSentence sentence)
Returns the syntactic role of the sentence, which corresponds to the holder role.
|
static boolean |
isDeprecated(IlrVocabularyElement vocElement)
Checks if the vocabulary element has the deprecated property.
|
static boolean |
isOwned(IlrRole role)
Tests if the specified role is marked as owned.
|
static boolean |
isOwner(IlrRole role)
Tests if the specified role is marked as owner.
|
static boolean |
isSubConceptOf(IlrConcept subConcept,
IlrConcept superConcept,
IlrVocabulary vocabulary)
Returns
true if subConcept equals superConcept
or if subConcept is a sub concept of superConcept. |
static boolean |
isSubjectRole(IlrSyntacticRole sRole)
Tests if the specified syntactic role is a 'subject'.
|
static boolean |
isSystem(IlrVocabulary voc)
This method tests whether the given vocabulary is identified as a "boot vocabulary".
|
static boolean |
isSystem(IlrVocabularyElement elt)
Tests if the given vocabulary element is part of the "boot vocabulary".
|
static boolean |
isUsedAsSubject(IlrRole r)
Checks if the role is used as a subject in one sentence of the fact type.
|
static void |
removeAllSentences(IlrFactType factType)
Removes all sentences from the specified fact type.
|
public static void cleanDeleteConcept(IlrConcept concept)
concept - The concept to remove.public static java.util.List allSentencesList(IlrVocabulary vocabulary)
vocabulary - The vocabulary.public static java.util.Collection getAllParents(IlrConcept concept, IlrVocabulary vocabulary)
concept - The concept.vocabulary - The vocabulary.public static boolean isSubConceptOf(IlrConcept subConcept, IlrConcept superConcept, IlrVocabulary vocabulary)
true if subConcept equals superConcept
or if subConcept is a sub concept of superConcept.subConcept - The concept to examine.superConcept - The concept that is tested to be the parent of subConcept.true if subConcept equals superConcept
or if subConcept is a subconcept of superConcept.public static IlrVocabularyElement findElement(java.lang.String identifier, IlrVocabulary vocabulary)
identifier - The identifier of the vocabulary element to find.vocabulary - The vocabulary to look into.null.public static IlrBusinessArtifact findArtifact(java.lang.String name, IlrVocabulary vocabulary)
name - The name of the business artifact to find.vocabulary - The vocabulary to look into.null.public static IlrSentence findSentence(java.lang.String fullName, IlrVocabulary vocabulary)
fullName - The sentence full name.vocabulary - The vocabulary.null.public static IlrSentence findSentence(java.lang.String identifier, IlrFactType factType)
identifier - The sentence identifier.factType - The fact type.null.public static java.util.List findSentencesForCategory(IlrSentenceCategory category, IlrFactType factType)
category - The category.factType - The fact type.public static IlrConcept findConceptByLabel(java.lang.String label, IlrVocabulary vocabulary)
label - The label.vocabulary - The vocabulary.null.public static IlrConceptInstance findConceptInstanceByLabel(java.lang.String label, IlrVocabulary vocabulary)
label - The label.vocabulary - The vocabulary.null.public static IlrSyntacticRole getSyntacticRoleForRole(IlrRole role, IlrSentence sentence)
role - The role.sentence - The sentence.null.public static IlrSyntacticRole getSubjectSyntacticRole(IlrSentence sentence)
sentence - The sentence.null if the sentence
has no subject.public static IlrRole getSubjectRole(IlrSentence sentence)
sentence - The sentence.null.public static IlrCardinality getSentenceCardinality(IlrSentence sentence)
sentence - The sentence.public static IlrRole getOwnerRole(IlrFactType factType)
factType - The fact type.null is returned.isOwner(IlrRole role)public static boolean isOwner(IlrRole role)
role - The rolerole is marked as owner,
true is returned.public static IlrRole getOwnedRole(IlrFactType factType)
null if the fact type has no
owned role.factType - The fact type.isOwner(IlrRole role)public static boolean isOwned(IlrRole role)
role - The roletrue if the role is marked as owned.public static IlrRole[] getNonHolderRoles(IlrFactType factType)
factType - The fact type.public static IlrSyntacticRole getThisSyntacticRole(IlrSentence sentence)
sentence - The sentence.public static IlrConcept getBooleanValueType(IlrVocabulary voc)
public static java.util.List getObjectRoles(IlrSentence sentence)
sentence - The sentence.IlrSyntacticRoleCategory.OBJECT_LITERAL.
Each element of the list is an instance of IlrRole.public static java.util.List getObjectRoleConcepts(IlrSentence sentence, IlrVocabulary vocabulary)
sentence - The sentence.vocabulary - The vocabulary used to resolve the concepts (see IlrVocabulary.getConcept(IlrRole)).sentence and
having the category IlrSyntacticRoleCategory.OBJECT_LITERAL.public static IlrVocabulary getSystemVocabulary(IlrVocabulary vocabulary)
vocabulary - The vocabulary.null if the vocabulary is not a vocabulary set.public static boolean isSystem(IlrVocabulary voc)
voc - public static boolean isSystem(IlrVocabularyElement elt)
elt - A vocabulary element.true is returned.isSystem(IlrVocabulary).public static IlrVocabulary copyVocabulary(IlrVocabulary vocabulary)
vocabulary - The vocabulary to be copied.public static void copyVocabularyContents(IlrVocabulary source, IlrVocabulary target)
source - The source vocabulary.target - The target vocabulary.public static boolean isUsedAsSubject(IlrRole r)
r - r is the subject role.public static boolean isSubjectRole(IlrSyntacticRole sRole)
true is the specified syntactic role is a 'subject' in its sentence.IlrSyntacticRoleCategory.SUBJECT_LITERALpublic static int getHolderRoleIndex(IlrSentence sentence)
sentence - public static IlrSyntacticRole getOwnerSyntacticRole(IlrSentence sentence)
sentence - The sentence.public static IlrSyntacticRole getOwnerSyntacticRole(java.util.List syntacticRoles)
getOwnerSyntacticRole.syntacticRoles - The list of syntactic roles.public static IlrSyntacticRole getOwnedSyntacticRole(IlrSentence sentence)
sentence - The sentence.public static IlrSyntacticRole getOwnedSyntacticRole(java.util.List syntacticRoles)
getOwnerSyntacticRole.syntacticRoles - The list of syntactic roles.public static java.util.List getArgumentsSyntacticRoles(java.util.List syntacticRoles)
syntacticRoles - The list of syntactic roles.public static java.util.List getRepresentedSyntacticRoles(IlrSentence sentence)
sentence - public static boolean isDeprecated(IlrVocabularyElement vocElement)
vocElement - The vocabulary element.true if the vocElement is marked as deprecated.public static java.lang.String getRoleIdentifier(IlrRole role)
role - The role.public static IlrRole getRole(java.lang.String roleIdentifier, IlrVocabulary vocabulary)
roleIdentifier - The role identifier.vocabulary - The vocabularynull.public static void removeAllSentences(IlrFactType factType)
factType - The fact type.public static java.util.Map getAllProperties(IlrBaseElement element, IlrVocabulary vocabulary)
element - The base element.vocabulary - The vocabulary.public static IlrVerbalizable getPrototypeSentenceRoleLabel(IlrSyntacticRole role)
RuntimeException is thrown if there is no specified label on the role.© Copyright IBM Corp. 1987, 2017