Documentation ¶
Index ¶
- func Harvest(ctx context.Context, repo *Repo, query string) (responses []*responseWithContext, err error)
- type BulkMetrics
- type BulkRequest
- type DataSetStore
- func (ds *DataSetStore) CountGraphsBySpec() (int, error)
- func (ds *DataSetStore) CountRevisionsBySpec() ([]domain.DataSetRevisions, error)
- func (ds *DataSetStore) DeleteAllGraphsBySpec(ctx context.Context) (bool, error)
- func (ds *DataSetStore) DeleteGraphsOrphansBySpec(ctx context.Context, revision int) (bool, error)
- type Entry
- type Head
- type Header
- type Option
- type Repo
- type RepoConfig
- type Results
- type Service
- func (s *Service) GetRepo(orgID domain.OrganizationID) (*Repo, error)
- func (s *Service) Resolve(ctx context.Context, orgID domain.OrganizationID, subj rdf.Subject) (g *rdf.Graph, err error)
- func (s *Service) Routes(pattern string, r chi.Router)
- func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Service) SetServiceBuilder(b *domain.ServiceBuilder)
- func (s *Service) Shutdown(ctx context.Context) error
- type TermType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BulkMetrics ¶ added in v0.3.0
type BulkRequest ¶ added in v0.3.0
type BulkRequest struct {
// contains filtered or unexported fields
}
BulkRequest can send multiple namedgraphs to an repo with a single request. Do(ctx) sends the actual request.
func NewBulkRequest ¶ added in v0.3.0
func NewBulkRequest(repo *Repo, datasetID string, revision int) *BulkRequest
NewBulkRequest retutrns a new BulkRequest
func (*BulkRequest) Add ¶ added in v0.3.0
func (br *BulkRequest) Add(namedGraphUri string, g *rdf.Graph) error
Add adds all the triples from the rdf.Graph
func (*BulkRequest) AddString ¶ added in v0.3.0
func (br *BulkRequest) AddString(namedGraphUri, triples string) error
AddString adds triples to a namedgraph. A namedgraph cannot be added multiple times. All triples will be merged in the last entry.
func (*BulkRequest) Do ¶ added in v0.3.0
func (br *BulkRequest) Do(ctx context.Context) error
Do executes the SPARQL update for all the added namedgraphs.
func (*BulkRequest) UpdateQuery ¶ added in v0.3.0
func (br *BulkRequest) UpdateQuery() string
UpdateQuery returns the SPARQL update query that is send with the Do function
type DataSetStore ¶ added in v0.3.0
type DataSetStore struct {
// contains filtered or unexported fields
}
DataSetStore manage domain.DataSet specific options for saved rdf.Record instances.
func NewDataSetStore ¶ added in v0.3.0
func NewDataSetStore(repo *Repo, datasetID string) (*DataSetStore, error)
func (*DataSetStore) CountGraphsBySpec ¶ added in v0.3.0
func (ds *DataSetStore) CountGraphsBySpec() (int, error)
CountGraphsBySpec counts all the named graphs for a spec
func (*DataSetStore) CountRevisionsBySpec ¶ added in v0.3.0
func (ds *DataSetStore) CountRevisionsBySpec() ([]domain.DataSetRevisions, error)
CountRevisionsBySpec counts each revision available in the spec
func (*DataSetStore) DeleteAllGraphsBySpec ¶ added in v0.3.0
func (ds *DataSetStore) DeleteAllGraphsBySpec(ctx context.Context) (bool, error)
DeleteAllGraphsBySpec issues an SPARQL Update query to delete all graphs for a DataSet from the triple store
func (*DataSetStore) DeleteGraphsOrphansBySpec ¶ added in v0.3.0
DeleteGraphsOrphansBySpec issues an SPARQL Update query to delete all orphaned graphs for a DataSet from the triple store.
type Option ¶
func SetCustomQueries ¶
SetCustomQueries allows custom Sparql Queries to be added to the sparql.Bank
Each query must be preceded by a comment otherwise the query is silently ignored.
type Repo ¶ added in v0.3.0
type Repo struct {
// contains filtered or unexported fields
}
Repo represent a RDF repository, assumed to be queryable via the SPARQL protocol over HTTP.
func NewRepo ¶ added in v0.3.0
func NewRepo(cfg RepoConfig) (*Repo, error)
NewRepo creates a new representation of a RDF repository that can be queried through SPARQL.
func (*Repo) Construct ¶ added in v0.3.0
Construct performs a SPARQL HTTP request to the Repo, and returns the result as a rdf.Graph.
func (*Repo) Query ¶ added in v0.3.0
Query performs a SPARQL Get HTTP request to the Repo, and returns the parsed application/sparql-results+json response.
func (*Repo) QueryPost ¶ added in v0.3.0
Query performs a SPARQL POST HTTP request to the Repo, and returns the parsed application/sparql-results+json response.
type RepoConfig ¶ added in v0.3.0
type RepoConfig struct { Host string `json:"host"` // the base-url to the SPARQL endpoint including the scheme and the port QueryPath string `json:"queryPath"` // the relative path of the endpoint. This can should contain the database name that is injected when the sparql endpoint is build UpdatePath string `json:"updatePath"` // the relative path of the update endpoint. This can should contain the database name that is injected when the sparql endpoint is build GraphStorePath string `json:"dataPath"` // the relative GraphStore path of the endpoint. This can should contain the database name that is injected when the sparql endpoint is build Transport struct { Retry int Timeout int UserName string `json:"userName"` Password string `json:"password"` } Bank *sparql.Bank }
type Results ¶ added in v0.3.0
type Results struct { Head Header Results results }
Results holds the parsed results of a application/sparql-results+json response.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) GetRepo ¶ added in v0.3.0
func (s *Service) GetRepo(orgID domain.OrganizationID) (*Repo, error)
func (*Service) ServeHTTP ¶
func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)
implement sparql proxy implementation
func (*Service) SetServiceBuilder ¶ added in v0.3.0
func (s *Service) SetServiceBuilder(b *domain.ServiceBuilder)