/** * Tests if the {@link ExecutionMetadata#STATUS status} if an * {@link ExecutionMetadata#EXECUTION execution} is * {@link ExecutionMetadata#STATUS_FAILED failed}. * @param graph the graph with the execution metadata * @param execution the execution node * @return <code>true</code> if the status is faild. Otherwise <code>false</code>. */ public static boolean isExecutionFailed(Graph graph, BlankNodeOrIRI execution){ return STATUS_FAILED.equals(getReference(graph,execution,STATUS)); } /**
eaData.put(EAProps.entity, getReference(graph, entityAnnotation, ENHANCER_ENTITY_REFERENCE)); eaData.put(EAProps.label, getString(graph, entityAnnotation, ENHANCER_ENTITY_LABEL)); eaData.put(EAProps.confidence, EnhancementEngineHelper.get(
/** * Tests if the {@link ExecutionMetadata#STATUS status} if an * {@link ExecutionMetadata#EXECUTION execution} is * {@link ExecutionMetadata#STATUS_FAILED failed}. * @param graph the graph with the execution metadata * @param execution the execution node * @return <code>true</code> if the status is faild. Otherwise <code>false</code>. */ public static boolean isExecutionFailed(Graph graph, BlankNodeOrIRI execution){ return STATUS_FAILED.equals(getReference(graph,execution,STATUS)); } /**
eaData.put(EAProps.entity, getReference(graph, entityAnnotation, ENHANCER_ENTITY_REFERENCE)); eaData.put(EAProps.label, getString(graph, entityAnnotation, ENHANCER_ENTITY_LABEL)); eaData.put(EAProps.confidence, EnhancementEngineHelper.get(
/** * Tests if the {@link ExecutionMetadata#STATUS status} if an * {@link ExecutionMetadata#EXECUTION execution} has already finished. This * includes the states {@link ExecutionMetadata#STATUS_COMPLETED completed} * and {@link ExecutionMetadata#STATUS_FAILED failed}. * @param graph the graph with the execution metadata * @param execution the execution node * @return <code>true</code> if the execution has already finished */ public static boolean isExecutionFinished(Graph graph, BlankNodeOrIRI execution){ IRI status = getReference(graph,execution,STATUS); return STATUS_FAILED.equals(status) || STATUS_COMPLETED.equals(status); } /**
BlankNodeOrIRI object = EnhancementEngineHelper.getReference(results, recognition, ZemantaOntologyEnum.object.getUri()); log.debug(" > object :" + object); IRI targetType = EnhancementEngineHelper.getReference(results, entity, ZemantaOntologyEnum.targetType.getUri()); log.debug(" o type :" + targetType); if (ZemantaOntologyEnum.targetType_RDF.getUri().equals(targetType)) {
/** * Tests if the {@link ExecutionMetadata#STATUS status} if an * {@link ExecutionMetadata#EXECUTION execution} has already finished. This * includes the states {@link ExecutionMetadata#STATUS_COMPLETED completed} * and {@link ExecutionMetadata#STATUS_FAILED failed}. * @param graph the graph with the execution metadata * @param execution the execution node * @return <code>true</code> if the execution has already finished */ public static boolean isExecutionFinished(Graph graph, BlankNodeOrIRI execution){ IRI status = getReference(graph,execution,STATUS); return STATUS_FAILED.equals(status) || STATUS_COMPLETED.equals(status); } /**
if(!textAnnotations.contains(suggestions)) { BlankNodeOrIRI suggestion = suggestions.next().getSubject(); RDFTerm suggestedEntity = EnhancementEngineHelper.getReference(metadata, suggestion, ENHANCER_ENTITY_REFERENCE); if(suggestedEntity != null){ //it has a suggestion Double confidence = EnhancementEngineHelper.get( RDFTerm suggestedEntity = EnhancementEngineHelper.getReference(metadata, existingSuggestion, ENHANCER_ENTITY_REFERENCE);
return null; IRI type = EnhancementEngineHelper.getReference(graph, textAnnotation, DC_TYPE); if (type == null) { log.warn("Unable to process TextAnnotation {} because property {}"
public Execution(ChainExecution parent, Graph graph, BlankNodeOrIRI node) { this.chain = parent; this.graph = graph; this.node = node; BlankNodeOrIRI executionNode = ExecutionMetadataHelper.getExecutionNode(graph, node); if(executionNode != null){ this.executionNode = new ExecutionNode(graph, executionNode); } else { this.executionNode = null; } this.status = getReference(graph, node, ExecutionMetadata.STATUS); this.started = ExecutionMetadataHelper.getStarted(graph, node); this.completed = ExecutionMetadataHelper.getCompleted(graph, node); if(started != null && completed != null){ this.duration = completed.getTime() - started.getTime(); } else { this.duration = null; } }
public Execution(ChainExecution parent, Graph graph, BlankNodeOrIRI node) { this.chain = parent; this.graph = graph; this.node = node; BlankNodeOrIRI executionNode = ExecutionMetadataHelper.getExecutionNode(graph, node); if(executionNode != null){ this.executionNode = new ExecutionNode(graph, executionNode); } else { this.executionNode = null; } this.status = getReference(graph, node, ExecutionMetadata.STATUS); this.started = ExecutionMetadataHelper.getStarted(graph, node); this.completed = ExecutionMetadataHelper.getCompleted(graph, node); if(started != null && completed != null){ this.duration = completed.getTime() - started.getTime(); } else { this.duration = null; } }
getReference(executionMetadata, chainExecutionNode, STATUS))) { executeableNodes.removeAll(running); if(log.isDebugEnabled()){
Suggestion suggestion = new Suggestion(entityAnnotation); suggestion.entityUri = EnhancementEngineHelper.getReference(graph, entityAnnotation, ENHANCER_ENTITY_REFERENCE); if (suggestion.entityUri == null) {
return null; entity.type = EnhancementEngineHelper.getReference(graph, textAnnotation, DC_TYPE);
private static String getOrigin(Graph graph, IRI entityAnnotation) { IRI uOrigin = EnhancementEngineHelper.getReference(graph, entityAnnotation, ENHANCER_ORIGIN); if (uOrigin != null) { return uOrigin.getUnicodeString(); } else { String sOrigin = EnhancementEngineHelper.getString(graph, entityAnnotation, ENHANCER_ORIGIN); if (sOrigin != null) { return sOrigin; } else { Literal lOrigin = EnhancementEngineHelper.get(graph, entityAnnotation, ENHANCER_ORIGIN, Literal.class, lf); if (lOrigin != null) { return lOrigin.getLexicalForm(); } else { return null; } } } }
executionPlan, contentItem.getUri(), null, null); for(Entry<BlankNodeOrIRI,BlankNodeOrIRI> executionEntry : executionsMap.entrySet()){ IRI status = getReference(executionMetadata, executionEntry.getKey(), STATUS); if(status == null){ throw new IllegalArgumentException("The ex:Execution '"
log.debug(" > confidence :" + confidence); IRI target = EnhancementEngineHelper.getReference(results, category, ZemantaOntologyEnum.target.getUri()); if (target != null) { IRI categorisationScheme = EnhancementEngineHelper.getReference(results, target, ZemantaOntologyEnum.categorization.getUri()); if (categorisationScheme != null && categorisationScheme.equals(ZemantaOntologyEnum.categorization_DMOZ.getUri())) { String categoryTitle = EnhancementEngineHelper.getString(results, target, ZemantaOntologyEnum.title.getUri());