Documentation ¶
Overview ¶
Package pquads implements Cayley-specific protobuf-based quads format.
Index ¶
- Constants
- Variables
- func MarshalValue(v quad.Value) ([]byte, error)
- func UnmarshalValue(data []byte) (quad.Value, error)
- type Header
- type Options
- type Quad
- func (*Quad) Descriptor() ([]byte, []int)deprecated
- func (x *Quad) GetLabel() string
- func (x *Quad) GetLabelValue() *Value
- func (x *Quad) GetObject() string
- func (x *Quad) GetObjectValue() *Value
- func (x *Quad) GetPredicate() string
- func (x *Quad) GetPredicateValue() *Value
- func (x *Quad) GetSubject() string
- func (x *Quad) GetSubjectValue() *Value
- func (*Quad) ProtoMessage()
- func (x *Quad) ProtoReflect() protoreflect.Message
- func (x *Quad) Reset()
- func (x *Quad) String() string
- func (m *Quad) ToNative() (q quad.Quad)
- func (m *Quad) Upgrade()
- type Reader
- type StrictQuad
- func (*StrictQuad) Descriptor() ([]byte, []int)deprecated
- func (x *StrictQuad) GetLabel() *StrictQuad_Ref
- func (x *StrictQuad) GetObject() *Value
- func (x *StrictQuad) GetPredicate() *StrictQuad_Ref
- func (x *StrictQuad) GetSubject() *StrictQuad_Ref
- func (*StrictQuad) ProtoMessage()
- func (x *StrictQuad) ProtoReflect() protoreflect.Message
- func (x *StrictQuad) Reset()
- func (x *StrictQuad) String() string
- func (m *StrictQuad) ToNative() (q quad.Quad)
- type StrictQuadRaw
- func (*StrictQuadRaw) Descriptor() ([]byte, []int)deprecated
- func (x *StrictQuadRaw) GetLabel() []byte
- func (x *StrictQuadRaw) GetObject() []byte
- func (x *StrictQuadRaw) GetPredicate() []byte
- func (x *StrictQuadRaw) GetSubject() []byte
- func (*StrictQuadRaw) ProtoMessage()
- func (x *StrictQuadRaw) ProtoReflect() protoreflect.Message
- func (x *StrictQuadRaw) Reset()
- func (x *StrictQuadRaw) String() string
- type StrictQuad_Ref
- func (*StrictQuad_Ref) Descriptor() ([]byte, []int)deprecated
- func (x *StrictQuad_Ref) GetBnodeLabel() string
- func (x *StrictQuad_Ref) GetIri() string
- func (m *StrictQuad_Ref) GetValue() isStrictQuad_Ref_Value
- func (*StrictQuad_Ref) ProtoMessage()
- func (x *StrictQuad_Ref) ProtoReflect() protoreflect.Message
- func (x *StrictQuad_Ref) Reset()
- func (x *StrictQuad_Ref) String() string
- func (m *StrictQuad_Ref) ToNative() (qv quad.Value)
- type StrictQuad_Ref_BnodeLabel
- type StrictQuad_Ref_Iri
- type Value
- func (*Value) Descriptor() ([]byte, []int)deprecated
- func (x *Value) GetBnode() string
- func (x *Value) GetBoolean() bool
- func (x *Value) GetFloat() float64
- func (x *Value) GetInt() int64
- func (x *Value) GetIri() string
- func (x *Value) GetLangStr() *Value_LangString
- func (x *Value) GetRaw() []byte
- func (x *Value) GetStr() string
- func (x *Value) GetTime() *Value_Timestamp
- func (x *Value) GetTypedStr() *Value_TypedString
- func (m *Value) GetValue() isValue_Value
- func (*Value) ProtoMessage()
- func (x *Value) ProtoReflect() protoreflect.Message
- func (x *Value) Reset()
- func (x *Value) String() string
- func (m *Value) ToNative() (qv quad.Value)
- type Value_Bnode
- type Value_Boolean
- type Value_Float
- type Value_Int
- type Value_Iri
- type Value_LangStr
- type Value_LangString
- func (*Value_LangString) Descriptor() ([]byte, []int)deprecated
- func (x *Value_LangString) GetLang() string
- func (x *Value_LangString) GetValue() string
- func (*Value_LangString) ProtoMessage()
- func (x *Value_LangString) ProtoReflect() protoreflect.Message
- func (x *Value_LangString) Reset()
- func (x *Value_LangString) String() string
- type Value_Raw
- type Value_Str
- type Value_Time
- type Value_Timestamp
- func (*Value_Timestamp) Descriptor() ([]byte, []int)deprecated
- func (x *Value_Timestamp) GetNanos() int32
- func (x *Value_Timestamp) GetSeconds() int64
- func (*Value_Timestamp) ProtoMessage()
- func (x *Value_Timestamp) ProtoReflect() protoreflect.Message
- func (x *Value_Timestamp) Reset()
- func (x *Value_Timestamp) String() string
- type Value_TypedStr
- type Value_TypedString
- func (*Value_TypedString) Descriptor() ([]byte, []int)deprecated
- func (x *Value_TypedString) GetType() string
- func (x *Value_TypedString) GetValue() string
- func (*Value_TypedString) ProtoMessage()
- func (x *Value_TypedString) ProtoReflect() protoreflect.Message
- func (x *Value_TypedString) Reset()
- func (x *Value_TypedString) String() string
- type WireQuad
- func (*WireQuad) Descriptor() ([]byte, []int)deprecated
- func (x *WireQuad) GetLabel() *Value
- func (x *WireQuad) GetObject() *Value
- func (x *WireQuad) GetPredicate() *Value
- func (x *WireQuad) GetSubject() *Value
- func (*WireQuad) ProtoMessage()
- func (x *WireQuad) ProtoReflect() protoreflect.Message
- func (x *WireQuad) Reset()
- func (x *WireQuad) String() string
- func (m *WireQuad) ToNative() (q quad.Quad)
- type WireQuadRaw
- func (*WireQuadRaw) Descriptor() ([]byte, []int)deprecated
- func (x *WireQuadRaw) GetLabel() []byte
- func (x *WireQuadRaw) GetObject() []byte
- func (x *WireQuadRaw) GetPredicate() []byte
- func (x *WireQuadRaw) GetSubject() []byte
- func (*WireQuadRaw) ProtoMessage()
- func (x *WireQuadRaw) ProtoReflect() protoreflect.Message
- func (x *WireQuadRaw) Reset()
- func (x *WireQuadRaw) String() string
- type Writer
Constants ¶
const ContentType = "application/x-protobuf"
Variables ¶
var DefaultMaxSize = 1024 * 1024
var File_quads_proto protoreflect.FileDescriptor
Functions ¶
func MarshalValue ¶
MarshalValue is a helper for serialization of quad.Value.
Types ¶
type Header ¶
type Header struct { // Full is set if encoder always writes every quad directions instead of // skipping duplicated values on each direction (except label) for subsequent quads. Full bool `protobuf:"varint,1,opt,name=full,proto3" json:"full,omitempty"` // NotStrict is set if encoder emits WireQuad instead of StrictQuad messages. NotStrict bool `protobuf:"varint,2,opt,name=not_strict,json=notStrict,proto3" json:"not_strict,omitempty"` // contains filtered or unexported fields }
func (*Header) Descriptor
deprecated
func (*Header) GetNotStrict ¶
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (*Header) ProtoReflect ¶
func (x *Header) ProtoReflect() protoreflect.Message
type Quad ¶
type Quad struct { Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` Predicate string `protobuf:"bytes,2,opt,name=predicate,proto3" json:"predicate,omitempty"` Object string `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"` Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"` SubjectValue *Value `protobuf:"bytes,5,opt,name=subject_value,json=subjectValue,proto3" json:"subject_value,omitempty"` PredicateValue *Value `protobuf:"bytes,6,opt,name=predicate_value,json=predicateValue,proto3" json:"predicate_value,omitempty"` ObjectValue *Value `protobuf:"bytes,7,opt,name=object_value,json=objectValue,proto3" json:"object_value,omitempty"` LabelValue *Value `protobuf:"bytes,8,opt,name=label_value,json=labelValue,proto3" json:"label_value,omitempty"` // contains filtered or unexported fields }
Quad is in internal representation of quad used by Cayley.
func (*Quad) Descriptor
deprecated
func (*Quad) GetLabelValue ¶
func (*Quad) GetObjectValue ¶
func (*Quad) GetPredicate ¶
func (*Quad) GetPredicateValue ¶
func (*Quad) GetSubject ¶
func (*Quad) GetSubjectValue ¶
func (*Quad) ProtoMessage ¶
func (*Quad) ProtoMessage()
func (*Quad) ProtoReflect ¶
func (x *Quad) ProtoReflect() protoreflect.Message
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
type StrictQuad ¶
type StrictQuad struct { Subject *StrictQuad_Ref `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` Predicate *StrictQuad_Ref `protobuf:"bytes,2,opt,name=predicate,proto3" json:"predicate,omitempty"` Object *Value `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"` Label *StrictQuad_Ref `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"` // contains filtered or unexported fields }
StrictQuad is a quad as described by RDF spec.
func (*StrictQuad) Descriptor
deprecated
func (*StrictQuad) Descriptor() ([]byte, []int)
Deprecated: Use StrictQuad.ProtoReflect.Descriptor instead.
func (*StrictQuad) GetLabel ¶
func (x *StrictQuad) GetLabel() *StrictQuad_Ref
func (*StrictQuad) GetObject ¶
func (x *StrictQuad) GetObject() *Value
func (*StrictQuad) GetPredicate ¶
func (x *StrictQuad) GetPredicate() *StrictQuad_Ref
func (*StrictQuad) GetSubject ¶
func (x *StrictQuad) GetSubject() *StrictQuad_Ref
func (*StrictQuad) ProtoMessage ¶
func (*StrictQuad) ProtoMessage()
func (*StrictQuad) ProtoReflect ¶
func (x *StrictQuad) ProtoReflect() protoreflect.Message
func (*StrictQuad) Reset ¶
func (x *StrictQuad) Reset()
func (*StrictQuad) String ¶
func (x *StrictQuad) String() string
func (*StrictQuad) ToNative ¶
func (m *StrictQuad) ToNative() (q quad.Quad)
ToNative converts protobuf StrictQuad to quad.Quad.
type StrictQuadRaw ¶
type StrictQuadRaw struct { Subject []byte `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` Predicate []byte `protobuf:"bytes,2,opt,name=predicate,proto3" json:"predicate,omitempty"` Object []byte `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"` Label []byte `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"` // contains filtered or unexported fields }
StrictQuadRaw is the same as StrictQuad, but doesn't decode underlying values.
func (*StrictQuadRaw) Descriptor
deprecated
func (*StrictQuadRaw) Descriptor() ([]byte, []int)
Deprecated: Use StrictQuadRaw.ProtoReflect.Descriptor instead.
func (*StrictQuadRaw) GetLabel ¶
func (x *StrictQuadRaw) GetLabel() []byte
func (*StrictQuadRaw) GetObject ¶
func (x *StrictQuadRaw) GetObject() []byte
func (*StrictQuadRaw) GetPredicate ¶
func (x *StrictQuadRaw) GetPredicate() []byte
func (*StrictQuadRaw) GetSubject ¶
func (x *StrictQuadRaw) GetSubject() []byte
func (*StrictQuadRaw) ProtoMessage ¶
func (*StrictQuadRaw) ProtoMessage()
func (*StrictQuadRaw) ProtoReflect ¶
func (x *StrictQuadRaw) ProtoReflect() protoreflect.Message
func (*StrictQuadRaw) Reset ¶
func (x *StrictQuadRaw) Reset()
func (*StrictQuadRaw) String ¶
func (x *StrictQuadRaw) String() string
type StrictQuad_Ref ¶
type StrictQuad_Ref struct { // Types that are assignable to Value: // // *StrictQuad_Ref_BnodeLabel // *StrictQuad_Ref_Iri Value isStrictQuad_Ref_Value `protobuf_oneof:"value"` // contains filtered or unexported fields }
func (*StrictQuad_Ref) Descriptor
deprecated
func (*StrictQuad_Ref) Descriptor() ([]byte, []int)
Deprecated: Use StrictQuad_Ref.ProtoReflect.Descriptor instead.
func (*StrictQuad_Ref) GetBnodeLabel ¶
func (x *StrictQuad_Ref) GetBnodeLabel() string
func (*StrictQuad_Ref) GetIri ¶
func (x *StrictQuad_Ref) GetIri() string
func (*StrictQuad_Ref) GetValue ¶
func (m *StrictQuad_Ref) GetValue() isStrictQuad_Ref_Value
func (*StrictQuad_Ref) ProtoMessage ¶
func (*StrictQuad_Ref) ProtoMessage()
func (*StrictQuad_Ref) ProtoReflect ¶
func (x *StrictQuad_Ref) ProtoReflect() protoreflect.Message
func (*StrictQuad_Ref) Reset ¶
func (x *StrictQuad_Ref) Reset()
func (*StrictQuad_Ref) String ¶
func (x *StrictQuad_Ref) String() string
func (*StrictQuad_Ref) ToNative ¶
func (m *StrictQuad_Ref) ToNative() (qv quad.Value)
ToNative converts protobuf Value to quad.Value.
type StrictQuad_Ref_BnodeLabel ¶
type StrictQuad_Ref_BnodeLabel struct {
BnodeLabel string `protobuf:"bytes,2,opt,name=bnode_label,json=bnodeLabel,proto3,oneof"`
}
type StrictQuad_Ref_Iri ¶
type StrictQuad_Ref_Iri struct {
Iri string `protobuf:"bytes,3,opt,name=iri,proto3,oneof"`
}
type Value ¶
type Value struct { // Types that are assignable to Value: // // *Value_Raw // *Value_Str // *Value_Iri // *Value_Bnode // *Value_TypedStr // *Value_LangStr // *Value_Int // *Value_Float // *Value_Boolean // *Value_Time Value isValue_Value `protobuf_oneof:"value"` // contains filtered or unexported fields }
func (*Value) Descriptor
deprecated
func (*Value) GetBoolean ¶
func (*Value) GetLangStr ¶
func (x *Value) GetLangStr() *Value_LangString
func (*Value) GetTime ¶
func (x *Value) GetTime() *Value_Timestamp
func (*Value) GetTypedStr ¶
func (x *Value) GetTypedStr() *Value_TypedString
func (*Value) ProtoMessage ¶
func (*Value) ProtoMessage()
func (*Value) ProtoReflect ¶
func (x *Value) ProtoReflect() protoreflect.Message
type Value_Bnode ¶
type Value_Bnode struct {
Bnode string `protobuf:"bytes,4,opt,name=bnode,proto3,oneof"`
}
type Value_Boolean ¶
type Value_Boolean struct {
Boolean bool `protobuf:"varint,9,opt,name=boolean,proto3,oneof"`
}
type Value_Float ¶
type Value_Float struct {
Float float64 `protobuf:"fixed64,8,opt,name=float,proto3,oneof"`
}
type Value_Int ¶
type Value_Int struct {
Int int64 `protobuf:"varint,7,opt,name=int,proto3,oneof"`
}
type Value_Iri ¶
type Value_Iri struct {
Iri string `protobuf:"bytes,3,opt,name=iri,proto3,oneof"`
}
type Value_LangStr ¶
type Value_LangStr struct {
LangStr *Value_LangString `protobuf:"bytes,6,opt,name=lang_str,json=langStr,proto3,oneof"`
}
type Value_LangString ¶
type Value_LangString struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` Lang string `protobuf:"bytes,2,opt,name=lang,proto3" json:"lang,omitempty"` // contains filtered or unexported fields }
func (*Value_LangString) Descriptor
deprecated
func (*Value_LangString) Descriptor() ([]byte, []int)
Deprecated: Use Value_LangString.ProtoReflect.Descriptor instead.
func (*Value_LangString) GetLang ¶
func (x *Value_LangString) GetLang() string
func (*Value_LangString) GetValue ¶
func (x *Value_LangString) GetValue() string
func (*Value_LangString) ProtoMessage ¶
func (*Value_LangString) ProtoMessage()
func (*Value_LangString) ProtoReflect ¶
func (x *Value_LangString) ProtoReflect() protoreflect.Message
func (*Value_LangString) Reset ¶
func (x *Value_LangString) Reset()
func (*Value_LangString) String ¶
func (x *Value_LangString) String() string
type Value_Raw ¶
type Value_Raw struct {
Raw []byte `protobuf:"bytes,1,opt,name=raw,proto3,oneof"`
}
type Value_Str ¶
type Value_Str struct {
Str string `protobuf:"bytes,2,opt,name=str,proto3,oneof"`
}
type Value_Time ¶
type Value_Time struct {
Time *Value_Timestamp `protobuf:"bytes,10,opt,name=time,proto3,oneof"`
}
type Value_Timestamp ¶
type Value_Timestamp struct { Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` // contains filtered or unexported fields }
From https://github.com/golang/protobuf/blob/master/ptypes/timestamp/timestamp.proto
func (*Value_Timestamp) Descriptor
deprecated
func (*Value_Timestamp) Descriptor() ([]byte, []int)
Deprecated: Use Value_Timestamp.ProtoReflect.Descriptor instead.
func (*Value_Timestamp) GetNanos ¶
func (x *Value_Timestamp) GetNanos() int32
func (*Value_Timestamp) GetSeconds ¶
func (x *Value_Timestamp) GetSeconds() int64
func (*Value_Timestamp) ProtoMessage ¶
func (*Value_Timestamp) ProtoMessage()
func (*Value_Timestamp) ProtoReflect ¶
func (x *Value_Timestamp) ProtoReflect() protoreflect.Message
func (*Value_Timestamp) Reset ¶
func (x *Value_Timestamp) Reset()
func (*Value_Timestamp) String ¶
func (x *Value_Timestamp) String() string
type Value_TypedStr ¶
type Value_TypedStr struct {
TypedStr *Value_TypedString `protobuf:"bytes,5,opt,name=typed_str,json=typedStr,proto3,oneof"`
}
type Value_TypedString ¶
type Value_TypedString struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Value_TypedString) Descriptor
deprecated
func (*Value_TypedString) Descriptor() ([]byte, []int)
Deprecated: Use Value_TypedString.ProtoReflect.Descriptor instead.
func (*Value_TypedString) GetType ¶
func (x *Value_TypedString) GetType() string
func (*Value_TypedString) GetValue ¶
func (x *Value_TypedString) GetValue() string
func (*Value_TypedString) ProtoMessage ¶
func (*Value_TypedString) ProtoMessage()
func (*Value_TypedString) ProtoReflect ¶
func (x *Value_TypedString) ProtoReflect() protoreflect.Message
func (*Value_TypedString) Reset ¶
func (x *Value_TypedString) Reset()
func (*Value_TypedString) String ¶
func (x *Value_TypedString) String() string
type WireQuad ¶
type WireQuad struct { Subject *Value `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` Predicate *Value `protobuf:"bytes,2,opt,name=predicate,proto3" json:"predicate,omitempty"` Object *Value `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"` Label *Value `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"` // contains filtered or unexported fields }
WireQuad is a quad that allows any value for it's directions.
func (*WireQuad) Descriptor
deprecated
func (*WireQuad) GetPredicate ¶
func (*WireQuad) GetSubject ¶
func (*WireQuad) ProtoMessage ¶
func (*WireQuad) ProtoMessage()
func (*WireQuad) ProtoReflect ¶
func (x *WireQuad) ProtoReflect() protoreflect.Message
type WireQuadRaw ¶
type WireQuadRaw struct { Subject []byte `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` Predicate []byte `protobuf:"bytes,2,opt,name=predicate,proto3" json:"predicate,omitempty"` Object []byte `protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty"` Label []byte `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"` // contains filtered or unexported fields }
WireQuadRaw is the same as WireQuad, but doesn't decode underlying values.
func (*WireQuadRaw) Descriptor
deprecated
func (*WireQuadRaw) Descriptor() ([]byte, []int)
Deprecated: Use WireQuadRaw.ProtoReflect.Descriptor instead.
func (*WireQuadRaw) GetLabel ¶
func (x *WireQuadRaw) GetLabel() []byte
func (*WireQuadRaw) GetObject ¶
func (x *WireQuadRaw) GetObject() []byte
func (*WireQuadRaw) GetPredicate ¶
func (x *WireQuadRaw) GetPredicate() []byte
func (*WireQuadRaw) GetSubject ¶
func (x *WireQuadRaw) GetSubject() []byte
func (*WireQuadRaw) ProtoMessage ¶
func (*WireQuadRaw) ProtoMessage()
func (*WireQuadRaw) ProtoReflect ¶
func (x *WireQuadRaw) ProtoReflect() protoreflect.Message
func (*WireQuadRaw) Reset ¶
func (x *WireQuadRaw) Reset()
func (*WireQuadRaw) String ¶
func (x *WireQuadRaw) String() string