本文整理汇总了Java中com.hp.hpl.jena.vocabulary.XSD.xdouble方法的典型用法代码示例。如果您正苦于以下问题:Java XSD.xdouble方法的具体用法?Java XSD.xdouble怎么用?Java XSD.xdouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hp.hpl.jena.vocabulary.XSD
的用法示例。
在下文中一共展示了XSD.xdouble方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLiteralType
import com.hp.hpl.jena.vocabulary.XSD; //导入方法依赖的package包/类
private Resource getLiteralType(Node lit_obj){
RDFNode n = Commons.asRDFNode(lit_obj);
Literal lt = (Literal) n;
if (((Literal)n).getDatatype() != null){
return ModelFactory.createDefaultModel().createResource(lt.getDatatype().getURI());
} else {
if (lt.getValue() instanceof Byte) return XSD.xbyte;
else if (lt.getValue() instanceof Boolean) return XSD.xboolean;
else if (lt.getValue() instanceof Short) return XSD.xshort;
else if (lt.getValue() instanceof Integer) return XSD.xint;
else if (lt.getValue() instanceof Long) return XSD.xlong;
else if (lt.getValue() instanceof Float) return XSD.xfloat;
else if (lt.getValue() instanceof Double) return XSD.xdouble;
else if (lt.getValue() instanceof String) return XSD.xstring;
else return RDFS.Literal;
}
}
示例2: getLiteralType
import com.hp.hpl.jena.vocabulary.XSD; //导入方法依赖的package包/类
private Resource getLiteralType(Node lit_obj){
RDFNode n = Commons.asRDFNode(lit_obj);
if (((Literal)n).getDatatype() != null){
return ModelFactory.createDefaultModel().createResource(lit_obj.getLiteralDatatype().getURI());
} else {
Literal lt = (Literal) n;
if (lt.getValue() instanceof Double) return XSD.xdouble;
else if (lt.getValue() instanceof Integer) return XSD.xint;
else if (lt.getValue() instanceof Boolean) return XSD.xboolean;
else if (lt.getValue() instanceof String) return XSD.xstring;
else if (lt.getValue() instanceof Float) return XSD.xfloat;
else if (lt.getValue() instanceof Short) return XSD.xshort;
else if (lt.getValue() instanceof Long) return XSD.xlong;
else if (lt.getValue() instanceof Byte) return XSD.xbyte;
else return RDFS.Literal;
}
}
示例3: getSadlPrimitiveDataTypeResource
import com.hp.hpl.jena.vocabulary.XSD; //导入方法依赖的package包/类
private com.hp.hpl.jena.rdf.model.Resource getSadlPrimitiveDataTypeResource(SadlPrimitiveDataType sadlTypeRef)
throws JenaProcessorException {
SadlDataType pt = sadlTypeRef.getPrimitiveType();
String typeStr = pt.getLiteral();
com.hp.hpl.jena.rdf.model.Resource onDatatype;
if (typeStr.equals(XSD.xstring.getLocalName()))
onDatatype = XSD.xstring;
else if (typeStr.equals(XSD.anyURI.getLocalName()))
onDatatype = XSD.anyURI;
else if (typeStr.equals(XSD.base64Binary.getLocalName()))
onDatatype = XSD.base64Binary;
else if (typeStr.equals(XSD.xbyte.getLocalName()))
onDatatype = XSD.xbyte;
else if (typeStr.equals(XSD.date.getLocalName()))
onDatatype = XSD.date;
else if (typeStr.equals(XSD.dateTime.getLocalName()))
onDatatype = XSD.dateTime;
else if (typeStr.equals(XSD.decimal.getLocalName()))
onDatatype = XSD.decimal;
else if (typeStr.equals(XSD.duration.getLocalName()))
onDatatype = XSD.duration;
else if (typeStr.equals(XSD.gDay.getLocalName()))
onDatatype = XSD.gDay;
else if (typeStr.equals(XSD.gMonth.getLocalName()))
onDatatype = XSD.gMonth;
else if (typeStr.equals(XSD.gMonthDay.getLocalName()))
onDatatype = XSD.gMonthDay;
else if (typeStr.equals(XSD.gYear.getLocalName()))
onDatatype = XSD.gYear;
else if (typeStr.equals(XSD.gYearMonth.getLocalName()))
onDatatype = XSD.gYearMonth;
else if (typeStr.equals(XSD.hexBinary.getLocalName()))
onDatatype = XSD.hexBinary;
else if (typeStr.equals(XSD.integer.getLocalName()))
onDatatype = XSD.integer;
else if (typeStr.equals(XSD.time.getLocalName()))
onDatatype = XSD.time;
else if (typeStr.equals(XSD.xboolean.getLocalName()))
onDatatype = XSD.xboolean;
else if (typeStr.equals(XSD.xdouble.getLocalName()))
onDatatype = XSD.xdouble;
else if (typeStr.equals(XSD.xfloat.getLocalName()))
onDatatype = XSD.xfloat;
else if (typeStr.equals(XSD.xint.getLocalName()))
onDatatype = XSD.xint;
else if (typeStr.equals(XSD.xlong.getLocalName()))
onDatatype = XSD.xlong;
else if (typeStr.equals(XSD.anyURI.getLocalName()))
onDatatype = XSD.anyURI;
else if (typeStr.equals(XSD.anyURI.getLocalName()))
onDatatype = XSD.anyURI;
else {
throw new JenaProcessorException("Unexpected primitive data type: " + typeStr);
}
return onDatatype;
}