owl

package
v0.0.0-...-4cb3568 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package owl implements decoding the RDF/XML encoding a Gene Ontology dataset. It is not a complete RDF/XML parser implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Decoder is a Gene Ontology OBO in OWL decoder. rdf.Statements returned by calls to the Unmarshal and UnmarshalLocal methods have their Terms' UID fields set so that unique terms will have unique IDs and so can be used directly in a graph.Multi, or in a graph.Graph if all predicate terms are identical. IDs created by the decoder all exist within a single namespace and so Terms can be uniquely identified by their UID. Term UIDs are based from 1 to allow RDF-aware client graphs to assign ID if no ID has been assigned.

func NewDecoder

func NewDecoder(r io.Reader) (*Decoder, error)

NewDecoder returns a new Decoder that takes input from r.

func (*Decoder) Namespaces

func (dec *Decoder) Namespaces() []xml.Attr

Namespace returns the namespace collected from the XML stream. The value returned by Namespaces in valid after the Decoder is returned by NewDecoder or a successful Reset.

func (*Decoder) Reset

func (dec *Decoder) Reset(r io.Reader) error

Reset resets the decoder to use the provided io.Reader, retaining the existing Term ID mapping. A new XML namespace is obtained from the XML stream in r.

func (*Decoder) Unmarshal

func (dec *Decoder) Unmarshal() (*rdf.Statement, error)

Unmarshal returns the next unique statement from the input stream.

func (*Decoder) UnmarshalLocal

func (dec *Decoder) UnmarshalLocal() (*rdf.Statement, error)

UnmarshalLocal returns the next unique statement from the input stream, but replaces full IRI namespace text with the qualified name prefix obtained from the decoders internal namespaces. The namespaces can be obtained by using the Namespaces method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL