public class OntologyMentionDescriber extends Object implements AbstractSemanticAnnotationHelper.MentionDescriber
AbstractSemanticAnnotationHelper.MentionDescriber
for annotations that represent ontology entities.
The generated description for a given entity looks like
"Class (Instance)", e.g. "City (London)".
For this describer to work, the array of descriptive features (see
AbstractSemanticAnnotationHelper.getDescriptiveFeatures()
) must start
with the name of the class
feature, followed optionally by the
name of the feature
feature. All subsequent feature names are
ignored.Modifier and Type | Field and Description |
---|---|
protected boolean |
localNamesOnly |
protected String |
nameSpaceSeparator |
Constructor and Description |
---|
OntologyMentionDescriber() |
Modifier and Type | Method and Description |
---|---|
String |
describeMention(AbstractSemanticAnnotationHelper helper,
String mentionUri,
String[] descriptiveFeatureNames,
String[] descriptiveFeatureValues) |
protected String |
getName(String uri)
Calculates the class/instance name according to the settings of this
describer.
|
String |
getNameSpaceSeparator()
Gets the string used to split the ontology URIs into name space and local
name.
|
boolean |
isLocalNamesOnly()
Is this describer set to use local (short) names only?
|
void |
setLocalNamesOnly(boolean localNamesOnly)
Set this to
true to use local (short) names in the
description, or false to use full URIs. |
void |
setNameSpaceSeparator(String nameSpaceSeparator)
When this describer is set to use
localNamesOnly (true |
protected String nameSpaceSeparator
protected boolean localNamesOnly
public String getNameSpaceSeparator()
public void setNameSpaceSeparator(String nameSpaceSeparator)
localNamesOnly
(true
by default), the name space separator is used to split ontology URIs into
name space and local name.
Call this method to change the separator string used if the default
separator ("#") is not suitable.
nameSpaceSeparator
- the new separator to use.public boolean isLocalNamesOnly()
true
if local names should be used instead of full
URIs.public void setLocalNamesOnly(boolean localNamesOnly)
true
to use local (short) names in the
description, or false
to use full URIs. Defaults to
true
.the
- new value.public String describeMention(AbstractSemanticAnnotationHelper helper, String mentionUri, String[] descriptiveFeatureNames, String[] descriptiveFeatureValues)
describeMention
in interface AbstractSemanticAnnotationHelper.MentionDescriber
Copyright © 2021 GATE. All rights reserved.