Documentation ¶
Overview ¶
This package provide a couple simple HodDB clients HTTP Client:
package main import ( "fmt" "github.com/gtfierro/hod/clients/go" ) func main() { c := hod.NewHTTPClient("http://ciee.cal-sdb.org/api/query") query := `SELECT ?x ?r WHERE { ?x rdf:type/rdfs:subClassOf* brick:Temperature_Sensor . ?x bf:isLocatedIn ?r . };` res, err := c.DoQuery(query, nil) fmt.Println(err) fmt.Printf("%+v", res) }
BOSSWAVE client
package main import ( "fmt" "github.com/gtfierro/hod/clients/go" bw2 "gopkg.in/immesys/bw2bind.v5" ) func main() { client := bw2.ConnectOrExit("") client.OverrideAutoChainTo(true) client.SetEntityFromEnvironOrExit() bc, err := hod.NewBW2Client(client, "ciee/hod") if err != nil { panic(err) } query := `SELECT ?x ?r WHERE { ?x rdf:type/rdfs:subClassOf* brick:Temperature_Sensor . ?x bf:isLocatedIn ?r . };` res, err := bc.DoQuery(query, nil) fmt.Println(err) fmt.Printf("%+v", res) }
Index ¶
Constants ¶
View Source
const RESULT_PONUM = `2.0.10.2/32`
Variables ¶
View Source
var ErrNoResponse = errors.New("No response from archiver")
View Source
var QUERY_PONUM = bw2.FromDotForm(`2.0.10.1`)
Functions ¶
This section is empty.
Types ¶
type HodClientBW2 ¶
func NewBW2Client ¶
func NewBW2Client(client *bw2.BW2Client, uri string) (*HodClientBW2, error)
type HodClientHTTP ¶
type HodClientHTTP struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient(url string) *HodClientHTTP
type Options ¶
func DefaultOptions ¶
func DefaultOptions() *Options
Click to show internal directories.
Click to hide internal directories.