org.apache.stanbol.entityhub.servicesapi.model.Entity.getId()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.apache.stanbol.entityhub.servicesapi.model.Entity.getId()方法的一些代码示例,展示了Entity.getId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.getId()方法的具体详情如下:
包路径:org.apache.stanbol.entityhub.servicesapi.model.Entity
类名称:Entity
方法名:getId

Entity.getId介绍

[英]The id (signifier) of this Entity.
[中]这个实体的id(能指)。

代码示例

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

@Override
public final Entity delete(String id) throws EntityhubException, IllegalArgumentException {
  if(id == null || id.isEmpty()){
    throw new IllegalArgumentException("The parsed id MUST NOT be NULL nor emtpty!");
  }
  Entity entity = loadEntity(id);
  if(entity != null){
    log.debug("delete Entity {} as requested by the parsed id {}",entity.getId(),id);
    //we need to remove all mappings for this Entity
    deleteMappingsbyTarget(entity.getId());
    deleteEntity(entity);
  } else {
    log.debug("Unable to delete Entity for id {}, because no Entity for this id is" +
        "managed by the Entityhub",id);
  }
  return entity;
}
@Override

代码示例来源:origin: apache/stanbol

@Override
public final Entity delete(String id) throws EntityhubException, IllegalArgumentException {
  if(id == null || id.isEmpty()){
    throw new IllegalArgumentException("The parsed id MUST NOT be NULL nor emtpty!");
  }
  Entity entity = loadEntity(id);
  if(entity != null){
    log.debug("delete Entity {} as requested by the parsed id {}",entity.getId(),id);
    //we need to remove all mappings for this Entity
    deleteMappingsbyTarget(entity.getId());
    deleteEntity(entity);
  } else {
    log.debug("Unable to delete Entity for id {}, because no Entity for this id is" +
        "managed by the Entityhub",id);
  }
  return entity;
}
@Override

代码示例来源:origin: apache/stanbol

public Suggestion(Entity entity) {
  this.entity = entity;
  this.entityUri = new IRI(entity.getId());
  this.site = entity.getSite();
}

代码示例来源:origin: apache/stanbol

try {
  Entity entity = entityhub.store(representation);
  updated.put(entity.getId(), entity);
}catch (EntityhubException e) {
  log.error(String.format("Exception while storing Entity %s" +
  ResponseBuilder rb = Response.created(uriInfo.getAbsolutePathBuilder()
    .queryParam("id", "{entityId}")
    .build(entity.getId()));

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

log.warn("  > {} -> returned instance",mapping.getId());
while(resultIterator.hasNext()){
  log.warn("  > {} -> ignored",resultIterator.next());

代码示例来源:origin: apache/stanbol

log.warn("  > {} -> returned instance",mapping.getId());
while(resultIterator.hasNext()){
  log.warn("  > {} -> ignored",resultIterator.next());

代码示例来源:origin: apache/stanbol

entityMapping.setExpires(expireDate);
entityMapping.setSourceId(remoteEntity.getId());
entityMapping.setTargetId(localEntity.getId());

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

entityMapping.setExpires(expireDate);
entityMapping.setSourceId(remoteEntity.getId());
entityMapping.setTargetId(localEntity.getId());

代码示例来源:origin: apache/stanbol

annotationsToRelate.add(entitySuggestions.getKey().getEntity());
for (Suggestion suggestion : entitySuggestions.getValue()) {
  log.debug("Add Suggestion {} for {}", suggestion.getEntity().getId(),
    entitySuggestions.getKey());
  EnhancementRDFUtils.writeEntityAnnotation(this, literalFactory, graph, ci.getUri(),
    entityData.put(suggestion.getEntity().getId(), suggestion.getEntity()
        .getRepresentation());

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

rep.getId(),site.getConfiguration().getName());

代码示例来源:origin: apache/stanbol

rep.getId(),site.getConfiguration().getName());

代码示例来源:origin: apache/stanbol

IRI signId = new IRI(((Entity) result).getId());
addEntityTriplesToGraph(resultGraph, (Entity) result);
resultGraph.add(new TripleImpl(QUERY_RESULT_LIST, QUERY_RESULT, signId));
} else {
  addRDFTo(resultGraph, (Entity) result);
  resultId = new IRI(((Entity) result).getId());

代码示例来源:origin: apache/stanbol

guess.getRepresentation().getFirst(RdfResourceEnum.resultScore.getUri(), Float.class);
if (score == null) {
  log.warn("Missing Score for Entityhub Query Result {}!", guess.getId());
  continue;
  maxScore = score;
IRI uri = new IRI(guess.getId());
Suggestion suggestion = savedEntity.getSuggestion(uri);
if (suggestion == null) {
  log.info(" - not found {}", guess.getId());
  continue;

代码示例来源:origin: apache/stanbol

URI signId = sesameFactory.createURI(((Entity) result).getId());
addEntityTriplesToGraph(resultGraph, (Entity) result);
resultGraph.add(QUERY_RESULT_LIST, QUERY_RESULT, signId);
} else {
  addRDFTo(resultGraph, (Entity) result);
  resultId = sesameFactory.createURI(((Entity) result).getId());

代码示例来源:origin: apache/stanbol

/**
   * @param entity
   * @return
   * @throws JSONException
   */
  private JSONObject convertEntityToJSON(Entity entity) throws JSONException {
    JSONObject jSign;
    jSign = new JSONObject();
    jSign.put("id", entity.getId());
    jSign.put("site", entity.getSite());
//        Representation rep = sign.getRepresentation();
    jSign.put("representation", toJSON(entity.getRepresentation()));
    jSign.put("metadata", toJSON(entity.getMetadata()));
    return jSign;
  }

代码示例来源:origin: apache/stanbol

/**
 * Adds the Triples that represent the Sign to the parsed graph. Note that
 * this method does not add triples for the representation. However it adds
 * the triple (sign,singRepresentation,representation)
 *
 * @param graph the graph to add the triples
 * @param sign the sign
 */
private void addEntityTriplesToGraph(Model graph, Entity sign) {
  URI id = sesameFactory.createURI(sign.getId());
  URI metaId = sesameFactory.createURI(sign.getMetadata().getId());
  //add the FOAF triples between metadata and content
  graph.add(id, FOAF_PRIMARY_TOPIC_OF, metaId);
  graph.add(metaId, FOAF_PRIMARY_TOPIC, metaId);
  graph.add(metaId, RDF_TYPE, FOAF_DOCUMENT);
  //add the site to the metadata
  //TODO: this should be the HTTP URI and not the id of the referenced site
  Literal siteName = sesameFactory.createLiteral(sign.getSite());
  graph.add(metaId, EH_SIGN_SITE, siteName);
  
}

代码示例来源:origin: apache/stanbol

if (valueExistsInEntityAttributes(rulesOntologyAttr, entity, npEntity.getId())) {
  return true;

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core

if(site == null){
  log.warn("Unable to import Entity {} because the ReferencedSite {} is currently not active -> return null",
    remoteEntity.getId(),remoteEntity.getSite());
  return null;

代码示例来源:origin: apache/stanbol

if(site == null){
  log.warn("Unable to import Entity {} because the ReferencedSite {} is currently not active -> return null",
    remoteEntity.getId(),remoteEntity.getSite());
  return null;

代码示例来源:origin: apache/stanbol

/**
 * Adds the Triples that represent the Sign to the parsed graph. Note that
 * this method does not add triples for the representation. However it adds
 * the triple (sign,singRepresentation,representation)
 *
 * @param graph the graph to add the triples
 * @param sign the sign
 */
private void addEntityTriplesToGraph(Graph graph, Entity sign) {
  IRI id = new IRI(sign.getId());
  IRI metaId = new IRI(sign.getMetadata().getId());
  //add the FOAF triples between metadata and content
  graph.add(new TripleImpl(id, FOAF_PRIMARY_TOPIC_OF, metaId));
  graph.add(new TripleImpl(metaId, FOAF_PRIMARY_TOPIC, metaId));
  graph.add(new TripleImpl(metaId, RDF.type, FOAF_DOCUMENT));
  //add the site to the metadata
  //TODO: this should be the HTTP URI and not the id of the referenced site
  Literal siteName = literalFactory.createTypedLiteral(sign.getSite());
  graph.add(new TripleImpl(metaId, SIGN_SITE, siteName));
  
}

相关文章

微信公众号

最新文章

更多