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

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

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

Entity.getSite介绍

[英]Getter for the id of the referenced Site that defines/manages this sign.
Note that the Entityhub allows that different referenced Sites provide representations for the same id ( Entity#getId()). Therefore there may be different entity instances of Entity with the same id but different representations.
In other word different referenced Sites may manage representations by using the same id.
Note also, that the Entityhub assumes that all such representations are equivalent and interchangeable. Therefore Methods that searches for Entities on different Sites will return the first hit without searching for any others.
[中]用于定义/管理此标志的引用站点id的Getter。
请注意,Entityhub允许不同的引用站点为相同的id(Entity#getId())提供表示。因此,可能存在具有相同id但不同表示形式的实体的不同实体实例。
换句话说,不同的引用站点可以使用相同的id管理表示。
还要注意,Entityhub假设所有这些表示都是等效的和可互换的。因此,在不同站点上搜索实体的方法将返回第一次命中,而不搜索任何其他方法。

代码示例

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

@Override
public boolean equals(Object o) {
  return o instanceof Entity && 
    representation.equals(((Entity)o).getRepresentation()) &&
    site.equals(((Entity)o).getSite()) &&
    metadata.equals(((Entity)o).getMetadata());
}

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

@Override
public boolean equals(Object o) {
  return o instanceof Entity && 
    representation.equals(((Entity)o).getRepresentation()) &&
    site.equals(((Entity)o).getSite()) &&
    metadata.equals(((Entity)o).getMetadata());
}

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

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

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

return null;
Site site = siteManager.getSite(remoteEntity.getSite());
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

return null;
Site site = siteManager.getSite(remoteEntity.getSite());
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

/**
   * @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

/**
 * 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));
  
}

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

if(suggestion.getEntity().getSite() != null){
  graph.add(new TripleImpl(entityAnnotation, 
    new IRI(RdfResourceEnum.site.getUri()), 
    new PlainLiteralImpl(suggestion.getEntity().getSite())));

相关文章