-
Notifications
You must be signed in to change notification settings - Fork 11
/
types.go
44 lines (35 loc) · 960 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package triplestore
import (
"fmt"
"strings"
)
type XsdType string
var (
XsdString = XsdType("xsd:string")
XsdBoolean = XsdType("xsd:boolean")
XsdDateTime = XsdType("xsd:dateTime")
// 64-bit floating point numbers
XsdDouble = XsdType("xsd:double")
// 32-bit floating point numbers
XsdFloat = XsdType("xsd:float")
// signed 32 or 64 bit
XsdInteger = XsdType("xsd:integer")
// signed (8 bit)
XsdByte = XsdType("xsd:byte")
// signed (16 bit)
XsdShort = XsdType("xsd:short")
// unsigned 32 or 64 bit
XsdUinteger = XsdType("xsd:unsignedInt")
// unsigned 8 bit
XsdUnsignedByte = XsdType("xsd:unsignedByte")
// unsigned 16 bit
XsdUnsignedShort = XsdType("xsd:unsignedShort")
)
const XMLSchemaNamespace = "http://www.w3.org/2001/XMLSchema"
func (x XsdType) NTriplesNamespaced() string {
splits := strings.Split(string(x), ":")
if len(splits) != 2 {
return string(x)
}
return fmt.Sprintf("%s#%s", XMLSchemaNamespace, splits[1])
}