本文整理汇总了Java中org.apache.jena.rdf.model.ResourceFactory.createPlainLiteral方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceFactory.createPlainLiteral方法的具体用法?Java ResourceFactory.createPlainLiteral怎么用?Java ResourceFactory.createPlainLiteral使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jena.rdf.model.ResourceFactory
的用法示例。
在下文中一共展示了ResourceFactory.createPlainLiteral方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toLiteral
import org.apache.jena.rdf.model.ResourceFactory; //导入方法依赖的package包/类
private Literal toLiteral(Object value) {
if (value instanceof String) {
return ResourceFactory.createPlainLiteral(value.toString());
}
if (value instanceof Double) {
return ResourceFactory.createTypedLiteral(value.toString(), XSDDatatype.XSDdouble);
}
throw new IllegalArgumentException();
}
示例2: toLiteral
import org.apache.jena.rdf.model.ResourceFactory; //导入方法依赖的package包/类
public static Literal toLiteral(Object value) {
if (value instanceof String) {
return ResourceFactory.createPlainLiteral(value.toString());
}
if (value instanceof Double) {
return ResourceFactory.createTypedLiteral(value.toString(),
XSDDatatype.XSDdouble);
}
throw new IllegalArgumentException();
}
示例3: createPlainLiteral
import org.apache.jena.rdf.model.ResourceFactory; //导入方法依赖的package包/类
/**
*
* @param label
* @return
*/
@Override
public RDFNode createPlainLiteral( final String label )
{
return ResourceFactory.createPlainLiteral( label );
}
示例4: nodeFor
import org.apache.jena.rdf.model.ResourceFactory; //导入方法依赖的package包/类
private RDFNode nodeFor(String s) {
return ResourceFactory.createPlainLiteral(s);
}
示例5: shouldConvertStringLiteralsToNodes
import org.apache.jena.rdf.model.ResourceFactory; //导入方法依赖的package包/类
@Test
public void shouldConvertStringLiteralsToNodes() {
final String uri = "fedora:resource";
final Literal URIRES = ResourceFactory.createPlainLiteral(uri);
assertEquals(URIRES.asNode(), testObj.asLiteralStringNode(uri));
}