本文整理汇总了Java中org.apache.clerezza.commons.rdf.impl.utils.TripleImpl类的典型用法代码示例。如果您正苦于以下问题:Java TripleImpl类的具体用法?Java TripleImpl怎么用?Java TripleImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TripleImpl类属于org.apache.clerezza.commons.rdf.impl.utils包,在下文中一共展示了TripleImpl类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRelevantDescription
import org.apache.clerezza.commons.rdf.impl.utils.TripleImpl; //导入依赖的package包/类
private void addRelevantDescription(GraphNode cgContent, Graph resultGraph, boolean withContent) {
Lock l = cgContent.readLock();
l.lock();
try {
Iterator<Literal> valueIter = cgContent.getLiterals(SIOC.content);
//if (!withContent) {
while (valueIter.hasNext()) {
final Literal valueLit = valueIter.next();
final String textualContent = valueLit.getLexicalForm();
final String preview = textualContent.substring(
0, Math.min(PREVIEW_LENGTH, textualContent.length()))
.replace('\n', ' ')
.replace("\r", "");
Language language = valueLit.getLanguage();
resultGraph.add(new TripleImpl((BlankNodeOrIRI) cgContent.getNode(), ECS.textPreview,
new PlainLiteralImpl(preview, language)));
}
//}
copyProperties(cgContent, resultGraph, DCTERMS.title, DCTERMS.abstract_,
RDFS.comment, DC.description, MEDIA_TITLE);
if (withContent) {
copyProperties(cgContent, resultGraph, SIOC.content);
}
} finally {
l.unlock();
}
}
示例2: copyProperties
import org.apache.clerezza.commons.rdf.impl.utils.TripleImpl; //导入依赖的package包/类
private void copyProperties(GraphNode fromNode, Graph toGraph, IRI... properties) {
for (IRI property : properties) {
Iterator<RDFTerm> objects = fromNode.getObjects(property);
while (objects.hasNext()) {
RDFTerm object = objects.next();
toGraph.add(new TripleImpl((BlankNodeOrIRI) fromNode.getNode(),
property, object));
}
}
}