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


Java XSD.integer方法代码示例

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


在下文中一共展示了XSD.integer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getXsdDataType

import com.hp.hpl.jena.vocabulary.XSD; //导入方法依赖的package包/类
public Resource getXsdDataType(IfcLiteralTypeInfo literalTypeInfo) {
	switch (literalTypeInfo.getName()) {
	
	case IfcVocabulary.TypeNames.BINARY32:
		return XSD.nonNegativeInteger;
		
	case IfcVocabulary.TypeNames.INTEGER:
		return XSD.integer;
		
	case IfcVocabulary.TypeNames.BOOLEAN:
	case IfcVocabulary.TypeNames.LOGICAL:
		return context.isEnabledOption(Ifc2RdfConversionOptionsEnum.ForceConvertBooleanValuesToString) ?
				XSD.xstring : XSD.xboolean;
		
	case IfcVocabulary.TypeNames.NUMBER:
	case IfcVocabulary.TypeNames.REAL:
		return XSD.decimal;
		
	case IfcVocabulary.TypeNames.DATETIME:
		return XSD.dateTime;
		
	case IfcVocabulary.TypeNames.GUID:
		return XSD.NMTOKEN;
		
	case IfcVocabulary.TypeNames.STRING:
	default:
		return XSD.xstring;
		
	}
}
 
开发者ID:Web-of-Building-Data,项目名称:Ifc2Rdf,代码行数:31,代码来源:Ifc2RdfExporterBase.java

示例2: getXsdDataType

import com.hp.hpl.jena.vocabulary.XSD; //导入方法依赖的package包/类
public Resource getXsdDataType(IfcLiteralTypeInfo literalTypeInfo) {
		switch (literalTypeInfo.getName()) {
		
		case IfcVocabulary.TypeNames.BINARY:			
//			return XSD.nonNegativeInteger;
			return XSD.hexBinary;
			
		case IfcVocabulary.TypeNames.INTEGER:
			return XSD.integer;
			
		case IfcVocabulary.TypeNames.BOOLEAN:
		case IfcVocabulary.TypeNames.LOGICAL:
			return context.isEnabledOption(Ifc2RdfConversionOptionsEnum.ForceConvertBooleanValuesToString) ?
					XSD.xstring : XSD.xboolean;
			
		case IfcVocabulary.TypeNames.NUMBER:
		case IfcVocabulary.TypeNames.REAL:			
			return XSD.decimal;
//			return XSD.xdouble;			
			
		case IfcVocabulary.TypeNames.DATETIME:
			return XSD.dateTime;
			
		// TODO: Remove GUID
		case IfcVocabulary.TypeNames.GUID:
//			return XSD.NMTOKEN;
			return XSD.xstring;
			
		case IfcVocabulary.TypeNames.STRING:
		default:
			return XSD.xstring;
			
		}
	}
 
开发者ID:Web-of-Building-Data,项目名称:Ifc2Rdf,代码行数:35,代码来源:Ifc2RdfExporterBase.java

示例3: processObjectNode

import com.hp.hpl.jena.vocabulary.XSD; //导入方法依赖的package包/类
private Object processObjectNode(Object pred, String token, int modelArrayPosition) throws Exception {
	if (pred.equals("is")) {
		// special case
		return processNode(token, modelArrayPosition);
	}
	else if (pred instanceof ConceptName && ((ConceptName)pred).getUri().equals(RDFS.range.getURI())) {
		if (token.equals("string")) {
			return XSD.xstring;
		}
		else if (token.equals("boolean")) { 
			return XSD.xboolean;
		}
		else if (token.equals("decimal")) { 
			return XSD.decimal;
		}
		else if (token.equals("integer")) { 
			return XSD.integer;
		}
		else if (token.equals("dateTime")) { 
			return XSD.dateTime;
		}
		else if (token.equals("time")) { 
			return XSD.time;
		}
		else if (token.equals("date")) { 
			return XSD.date;
		}
		else if (token.equals("hexBinary")) { 
			return XSD.hexBinary;
		}
		else if (token.equals("base64Binary")) { 
			return XSD.base64Binary;
		}
		else if (token.equals("anyURI")) { 
			return XSD.anyURI;
		}
	}
	if (pred instanceof ConceptName) {
		boolean tokenContainsVariable = tokenContainsVariable(token);
		//			if (token.contains("<") && token.contains(">")) {
		//				tokenContainsVariable = true;
		//			}
		if (!tokenContainsVariable && ((ConceptName)pred).getType().equals(ConceptType.DATATYPEPROPERTY)) {
			// the predicate was found in the model so check its range
			OntProperty prop = getModel(modelArrayPosition).getOntProperty(((ConceptName)pred).getUri());
			Literal val = UtilsForJena.getLiteralMatchingDataPropertyRange(getModel(modelArrayPosition), prop, token);
			return val;
		}
		else {
			// it's an ObjectProperty
			return processNode(token, modelArrayPosition);
		}
	}
	else if (pred instanceof Variable) {
		return processNode(token, modelArrayPosition);
	}
	else {
		throw new TranslationException("Triple predicate of unhandled type: " + pred.toString());
	}
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:61,代码来源:CsvImporter.java

示例4: processObjectNode

import com.hp.hpl.jena.vocabulary.XSD; //导入方法依赖的package包/类
private Object processObjectNode(Object pred, String token, int modelArrayPosition) throws Exception {
	if (pred.equals("is")) {
		// special case
		return processNode(token, modelArrayPosition);
	}
	else if (pred instanceof ConceptName && ((ConceptName)pred).getUri().equals(RDFS.range.getURI())) {
		if (token.equals("string")) {
			return XSD.xstring;
		}
		else if (token.equals("boolean")) { 
			return XSD.xboolean;
		}
		else if (token.equals("decimal")) { 
			return XSD.decimal;
		}
		else if (token.equals("integer")) { 
			return XSD.integer;
		}
		else if (token.equals("dateTime")) { 
			return XSD.dateTime;
		}
		else if (token.equals("time")) { 
			return XSD.time;
		}
		else if (token.equals("date")) { 
			return XSD.date;
		}
		else if (token.equals("hexBinary")) { 
			return XSD.hexBinary;
		}
		else if (token.equals("base64Binary")) { 
			return XSD.base64Binary;
		}
		else if (token.equals("anyURI")) { 
			return XSD.anyURI;
		}
	}
	if (pred instanceof ConceptName) {
		boolean tokenContainsVariable = tokenContainsVariable(token);
		//			if (token.contains("<") && token.contains(">")) {
		//				tokenContainsVariable = true;
		//			}
		if (!tokenContainsVariable && ((ConceptName)pred).getType().equals(ConceptType.DATATYPEPROPERTY)) {
			// the predicate was found in the model so check its range
			OntProperty prop = getModel(modelArrayPosition).getOntProperty(((ConceptName)pred).getUri());
			Literal val = SadlUtils.getLiteralMatchingDataPropertyRange(getModel(modelArrayPosition), prop, token);
			return val;
		}
		else {
			// it's an ObjectProperty
			return processNode(token, modelArrayPosition);
		}
	}
	else if (pred instanceof Variable) {
		return processNode(token, modelArrayPosition);
	}
	else {
		throw new TranslationException("Triple predicate of unhandled type: " + pred.toString());
	}
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:61,代码来源:CsvImporter.java

示例5: 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.integer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。