- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.Yard
类的一些代码示例,展示了Yard
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Yard
类的具体详情如下:
包路径:org.apache.stanbol.entityhub.servicesapi.yard.Yard
类名称:Yard
[英]The Yard represents a local cache for Representations of the Entities and Symbols managed by a referenced site.
Referenced Sites need to provide the configuration if there representations should be cached locally. This is done by using one of the defined CacheStrategy.
The Idea is not to have one big Yard that caches all the representations, but to provide the possibility to use different caches. This means, that each Site can have its own Yard instance. However several Sites might also use the same Yard.
The YardManager is an singleton services that manages the different Yard instances and provides an central point of access for the Entityhuband the SiteManager.
This should also allow for implementing Yards that are based on
Side note: The name yard was chosen as name because in farming "yard" refers to a piece of enclosed land for farm animals or other agricultural purpose and the storage component of the entityhub does the same thing for Entities.
[中]庭院代表一个本地缓存,用于表示被引用站点管理的实体和符号。
如果应该在本地缓存表示,则引用的站点需要提供配置。这是通过使用一种已定义的缓存策略来实现的。
我们的想法不是要有一个大院子来缓存所有的表示,而是提供使用不同缓存的可能性。这意味着,每个站点都可以有自己的庭院实例。然而,几个场地也可能使用同一个场地。
YardManager是一个单例服务,它管理不同的Yard实例,并为EntityHub和SiteManager提供一个中心访问点。
这也应该允许实现基于
*由引用站点的转储生成的索引
*所指站点使用的软件的本地安装
*等等。。。
TODO:框架需要提供一个特殊的场地来存储符号和实体映射信息。该场地目前被称为Entityhub场地。我们还需要一个特殊的API来处理这个院子吗?仍然可以提供一个“默认”实现,该实现基于一个提供正常庭院服务的组件来实现该接口。
旁注:之所以选择“庭院”作为名称,是因为在农业中,“庭院”指的是一块用于农场动物或其他农业用途的封闭土地,entityhub的存储组件对实体也有同样的作用。
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
@Override
public void removeAll() throws YardException {
//ensure that the baseConfig (if present) is not deleted by this
//operation
Representation baseConfig = yard.getRepresentation(Cache.BASE_CONFIGURATION_URI);
yard.removeAll();
if(baseConfig != null){
yard.store(baseConfig);
}
}
代码示例来源:origin: apache/stanbol
@Override
protected ValueFactory getValueFactory() {
return yard.getValueFactory();
}
@Override
代码示例来源:origin: apache/stanbol
@Override
public final QueryResultList<String> findEntityReferences(FieldQuery query) throws YardException{
return entityhubYard.findReferences(query);
}
@Override
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
/**
* Stores the current configuration used for caching documents back to the
* {@link Yard}. This configuration is present in the {@link #additionalMapper}).
* If this field is <code>null</code> than any existing configuration is
* removed form the index.
* @throws YardException on any error while changing the configuration in the
* yard.
* @throws IllegalArgumentException if <code>null</code> is parsed as {@link Yard}.
*/
protected static void storeAdditionalMappingsConfiguration(Yard yard,FieldMapper additionalMapper) throws YardException,IllegalArgumentException {
if(yard == null){
throw new IllegalArgumentException("The parsed Yard MUST NOT be NULL!");
}
if(additionalMapper == null){
yard.remove(Cache.ADDITIONAL_CONFIGURATION_URI);
} else {
Representation config = yard.getValueFactory().createRepresentation(Cache.ADDITIONAL_CONFIGURATION_URI);
writeFieldConfig(config,additionalMapper);
yard.store(config);
}
}
/**
代码示例来源:origin: apache/stanbol
Representation test1 = yard.create(id); // create and add
yard.store(test1);// store
Representation test2 = yard.getValueFactory().createRepresentation(id2); // create
yard.store(test2);// store
assertTrue(yard.isRepresentation(test1.getId())); // test if stored
assertTrue(yard.isRepresentation(test2.getId()));
yard.removeAll(); // remove
assertFalse(yard.isRepresentation(test1.getId())); // test if removed
assertFalse(yard.isRepresentation(test2.getId()));
yard.store(test1);// store
assertTrue(yard.isRepresentation(test1.getId())); // test if stored
yard.removeAll(); // remove
assertFalse(yard.isRepresentation(test1.getId()));
代码示例来源:origin: apache/stanbol
@Test
public void testFindTextWildcards(){
//init the test data
FieldQueryTestData data = getFieldQueryTestData();
//prefix search with *
FieldQuery query = getYard().getQueryFactory().createFieldQuery();
String wildcard = data.textValue1.getText();
wildcard = wildcard.substring(0, wildcard.length()-1) + "*";
query.setConstraint(data.textField, new TextConstraint(wildcard,PatternType.wildcard,false, "en"));
query.addSelectedField(data.refField);
query.addSelectedField(data.textField);
validateQueryResults(query, getYard().find(query),
Arrays.asList(data.r1en.getId(), data.r2en.getId()),
Arrays.asList(data.refField, data.textField));
//wildcard with ?
query = getYard().getQueryFactory().createFieldQuery();
//selects r1en and r2en
wildcard = data.textValue1.getText();
wildcard = wildcard.substring(0, wildcard.length()-1) + "?";
query.setConstraint(data.textField, new TextConstraint(wildcard,PatternType.wildcard,false, "de"));
query.addSelectedField(data.refField);
query.addSelectedField(data.textField);
validateQueryResults(query, getYard().find(query),
Arrays.asList(data.r1de.getId(), data.r2de.getId()),
Arrays.asList(data.refField, data.textField));
}
代码示例来源:origin: apache/stanbol
@Override
protected Representation getRepresentation(String id) throws EntityhubException {
return yard.getRepresentation(id);
}
@Override
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
@Override
public Iterable<Representation> store(Iterable<Representation> representations) throws IllegalArgumentException, YardException {
return yard.store(representations);
}
代码示例来源:origin: apache/stanbol
/**
* Stores the parsed representation to the Yard and also applies the
* configured {@link #getFieldMapper() FieldMappings}.
* @param The representation to store
*/
@Override
public void store(Representation representation) throws ManagedSiteException {
try {
Yard yard = getYard();
fieldMapper.applyMappings(representation, representation, yard.getValueFactory());
yard.store(representation);
} catch (YardException e) {
throw new ManagedSiteException(e.getMessage(), e);
}
}
/**
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
@Override
public QueryResultList<Representation> findRepresentation(FieldQuery query) throws YardException, IllegalArgumentException {
return yard.findRepresentation(query);
}
代码示例来源:origin: apache/stanbol
@Override
public String getId() {
return yard.getId();
}
代码示例来源:origin: apache/stanbol
private void deleteEntities(Collection<String> ids) throws YardException {
FieldQuery fieldQuery = getQueryFactory().createFieldQuery();
Collection<String> toDelete = new HashSet<String>(ids);
for(String id : ids){
if(id != null && !id.isEmpty()){
fieldQuery.setConstraint(RdfResourceEnum.aboutRepresentation.getUri(), new ReferenceConstraint(id));
for(Iterator<String> it = entityhubYard.findReferences(fieldQuery).iterator();it.hasNext();){
toDelete.add(it.next());
}
}
}
if(!toDelete.isEmpty()){
entityhubYard.remove(toDelete);
}
}
代码示例来源: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
@Override
protected FieldQuery createQuery() {
return yard.getQueryFactory().createFieldQuery();
}
@Override
代码示例来源:origin: apache/stanbol
/**
* Same as {@link #testFindText()} but using
* {@link Yard#findRepresentation(FieldQuery)} to execute the queries
*/
@Test
public void testFindRepresentationText(){
//init the test data
FieldQueryTestData data = getFieldQueryTestData();
//query for all languages and value1
FieldQuery query = getYard().getQueryFactory().createFieldQuery();
query.setConstraint(data.textField, new TextConstraint(data.textValue1.getText()));
validateQueryResults(query, getYard().findRepresentation(query),
Arrays.asList( data.r1.getId(), data.r1en.getId(), data.r1de.getId()),
Arrays.asList(data.textField, data.refField, data.intField));
//same for value2
query = getYard().getQueryFactory().createFieldQuery();
query.setConstraint(data.textField, new TextConstraint(data.textValue2.getText()));
validateQueryResults(query, getYard().findRepresentation(query),
Arrays.asList( data.r2.getId(), data.r2en.getId(), data.r2de.getId()),
Arrays.asList(data.textField, data.refField, data.intField));
}
/**
代码示例来源: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: apache/stanbol
/**
* Same as {@link #testFindText()} but using
* {@link Yard#findReferences(FieldQuery)} to execute the queries
*/
@Test
public void testFindReferencesText(){
//init the test data
FieldQueryTestData data = getFieldQueryTestData();
//query for all languages and value1
FieldQuery query = getYard().getQueryFactory().createFieldQuery();
query.setConstraint(data.textField, new TextConstraint(data.textValue1.getText()));
validateQueryResults(query, getYard().findReferences(query),
Arrays.asList(data.r1.getId(), data.r1en.getId(), data.r1de.getId()));
//same for value2
query = getYard().getQueryFactory().createFieldQuery();
query.setConstraint(data.textField, new TextConstraint(data.textValue2.getText()));
validateQueryResults(query, getYard().findReferences(query),
Arrays.asList( data.r2.getId(), data.r2en.getId(), data.r2de.getId()));
}
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
@Override
public void remove(Iterable<String> ids) throws IllegalArgumentException, YardException {
yard.remove(ids);
}
@Override
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.indexing.core
for(Representation r : yard.store(reps)){
QueueItem<Representation> old = toStore.remove(r.getId());
String.format(errorMsg,entry.getItem().getId(),yard.getId()),
yardException);
代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.entityhub.core
@Override
public final QueryResultList<Representation> find(FieldQuery query) throws YardException{
return entityhubYard.find(query);
}
@Override
我正在运行“yard server -g”,但它只为 axlsx 生成目录。 当我点击一个类(class)时,我得到: undefined method `new' for nil:NilClass.
本文整理了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
我正在开发一个 Ruby 编程教程,我想用 Yard 记录它。 .默认情况下,Yard 将模块/类中的所有方法按字母顺序排列。但是,由于教程中每个模块中的方法都是相互构建的,因此我希望按照我编写它们的
我想使用 Yard 从我的自述文件链接到另一个额外的文件。 例如,我有以下几行: ...关于如何贡献的详细说明 [此处](contributing.md) 我希望这个链接到我的文件 contribut
我使用 YARD 为 ruby 项目生成文档。该项目包含一个 README.md 文件,如下所示: # MyTool Welcome to your new gem! ... ##
是否有约定表明 YARD 样式文档中的参数仅用于其“真实性”状态,即您只想知道它是 false 还是 nil 还是真实的? 下面通常用什么代替 Truthy? # @param [String] na
我有一个看起来像这样的方法: def get_endpoint(params: {}) end 我希望这个方法的调用者能够传入一些可选参数。 我想编写 YARD 文档来支持这一点,如果我不使用关键字参
我想在 yard-genereted 文档中包含图像,但无法在任何地方找到如何执行此操作...有人知道如何执行此操作吗? 最佳答案 您可以只添加 标记到您的文档: # Blah-blah # #
我是一名优秀的程序员,十分优秀!