Documentation ¶
Overview ¶
Package sparql implements a simple SPARQL client and query builder.
Index ¶
- Variables
- type Endpoint
- type GenericEndpoint
- type Query
- func (q *Query) Describe(fields ...string) *Query
- func (q *Query) Exec(result interface{}) error
- func (q *Query) Filter(fs ...string) *Query
- func (q *Query) FilterLang(v, lang string) *Query
- func (q *Query) Optional(s, p, o string) *Query
- func (q *Query) Prefix(p, uri string) *Query
- func (q *Query) Select(fields ...string) *Query
- func (q *Query) String() string
- func (q *Query) Where(s, p, o string) *Query
- type Resource
- type ResourceResponse
- type Row
- type Triple
Constants ¶
This section is empty.
Variables ¶
View Source
var (
CommonPrefixes = map[string]string{
"sarif": "sarif://schema/",
"dbpedia": "http://dbpedia.org/resource/",
"dbpedia-owl": "http://dbpedia.org/ontology/",
"dbpedia-prop": "http://dbpedia.org/property/",
"foaf": "http://xmlns.com/foaf/0.1/",
"freebase-key": "http://rdf.freebase.com/key/",
"freebase-ns": "http://rdf.freebase.com/ns/",
"mo": "http://purl.org/ontology/mo/",
"owl": "http://www.w3.org/2002/07/owl#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"schema": "http://schema.org/",
"vcard": "http://www.w3.org/2006/vcard/ns#",
"yago": "http://yago-knowledge.org/resource/",
"xsd": "http://www.w3.org/2001/XMLSchema#",
}
)
View Source
var (
DBPedia = NewEndpoint("http://dbpedia.org/sparql")
)
Functions ¶
This section is empty.
Types ¶
type GenericEndpoint ¶
type GenericEndpoint struct {
Url string
}
func NewEndpoint ¶
func NewEndpoint(url string) *GenericEndpoint
func (*GenericEndpoint) Describe ¶
func (p *GenericEndpoint) Describe(q string, result interface{}) error
func (*GenericEndpoint) Query ¶
func (p *GenericEndpoint) Query() *Query
func (*GenericEndpoint) Select ¶
func (p *GenericEndpoint) Select(q string, result interface{}) error
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func (*Query) FilterLang ¶
type ResourceResponse ¶
type ResourceResponse struct { Results struct { Bindings []Row `json:"bindings"` } `json:"results"` }
Click to show internal directories.
Click to hide internal directories.