示例#1
0
文件: ast.go 项目: kierdavis/argo
func (expr BooleanConstant) ToRDF(graph *argo.Graph) (term argo.Term) {
	if expr {
		return argo.NewLiteralWithDatatype("true", argo.XSD.Get("boolean"))
	}

	return argo.NewLiteralWithDatatype("false", argo.XSD.Get("boolean"))
}
示例#2
0
文件: ast.go 项目: kierdavis/argo
func (expr IntegerConstant) ToRDF(graph *argo.Graph) (term argo.Term) {
	return argo.NewLiteralWithDatatype(fmt.Sprintf("%d", float64(expr)), argo.XSD.Get("integer"))
}
示例#3
0
文件: ast.go 项目: kierdavis/argo
func (expr FloatConstant) ToRDF(graph *argo.Graph) (term argo.Term) {
	return argo.NewLiteralWithDatatype(fmt.Sprintf("%f", float64(expr)), argo.XSD.Get("double"))
}
示例#4
0
文件: ast.go 项目: kierdavis/argo
func (expr DataConstant) ToRDF(graph *argo.Graph) (term argo.Term) {
	return argo.NewLiteralWithDatatype(base64.StdEncoding.EncodeToString([]byte(expr)), argo.XSD.Get("base64Binary"))
}