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

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

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

Entity.getMetadata介绍

[英]Getter for the meta data about the representation of this Entity. The Representation#getId() of this Representation MUST NOT BE the same as the #getId() if the Entity.
[中]获取有关此实体表示的元数据的Getter。此表示形式的表示形式#getId()不能与实体的表示形式#getId()相同。

代码示例

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

/**
 * Removes a reference to a contributor
 * @param reference the contributor
 */
public final void removeContributorLink(String reference) {
  wrappedEntity.getMetadata().removeReference(NamespaceEnum.dcTerms+"contributor", reference);
}
/**

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

/**
 * Adds a reference to the creator to the entity (metadata)
 * @param reference the creator
 */
public final void addCreatorLink(String reference) {
  if(reference != null && !reference.isEmpty()){
    wrappedEntity.getMetadata().addReference(NamespaceEnum.dcTerms+"creator", reference);
  }
}
/**

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

/**
   * checks if the cc:Work type can be removed
   */
  private void checkForCcWork(){
    if(wrappedEntity.getMetadata().getFirst(NamespaceEnum.cc+"license")==null && 
        wrappedEntity.getMetadata().getFirst(NamespaceEnum.cc+"attributionName")==null &&
        wrappedEntity.getMetadata().getFirst(NamespaceEnum.cc+"attributionURL")==null){
      wrappedEntity.getMetadata().removeReference(NamespaceEnum.rdf+"type", NamespaceEnum.cc+"Work");
    }
  }
}

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

/**
 * Adds a name to a contributor (e.g. a site where some information where
 * imported)
 * @param name the contributor
 */
public final void addContributorName(String name) {
  if(name != null && !name.isEmpty()){
    wrappedEntity.getMetadata().addNaturalText(NamespaceEnum.dcTerms+"contributor", name);
  }
}
/**

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

/**
 * Removes a creator
 * @param name the creator
 */
public final void removeCreatorName(String name) {
  wrappedEntity.getMetadata().removeNaturalText(NamespaceEnum.dcTerms+"creator", name);
}

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

/**
 * Setter for the modified date (replaces existing values)
 * @param date the new date
 */
public void setModified(Date date) {
  if(date != null){
    wrappedEntity.getMetadata().set(NamespaceEnum.dcTerms+"modified", date);
  }
}
/**

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

/**
 * Removes a link to the creator
 * @param reference the creator
 */
public final void removeCreatorLink(String reference) {
  wrappedEntity.getMetadata().removeReference(NamespaceEnum.dcTerms+"creator", reference);
}

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

/**
 * Adds an attribution to the metadata of the entity
 * @param text the attribution
 * @param lang the language of the attribution (optional)
 */
public final void addAttributionText(String text,String lang){
  if(text != null && !text.isEmpty()){
    wrappedEntity.getMetadata().addNaturalText(NamespaceEnum.cc+"attributionName", text,lang);
    wrappedEntity.getMetadata().addReference(NamespaceEnum.rdf+"type", NamespaceEnum.cc+"Work");
  }
}
/**

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

/**
 * Adds an link to the attribution to the metadata of the entity
 * @param reference the link to the attribution
 */
public final void addAttributionLink(String reference){
  if(reference != null && !reference.isEmpty()){
    wrappedEntity.getMetadata().addReference(NamespaceEnum.cc+"attributionURL", reference);
    wrappedEntity.getMetadata().addReference(NamespaceEnum.rdf+"type", NamespaceEnum.cc+"Work");
  }
}
/**

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

/**
 * Getter for the last modified date
 * @return the date of the last modification
 */
public final Date getModified() {
  return wrappedEntity.getMetadata().getFirst(NamespaceEnum.dcTerms+"modified", Date.class);
}

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

/**
 * Adds a link to a contributor (e.g. a site where some information where
 * imported)
 * @param reference the contributor
 */
public final void addContributorLink(String reference) {
  if(reference != null && !reference.isEmpty()){
    wrappedEntity.getMetadata().addReference(NamespaceEnum.dcTerms+"contributor", reference);
  }
}
/**

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

/**
 * Adds a name to the creator to the entity (metadata)
 * @param name the creator
 */
public final void addCreatorName(String name) {
  if(name != null && !name.isEmpty()){
    wrappedEntity.getMetadata().addNaturalText(NamespaceEnum.dcTerms+"creator", name);
  }
}

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

/**
 * Adds an link to the attribution to the metadata of the entity
 * @param reference the link to the attribution
 */
public final void addAttributionLink(String reference){
  if(reference != null && !reference.isEmpty()){
    wrappedEntity.getMetadata().addReference(NamespaceEnum.cc+"attributionURL", reference);
    wrappedEntity.getMetadata().addReference(NamespaceEnum.rdf+"type", NamespaceEnum.cc+"Work");
  }
}
/**

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

/**
 * Getter for the creation date of this mapping
 * TODO: decide if that should be stored in the data or the metadata
 * @return the creation date. 
 */
public final Date getCreated() {
  return wrappedEntity.getMetadata().getFirst(NamespaceEnum.dcTerms+"created", Date.class);
}
/**

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

/**
 * Adds a name to a contributor (e.g. a site where some information where
 * imported)
 * @param name the contributor
 */
public final void addContributorName(String name) {
  if(name != null && !name.isEmpty()){
    wrappedEntity.getMetadata().addNaturalText(NamespaceEnum.dcTerms+"contributor", name);
  }
}
/**

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

/**
 * Removes a creator
 * @param name the creator
 */
public final void removeCreatorName(String name) {
  wrappedEntity.getMetadata().removeNaturalText(NamespaceEnum.dcTerms+"creator", name);
}

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

/**
 * Removes a link to the creator
 * @param reference the creator
 */
public final void removeCreatorLink(String reference) {
  wrappedEntity.getMetadata().removeReference(NamespaceEnum.dcTerms+"creator", reference);
}

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

/**
 * Getter for the creation date of this mapping
 * TODO: decide if that should be stored in the data or the metadata
 * @return the creation date. 
 */
public final Date getCreated() {
  return wrappedEntity.getMetadata().getFirst(NamespaceEnum.dcTerms+"created", Date.class);
}
/**

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

/**
 * Adds a name to the creator to the entity (metadata)
 * @param name the creator
 */
public final void addCreatorName(String name) {
  if(name != null && !name.isEmpty()){
    wrappedEntity.getMetadata().addNaturalText(NamespaceEnum.dcTerms+"creator", name);
  }
}

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

private void addRDFTo(Graph graph, Entity entity) {
  addRDFTo(graph, entity.getRepresentation());
  addRDFTo(graph, entity.getMetadata());
  //now add some triples that represent the Sign
  addEntityTriplesToGraph(graph, entity);
}

相关文章

微信公众号

最新文章

更多