本文整理汇总了Java中com.hp.hpl.jena.vocabulary.XSD.hexBinary方法的典型用法代码示例。如果您正苦于以下问题:Java XSD.hexBinary方法的具体用法?Java XSD.hexBinary怎么用?Java XSD.hexBinary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hp.hpl.jena.vocabulary.XSD
的用法示例。
在下文中一共展示了XSD.hexBinary方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
}
示例2: 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());
}
}
示例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 = 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());
}
}
示例4: 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;
}