当前位置: 首页>>代码示例>>Java>>正文


Java XSD.xlong方法代码示例

本文整理汇总了Java中com.hp.hpl.jena.vocabulary.XSD.xlong方法的典型用法代码示例。如果您正苦于以下问题:Java XSD.xlong方法的具体用法?Java XSD.xlong怎么用?Java XSD.xlong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.hp.hpl.jena.vocabulary.XSD的用法示例。


在下文中一共展示了XSD.xlong方法的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;
	}
}
 
开发者ID:diachron,项目名称:quality,代码行数:19,代码来源:UsageOfIncorrectDomainOrRangeDatatypes.java

示例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;
	}
}
 
开发者ID:diachron,项目名称:quality,代码行数:19,代码来源:PredicateClusteringIndexing.java

示例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;
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:57,代码来源:JenaBasedSadlModelProcessor.java


注:本文中的com.hp.hpl.jena.vocabulary.XSD.xlong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。