本文整理了Java中org.openrdf.model.Model.addAll()
方法的一些代码示例,展示了Model.addAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.addAll()
方法的具体详情如下:
包路径:org.openrdf.model.Model
类名称:Model
方法名:addAll
暂无
代码示例来源:origin: apache/stanbol
private void addRDFTo(Model graph, Representation representation) {
graph.addAll(valueFactory.toRdfRepresentation(representation).getModel());
}
代码示例来源:origin: eu.optique-project/r2rml-api-sesame-bridge
@Override
public Object createGraph(Collection<TriplesMap> maps) {
Model m = new LinkedHashModel();
m.setNamespace("rr", R2RMLVocabulary.NAMESPACE);
for (TriplesMap tm : maps) {
m.addAll(tm.serialize(Statement.class));
}
return m;
}
代码示例来源:origin: stackoverflow.com
// always use a ValueFactory, avoid instantiating URIImpl directly.
ValueFactory vf = ValueFactoryImpl().getInstance();
URI c = vf.createURI(C.getFullIRI());
URI prop = vf.createURI(property.getFullIRI())
// create a new Model for the resulting triple collection
Model result = new LinkedHashModel();
// filter on the supplied property
Model propMatches = triples.filter(null, prop, null);
for(Resource subject: propMatches.subjects()) {
// check if the selected subject is of the supplied type
if (triples.contains(subject, RDF.TYPE, c)) {
// add the type triple to the result
result.add(subject, RDF.TYPE, c);
// add the property triple(s) to the result
result.addAll(propMatches.filter(subject, null, null));
}
}
return result;
内容来源于网络,如有侵权,请联系作者删除!