本文整理了Java中org.openrdf.model.Model.contexts()
方法的一些代码示例,展示了Model.contexts()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.contexts()
方法的具体详情如下:
包路径:org.openrdf.model.Model
类名称:Model
方法名:contexts
[英]Returns a Set view of the contexts contained in this model. The set is backed by the model, so changes to the model are reflected in the set, and vice-versa. If the model is modified while an iteration over the set is in progress (except through the iterator's own removeoperation), the results of the iteration are undefined. The set supports element removal, which removes all statements from the model for which that element is a context value, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations if the parameters subj , pred or obj are null.
[中]返回此模型中包含的上下文的集合视图。集合由模型支持,因此对模型的更改会反映在集合中,反之亦然。如果在对集合进行迭代时修改了模型(除了通过迭代器自己的removeoperation),则迭代的结果是未定义的。该集合支持元素移除,即通过迭代器从模型中移除该元素作为上下文值的所有语句。移除,设置。移除、移除所有、保留和清除操作。如果参数sub、pred或obj为空,则不支持add或addAll操作。
代码示例来源:origin: anno4j/anno4j
private CharSequence getMatchNamespace(Resource clazz) {
for (Resource graph : ds.match(clazz, null, null).contexts()) {
if (graph instanceof URI) {
return getMatchNamespace(graph);
}
}
// this shouldn't happen, but just in case
return "urn:matches:";
}
代码示例来源:origin: org.openrdf.alibaba/alibaba-repository-object
private CharSequence getMatchNamespace(Resource clazz) {
for (Resource graph : ds.match(clazz, null, null).contexts()) {
if (graph instanceof URI) {
return getMatchNamespace(graph);
}
}
// this shouldn't happen, but just in case
return "urn:matches:";
}
代码示例来源:origin: org.openrdf.sesame/sesame-model-testsuite
@Override
public Set makeEmptySet() {
return new LinkedHashModel().filter(createURI("test"), RDF.VALUE, createLiteral("value")).contexts();
}
代码示例来源:origin: org.openrdf.sesame/sesame-rio-rdfjson
final Set<Resource> contexts = graph.filter(nextSubject, nextPredicate, nextObject).contexts();
内容来源于网络,如有侵权,请联系作者删除!