Documentation
¶
Overview ¶
Package api defines the API used by the client and server component. Serialization and marshalling to protobuf is done in the 'proto' package
Index ¶
Constants ¶
const (
DEFAULT_ITEM_TYPE = "http://schema.org/Thing"
)
Variables ¶
var ( ErrUnimplemented = fmt.Errorf("Unimplemented.") ErrInvalidItem = fmt.Errorf("Invalid item") )
Functions ¶
func ExpandCurie ¶
Expandeds a CURIE (e.g. <schema:Person> or foaf:name) into a qualified name, e.g. https://schema.org/Person
Types ¶
type ErrInvalidAuthMethod ¶
type ErrInvalidAuthMethod struct {
Method string
}
func (ErrInvalidAuthMethod) Error ¶
func (e ErrInvalidAuthMethod) Error() string
type ErrInvalidScheme ¶
type ErrInvalidScheme struct {
Scheme string
}
func (ErrInvalidScheme) Error ¶
func (e ErrInvalidScheme) Error() string
type ErrInvalidUri ¶
type ErrInvalidUri struct {
Uri string
}
func (ErrInvalidUri) Error ¶
func (e ErrInvalidUri) Error() string
type IRI ¶
type IRI string
IRI: An Internationalized Resource Identifier, similar to a URI https://tools.ietf.org/html/rfc3987
func GetTypeFromStatements ¶
func NormalizeIri ¶
Ensure that a URL is valid, returning it as a url.URL object
Normalization also performs the following:
- Expansion of Compact URIs (CURIEs) Both '<schema:Book>' and 'schema:Book' are permitted The list of namespace prefixes supported can be retrieved via GetNamespacePrefixes() (or ltpcli list namespaces) See: https://lov.linkeddata.es/dataset/lov/
type Item ¶
func NewItem ¶
Used by the CreateItem implementation, or anywhere that the Item model is used. Does not assign a URL, or commit to the store.
func (*Item) AddProperty ¶
AddProperty: Append a property=value pair to an item Example:
i.AddProperty(IRI("schema:name"), String("Transformers"))
func (*Item) AddStatement ¶
AddStatement: Append a statement (s,p,o,l) to an item
func (Item) AddType ¶
Add a type to an Item If a single empty-string type exists, it will be replaced with the type specified
func (Item) GetStatements ¶
type Property ¶
func NewProperty ¶
type Value ¶
type Value interface { String() string Native() interface{} // Return closest go type }
See also: https://github.com/cayleygraph/cayley/blob/master/quad/value.go