- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.create()
方法的一些代码示例,展示了Yard.create()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Yard.create()
方法的具体详情如下:
包路径:org.apache.stanbol.entityhub.servicesapi.yard.Yard
类名称:Yard
方法名:create
[英]Creates a new empty representation and stores it in the Yard. The Yard is responsible to assign a valid ID.
[中]创建一个新的空表示并将其存储在院子中。造船厂负责分配一个有效的ID。
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
@Override
public Representation create() throws YardException {
return yard.create();
}
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
@Override
public Representation create(String id) throws IllegalArgumentException, YardException {
return yard.create(id);
}
代码示例来源:origin: apache/stanbol
@Override
public Representation create() throws YardException {
return yard.create();
}
代码示例来源:origin: apache/stanbol
@Override
public Representation create(String id) throws IllegalArgumentException, YardException {
return yard.create(id);
}
代码示例来源:origin: apache/stanbol
/**
* Lookups (or initialises) the metadata for the entity with the parsed id
* @param entityId The id of the entity
* @param init if the metadata should be initialised of not existing
* @return the metadata for that Entity or <code>null</code> if not existing
* and <code>init == false</code>
* @throws YardException
*/
private Representation lookupMetadata(String entityId, boolean init) throws YardException {
Representation metadata;
//TODO: check the asumption that the Metadata always use the
// extension ".meta"
String metaID = entityId+".meta";
metadata = entityhubYard.getRepresentation(metaID);
if(metadata == null){
metadata = entityhubYard.create(metaID);
}
return metadata;
}
/**
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
/**
* Lookups (or initialises) the metadata for the entity with the parsed id
* @param entityId The id of the entity
* @param init if the metadata should be initialised of not existing
* @return the metadata for that Entity or <code>null</code> if not existing
* and <code>init == false</code>
* @throws YardException
*/
private Representation lookupMetadata(String entityId, boolean init) throws YardException {
Representation metadata;
//TODO: check the asumption that the Metadata always use the
// extension ".meta"
String metaID = entityId+".meta";
metadata = entityhubYard.getRepresentation(metaID);
if(metadata == null){
metadata = entityhubYard.create(metaID);
}
return metadata;
}
/**
代码示例来源:origin: apache/stanbol
protected Representation create() throws YardException {
Representation r = getYard().create();
representationIds.add(r.getId());
return r;
}
代码示例来源:origin: apache/stanbol
@Test(expected = IllegalArgumentException.class)
public void testCreateWithEmptyString() throws YardException {
getYard().create("");// throws an IllegalArgumentException
}
代码示例来源:origin: apache/stanbol
@Test
public void testDefaultCreate() throws YardException {
Yard yard = getYard();
Representation test = yard.create();
assertNotNull(test);
Representation test2 = yard.create();
assertNotNull(test2);
assertNotSame(test, test2);
assertFalse("Two Representation created with create() MUST NOT be equals", test.equals(test2));
}
代码示例来源:origin: apache/stanbol
@Test
public void testCreateWithNull() throws YardException {
Yard yard = getYard();
Representation test = yard.create(null);
assertNotNull("Parsing NULL to create(String) MUST create a valid Representation", test);
representationIds.add(test.getId()); // add id to cleanup list
Representation test2 = yard.create(null);
assertNotNull("Parsing NULL to create(String) MUST create a valid Representation", test2);
representationIds.add(test2.getId()); // add id to cleanup list
assertNotSame(test, test2);
assertFalse("Two Representation created with create(null) MUST NOT be equals", test.equals(test2));
}
代码示例来源:origin: apache/stanbol
protected Representation create(String id, boolean store) throws YardException {
Representation r;
if (store) {
r = getYard().create(id);
} else if (id != null && !id.isEmpty()) {
r = getYard().getValueFactory().createRepresentation(id);
} else {
throw new IllegalArgumentException("If store is FALSE the id MUST NOT be NULL nor EMPTY!");
}
representationIds.add(r.getId());
return r;
}
代码示例来源:origin: apache/stanbol
@Test(expected = IllegalArgumentException.class)
public void testCreateWithExistingId() throws YardException {
Yard yard = getYard();
Representation test = create();
assertNotNull(test);
yard.create(test.getId()); // throws an IllegalArgumentException
}
代码示例来源:origin: apache/stanbol
Representation localRep = entityhubYard.create(constructResourceId(DEFAULT_MANAGED_ENTITY_PREFIX));
Entity localEntity = loadEntity(localRep);
importEntity(remoteEntity, site, localEntity, valueFactory);
Representation entityMappingRepresentation = entityhubYard.create(
constructResourceId(DEFAULT_MAPPING_PREFIX));
Entity entityMappingEntity = loadEntity(entityMappingRepresentation);
代码示例来源:origin: apache/stanbol
/**
* Tests if <code>null</code> values within the Iterable are ignored and do not cause an Exception
*
* @throws YardException
*/
@Test
public void testRemoveRepresentationsWithNullValue() throws YardException {
// NOTE: This test needs not to use the create(..) method, because we
// remove the created representation form the store anyway as part of the
// test
String id = "urn:yard.test.testRemoveRepresentationsWithNullValue:representation.id";
Yard yard = getYard();
Representation test = yard.create(id); // create and add
assertTrue(yard.isRepresentation(test.getId()));
yard.remove(Arrays.asList(test.getId(), null));
assertFalse(yard.isRepresentation(test.getId()));
}
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
Representation localRep = entityhubYard.create(constructResourceId(DEFAULT_MANAGED_ENTITY_PREFIX));
Entity localEntity = loadEntity(localRep);
importEntity(remoteEntity, site, localEntity, valueFactory);
Representation entityMappingRepresentation = entityhubYard.create(
constructResourceId(DEFAULT_MAPPING_PREFIX));
Entity entityMappingEntity = loadEntity(entityMappingRepresentation);
代码示例来源:origin: apache/stanbol
/**
* Tests that {@link Representation} IDs that are not stored by the yard are ignored by the multiple
* remove method
*
* @throws YardException
*/
@Test
public void testRemoveRepresentationsWithNonStoredValue() throws YardException {
// NOTE: This test needs not to use the create(..) method, because we
// remove the created representation form the store anyway as part of the
// test
String id = "urn:yard.test.testRemoveRepresentationsWithNullValue:representation.stored";
String id2 = "urn:yard.test.testRemoveRepresentationsWithNullValue:representation.notStored";
Yard yard = getYard();
Representation test = yard.create(id); // create and add
assertTrue(yard.isRepresentation(test.getId()));
yard.remove(Arrays.asList(test.getId(), id2));
assertFalse(yard.isRepresentation(test.getId()));
assertFalse(yard.isRepresentation(id2));
}
代码示例来源:origin: apache/stanbol
/**
* Tests that multiple Representations are removed.
*
* @throws YardException
*/
@Test
public void testRemoveRepresentations() throws YardException {
// NOTE: This test needs not to use the create(..) method, because we
// remove the created representation form the store anyway as part of the
// test
String id = "urn:yard.test.testRemoveRepresentationsWithNullValue:representation.id1";
String id2 = "urn:yard.test.testRemoveRepresentationsWithNullValue:representation.id2";
String field = "urn:the.field:used.for.this.Test";
String testValue = "This is a test";
Yard yard = getYard();
// use both ways to add the two Representations (should make no differences,
// but one never can know ...
Representation test1 = yard.create(id); // create and add
Representation test2 = yard.getValueFactory().createRepresentation(id2); // create
test2.add(field, testValue); // add value
yard.store(test2);// store
assertTrue(yard.isRepresentation(test1.getId())); // test if stored
assertTrue(yard.isRepresentation(test2.getId()));
yard.remove(Arrays.asList(test1.getId(), test2.getId())); // remove
assertFalse(yard.isRepresentation(test1.getId())); // test if removed
assertFalse(yard.isRepresentation(test2.getId()));
}
/**
代码示例来源:origin: apache/stanbol
Representation test1 = yard.create(id); // create and add
我正在尝试使用 Apache Stanbol 提取短语。我期望结果如下。 content="我住在巴黎,想学习使用 java 进行自然语言处理。"提取的短语应该是, 巴黎 自然语言处理 Java 但它
按照以下说明进行操作: stanbol build and run stanbol instance 我们在执行的时候总是报如下错误: % mvn clean install [错误] 无法在项目 o
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard类的一些代码示例,展示了Yard类的具体用法。这些代码示例主要来源于Github
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.YardException类的一些代码示例,展示了YardException类的具体用法
我是 Maven 的新手,我不知道如何将 Apache Stanbol 嵌入到我的 Maven 应用程序中。 我已将以下依赖项添加到我的 pom,是 pom,因为存储库中没有可用的 jar。 `
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.remove()方法的一些代码示例,展示了Yard.remove()的具体用法
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.getName()方法的一些代码示例,展示了Yard.getName()的具体
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.update()方法的一些代码示例,展示了Yard.update()的具体用法
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.getQueryFactory()方法的一些代码示例,展示了Yard.getQ
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.find()方法的一些代码示例,展示了Yard.find()的具体用法。这些代
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.findRepresentation()方法的一些代码示例,展示了Yard.f
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.create()方法的一些代码示例,展示了Yard.create()的具体用法
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.getId()方法的一些代码示例,展示了Yard.getId()的具体用法。这
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.findReferences()方法的一些代码示例,展示了Yard.findR
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.isRepresentation()方法的一些代码示例,展示了Yard.isR
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.removeAll()方法的一些代码示例,展示了Yard.removeAll(
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.getRepresentation()方法的一些代码示例,展示了Yard.ge
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard.getValueFactory()方法的一些代码示例,展示了Yard.getV
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.YardException.()方法的一些代码示例,展示了YardException.(
我是一名优秀的程序员,十分优秀!