|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.stanbol.enhancer.servicesapi.helper.EnhancementEngineHelper
public class EnhancementEngineHelper
| Field Summary | |
|---|---|
static java.util.Comparator<EnhancementEngine> |
EXECUTION_ORDER_COMPARATOR
Comparator that allows to sort a list/array of EnhancementEngines
based on there ServiceProperties.ENHANCEMENT_ENGINE_ORDERING. |
protected static java.util.Random |
rng
|
| Constructor Summary | |
|---|---|
EnhancementEngineHelper()
|
|
| Method Summary | ||
|---|---|---|
protected static org.apache.clerezza.rdf.core.UriRef |
createEnhancement(org.apache.clerezza.rdf.core.MGraph metadata,
EnhancementEngine engine,
org.apache.clerezza.rdf.core.UriRef contentItemId)
Create a new enhancement instance in the metadata-graph of the content item along with default properties (dc:creator and dc:created) and return the UriRef of the extraction so that engines can further add. |
|
static org.apache.clerezza.rdf.core.UriRef |
createEntityEnhancement(ContentItem ci,
EnhancementEngine engine)
Create a new instance with the types enhancer:Enhancement and enhancer:EntityAnnotation in the metadata-graph of the content item along with default properties (dc:creator and dc:created) and return the UriRef of the extraction so that engines can further add |
|
static org.apache.clerezza.rdf.core.UriRef |
createEntityEnhancement(org.apache.clerezza.rdf.core.MGraph metadata,
EnhancementEngine engine,
org.apache.clerezza.rdf.core.UriRef contentItemId)
Create a new instance with the types enhancer:Enhancement and enhancer:EntityAnnotation in the parsed graph along with default properties (dc:creator, dc:created and enhancer:extracted-form) and return the UriRef of the extraction so that engines can further add. |
|
static org.apache.clerezza.rdf.core.UriRef |
createNewExtraction(ContentItem ci,
EnhancementEngine engine)
Deprecated. |
|
static org.apache.clerezza.rdf.core.UriRef |
createTextEnhancement(ContentItem ci,
EnhancementEngine engine)
Create a new instance with the types enhancer:Enhancement and enhancer:TextAnnotation in the metadata-graph of the content item along with default properties (dc:creator and dc:created) and return the UriRef of the extraction so that engines can further add. |
|
static org.apache.clerezza.rdf.core.UriRef |
createTextEnhancement(org.apache.clerezza.rdf.core.MGraph metadata,
EnhancementEngine engine,
org.apache.clerezza.rdf.core.UriRef contentItemId)
Create a new instance with the types enhancer:Enhancement and enhancer:TextAnnotation in the parsed graph along with default properties (dc:creator, dc:created and enhancer:extracted-form) and return the UriRef of the extraction so that engines can further add. |
|
static
|
get(org.apache.clerezza.rdf.core.TripleCollection graph,
org.apache.clerezza.rdf.core.NonLiteral resource,
org.apache.clerezza.rdf.core.UriRef property,
java.lang.Class<T> type,
org.apache.clerezza.rdf.core.LiteralFactory literalFactory)
Getter for the first typed literal value of the property for a resource. |
|
static java.lang.Integer |
getEngineOrder(EnhancementEngine engine)
Gets the ServiceProperties.ENHANCEMENT_ENGINE_ORDERING value
for the parsed EnhancementEngine. |
|
static org.apache.clerezza.rdf.core.UriRef |
getReference(org.apache.clerezza.rdf.core.TripleCollection graph,
org.apache.clerezza.rdf.core.NonLiteral resource,
org.apache.clerezza.rdf.core.UriRef property)
Getter for the first value of the data type property for a resource |
|
static java.util.Iterator<org.apache.clerezza.rdf.core.UriRef> |
getReferences(org.apache.clerezza.rdf.core.TripleCollection graph,
org.apache.clerezza.rdf.core.NonLiteral resource,
org.apache.clerezza.rdf.core.UriRef property)
Getter for the values of the data type property for a resource. |
|
static java.lang.String |
getString(org.apache.clerezza.rdf.core.TripleCollection graph,
org.apache.clerezza.rdf.core.NonLiteral resource,
org.apache.clerezza.rdf.core.UriRef property)
Getter for the first String literal value the property for a resource |
|
static java.util.Iterator<java.lang.String> |
getStrings(org.apache.clerezza.rdf.core.TripleCollection graph,
org.apache.clerezza.rdf.core.NonLiteral resource,
org.apache.clerezza.rdf.core.UriRef property)
Getter for the string literal values the property for a resource |
|
static
|
getValues(org.apache.clerezza.rdf.core.TripleCollection graph,
org.apache.clerezza.rdf.core.NonLiteral resource,
org.apache.clerezza.rdf.core.UriRef property,
java.lang.Class<T> type,
org.apache.clerezza.rdf.core.LiteralFactory literalFactory)
Getter for the typed literal values of the property for a resource |
|
static java.util.UUID |
randomUUID()
Random UUID generator with re-seedable RNG for the tests. |
|
static void |
setSeed(long seed)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static java.util.Random rng
public static final java.util.Comparator<EnhancementEngine> EXECUTION_ORDER_COMPARATOR
EnhancementEngines
based on there ServiceProperties.ENHANCEMENT_ENGINE_ORDERING.
| Constructor Detail |
|---|
public EnhancementEngineHelper()
| Method Detail |
|---|
public static void setSeed(long seed)
public static org.apache.clerezza.rdf.core.UriRef createTextEnhancement(ContentItem ci,
EnhancementEngine engine)
ci - the ContentItem being under analysisengine - the Engine performing the analysis
public static org.apache.clerezza.rdf.core.UriRef createTextEnhancement(org.apache.clerezza.rdf.core.MGraph metadata,
EnhancementEngine engine,
org.apache.clerezza.rdf.core.UriRef contentItemId)
metadata - the graphengine - the enginecontentItemId - the id
public static org.apache.clerezza.rdf.core.UriRef createEntityEnhancement(ContentItem ci,
EnhancementEngine engine)
ci - the ContentItem being under analysisengine - the Engine performing the analysis
public static org.apache.clerezza.rdf.core.UriRef createEntityEnhancement(org.apache.clerezza.rdf.core.MGraph metadata,
EnhancementEngine engine,
org.apache.clerezza.rdf.core.UriRef contentItemId)
metadata - the graphengine - the enginecontentItemId - the id
protected static org.apache.clerezza.rdf.core.UriRef createEnhancement(org.apache.clerezza.rdf.core.MGraph metadata,
EnhancementEngine engine,
org.apache.clerezza.rdf.core.UriRef contentItemId)
ci - the ContentItem being under analysisengine - the Engine performing the analysis
@Deprecated
public static org.apache.clerezza.rdf.core.UriRef createNewExtraction(ContentItem ci,
EnhancementEngine engine)
ci - the ContentItem being under analysisengine - the Engine performing the analysis
createEntityEnhancement(ContentItem, EnhancementEngine),
createTextEnhancement(ContentItem, EnhancementEngine)public static java.util.UUID randomUUID()
public static <T> T get(org.apache.clerezza.rdf.core.TripleCollection graph,
org.apache.clerezza.rdf.core.NonLiteral resource,
org.apache.clerezza.rdf.core.UriRef property,
java.lang.Class<T> type,
org.apache.clerezza.rdf.core.LiteralFactory literalFactory)
T - the java class the literal value needs to be converted to.
Note that the parsed LiteralFactory needs to support this conversiongraph - the graph used to query for the property valueresource - the resourceproperty - the propertytype - the type the literal needs to be converted toliteralFactory - the literalFactory
public static <T> java.util.Iterator<T> getValues(org.apache.clerezza.rdf.core.TripleCollection graph,
org.apache.clerezza.rdf.core.NonLiteral resource,
org.apache.clerezza.rdf.core.UriRef property,
java.lang.Class<T> type,
org.apache.clerezza.rdf.core.LiteralFactory literalFactory)
T - the java class the literal value needs to be converted to.
Note that the parsed LiteralFactory needs to support this conversiongraph - the graph used to query for the property valueresource - the resourceproperty - the propertytype - the type the literal needs to be converted toliteralFactory - the literalFactory
public static java.lang.String getString(org.apache.clerezza.rdf.core.TripleCollection graph,
org.apache.clerezza.rdf.core.NonLiteral resource,
org.apache.clerezza.rdf.core.UriRef property)
graph - the graph used to query for the property valueresource - the resourceproperty - the property
public static java.util.Iterator<java.lang.String> getStrings(org.apache.clerezza.rdf.core.TripleCollection graph,
org.apache.clerezza.rdf.core.NonLiteral resource,
org.apache.clerezza.rdf.core.UriRef property)
graph - the graph used to query for the property valueresource - the resourceproperty - the property
public static org.apache.clerezza.rdf.core.UriRef getReference(org.apache.clerezza.rdf.core.TripleCollection graph,
org.apache.clerezza.rdf.core.NonLiteral resource,
org.apache.clerezza.rdf.core.UriRef property)
graph - the graph used to query for the property valueresource - the resourceproperty - the property
public static java.util.Iterator<org.apache.clerezza.rdf.core.UriRef> getReferences(org.apache.clerezza.rdf.core.TripleCollection graph,
org.apache.clerezza.rdf.core.NonLiteral resource,
org.apache.clerezza.rdf.core.UriRef property)
graph - the graph used to query for the property valueresource - the resourceproperty - the property
public static java.lang.Integer getEngineOrder(EnhancementEngine engine)
ServiceProperties.ENHANCEMENT_ENGINE_ORDERING value
for the parsed EnhancementEngine. If the Engine does not implement the
ServiceProperties interface or does not provide the
ServiceProperties.ENHANCEMENT_ENGINE_ORDERING the
ServiceProperties.ORDERING_DEFAULT is returned
This method is guaranteed to NOT return null.
engine - the engine
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||