本文整理了Java中org.apache.stanbol.entityhub.servicesapi.model.Entity.getRepresentation()
方法的一些代码示例,展示了Entity.getRepresentation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.getRepresentation()
方法的具体详情如下:
包路径:org.apache.stanbol.entityhub.servicesapi.model.Entity
类名称:Entity
方法名:getRepresentation
[英]Getter for the Representation of that sign as defined/managed by the site The Representation#getId() of this Representation MUST BE the same as the #getId() if the Entity.
[中]Getter对于站点定义/管理的符号表示,此表示的表示形式#getId()必须与实体的表示形式#getId()相同。
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
/**
* Getter for the {@link #TARGET} value of the parsed Entity.
* @param entity the entity
* @return the value of <code>null</code> if not present
*/
public static final String getTargetId(Entity entity){
Object id = entity.getRepresentation().getFirst(TARGET);
return id != null?id.toString():null;
}
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
/**
* Setter for the target of this mapping
* @param target the id of the target
* @throws IllegalArgumentException if the parsed target is <code>null</code>
* or an empty string
*/
public final void setTargetId(String target) throws IllegalArgumentException {
if(target == null || target.isEmpty()){
throw new IllegalArgumentException("The parsed target id MUST NOT be NULL nor empty!");
}
wrappedEntity.getRepresentation().setReference(TARGET, target);
}
代码示例来源:origin: apache/stanbol
@Override
protected Representation getRepresentation(SiteManager sm, String id, boolean offlineMode) throws EntityhubException {
Entity entity = sm.getEntity(id);
return entity == null ? null : entity.getRepresentation();
}
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
/**
* Getter for the value of the {@link #SOURCE} property of the parsed
* Entity.
* @param entity the entity
* @return the value or <code>null</code> if not present.
*/
public static String getSourceId(Entity entity) {
Object id = entity.getRepresentation().getFirst(SOURCE);
return id != null?id.toString():null;
}
/**
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
/**
* Setter for the expire date for this representation.
* @param date the date or <code>null</code> if this representation does not
* expire
*/
public final void setExpires(Date date) {
wrappedEntity.getRepresentation().set(EXPIRES, date);
}
代码示例来源:origin: apache/stanbol
/**
* Getter for the value of the {@link #SOURCE} property of the parsed
* Entity.
* @param entity the entity
* @return the value or <code>null</code> if not present.
*/
public static String getSourceId(Entity entity) {
Object id = entity.getRepresentation().getFirst(SOURCE);
return id != null?id.toString():null;
}
/**
代码示例来源:origin: apache/stanbol
/**
* Setter for the source of the mapping
* @param source the source
* @throws IllegalArgumentException if the parsed source is <code>null</code>
* or an empty string
*/
public final void setSourceId(String source) throws IllegalArgumentException {
if(source == null || source.isEmpty()){
throw new IllegalArgumentException("The ID of the source MUST NOT be NULL nor empty");
}
wrappedEntity.getRepresentation().setReference(SOURCE, source);
}
代码示例来源:origin: apache/stanbol
@Override
protected Representation getRepresentation(Site site, String id, boolean offlineMode) throws EntityhubException {
Entity entity = site.getEntity(id);
return entity == null ? null : entity.getRepresentation();
}
@Override
代码示例来源:origin: apache/stanbol
@Override
protected Representation getRepresentation(String id) throws EntityhubException {
Entity entity = site.getEntity(id);
return entity != null ? entity.getRepresentation():null;
}
@Override
代码示例来源:origin: apache/stanbol
@Override
protected Representation getRepresentation(Entityhub eh, String id, boolean offlineMode) throws EntityhubException {
Entity e = eh.getEntity(id);
return e == null ? null : e.getRepresentation();
}
代码示例来源:origin: apache/stanbol
/**
* Getter for the date this representation expires. If this representation
* does not expire this method returns <code>null</code>.
* @return the expire date or <code>null</code> if not applicable.
*/
public final Date getExpires() {
return wrappedEntity.getRepresentation().getFirst(EXPIRES, Date.class);
}
代码示例来源:origin: apache/stanbol
/**
* Setter for the target of this mapping
* @param target the id of the target
* @throws IllegalArgumentException if the parsed target is <code>null</code>
* or an empty string
*/
public final void setTargetId(String target) throws IllegalArgumentException {
if(target == null || target.isEmpty()){
throw new IllegalArgumentException("The parsed target id MUST NOT be NULL nor empty!");
}
wrappedEntity.getRepresentation().setReference(TARGET, target);
}
代码示例来源:origin: apache/stanbol
/**
* Setter for the expire date for this representation.
* @param date the date or <code>null</code> if this representation does not
* expire
*/
public final void setExpires(Date date) {
wrappedEntity.getRepresentation().set(EXPIRES, date);
}
代码示例来源:origin: apache/stanbol
@Override
protected Representation getRepresentation(String id) throws EntityhubException {
Entity entity = siteManager.getEntity(id);
return entity != null ? entity.getRepresentation() : null;
}
@Override
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
/**
* Setter for the source of the mapping
* @param source the source
* @throws IllegalArgumentException if the parsed source is <code>null</code>
* or an empty string
*/
public final void setSourceId(String source) throws IllegalArgumentException {
if(source == null || source.isEmpty()){
throw new IllegalArgumentException("The ID of the source MUST NOT be NULL nor empty");
}
wrappedEntity.getRepresentation().setReference(SOURCE, source);
}
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
/**
* Getter for the date this representation expires. If this representation
* does not expire this method returns <code>null</code>.
* @return the expire date or <code>null</code> if not applicable.
*/
public final Date getExpires() {
return wrappedEntity.getRepresentation().getFirst(EXPIRES, Date.class);
}
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
/**
* Setter for the ID of the Entity (and the Representation) this metadata
* are about
* @param id the id of the entity
*/
public final void setEntityId(String id){
wrappedEntity.getRepresentation().setReference(
RdfResourceEnum.aboutRepresentation.getUri(), id);
}
/**
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
/**
* Getter for the ID of the Entity (and the Representation) this metadata
* are about
* @return the id of the entity this metadata are about
*/
public final String getEntityId(){
Reference ref = wrappedEntity.getRepresentation().getFirstReference(
RdfResourceEnum.aboutRepresentation.getUri());
return ref == null ? null : ref.getReference();
}
}
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
/**
* If necessary adds missing requirements to the parsed entity and than
* returns the wrapped Entity.
* @param entity the entity
*/
public static EntityMapping init(Entity entity){
entity.getRepresentation().addReference(RDF_TYPE,RdfResourceEnum.EntityMapping.getUri());
return new EntityMapping(entity,true);
}
/**
代码示例来源: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);
}
内容来源于网络,如有侵权,请联系作者删除!