func uri_from_term(term *C.raptor_term) Term { ruri := *(**C.raptor_uri)(unsafe.Pointer(&term.value)) uristr := C.GoString((*C.char)(unsafe.Pointer(C.raptor_uri_as_string(ruri)))) uri := Uri(uristr) return &uri }
//for internal use only. callback from the C namespace handler for the parser //export GoRaptor_handle_namespace func GoRaptor_handle_namespace(user_data, nsp unsafe.Pointer) { parser := (*Parser)(user_data) ns := (*C.raptor_namespace)(nsp) cprefix := C.raptor_namespace_get_prefix(ns) curi := C.raptor_namespace_get_uri(ns) prefix := C.GoString((*C.char)(unsafe.Pointer(cprefix))) uri := C.GoString((*C.char)(unsafe.Pointer(C.raptor_uri_as_string(curi)))) parser.namespace_handler(prefix, uri) }
func literal_from_term(term *C.raptor_term) Term { literal := Literal{} lval := (*C.raptor_term_literal_value)(unsafe.Pointer(&term.value)) literal.Value = C.GoString((*C.char)(unsafe.Pointer(lval.string))) if int(lval.language_len) != 0 { literal.Lang = C.GoString((*C.char)(unsafe.Pointer(lval.language))) } if lval.datatype != nil { dtstr := C.raptor_uri_as_string(lval.datatype) literal.Datatype = C.GoString((*C.char)(unsafe.Pointer(dtstr))) } return &literal }