Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
PACKAGE

package gold
import "bitbucket.org/ww/gold"

Installation
---------

This program depends on an external library, libraptor, used for RDF
serialisation and parsing which is available from
http://librdf.org/raptor At least version 2.0.0 is required, and
version 2.0.3 or greater is recommended. Also required is libxml2
and libxslt, I use versions 2.7.8 and 1.1.26 respectively

    hg clone https://go.googlecode.com/hg go
    cd go/src && hg up -r release && ./all.bash

Next, goinstall doesn't know how to build commands and we build two of
them. Until this is fixed, the install process will be a little bit
manual:

    goinstall bitbucket.org/ww/goautoneg
    goinstall bitbucket.org/ww/libxml
    goinstall bitbucket.org/ww/goraptor
    goinstall bitbucket.org/ww/gold

    (cd pkg/bitbucket.org/ww/gold && gomake build)

Configuration
-----------

The HTTP server and harvester programs both use the same configuration
file. An example can be found in the distribution directory. In
particular, the global setting for the root directory where the
processes will run should be changed as well as the [http]/root which
is where the HTTP server will look for its static content, templates
and such. This last is typically set to

    ${GOROOT}/src/pkg/bitbucket.org/ww/gold/static

but could equally well be elsewhere, particularly for a customised web
site layout. Another setting that will likely need to be changed is the
location of the log files.

The HTTP server can now be started with the command,

    ${GOBIN}/deref -d gold.cfg

The harvest daemon takes some more configuration. It needs to be told
about harvest sources, and there are some examples in the example
configuration file.

RDF helper routines.


CONSTANTS

const Version = "1.0"
Version of GoLD. Once 1.0 is reached versions will approximate
the golden mean by the continued  fraction method.


FUNCTIONS

func Alternatives(resource, description goraptor.Uri) (ch chan *goraptor.Statement)

func Blank() goraptor.Term
Generate a new blank node

func GoldenRatio(n int) float64
Calculate the golden ration using the continued fraction method
for n iterations.

func ParseSparqlJson(json_data []byte) (results []map[string]goraptor.Term, err os.Error)
Parse a JSON serialised result set from a SPARQL query

func RegisterRepository(name string, factory RepositoryFactory)
Register a repository constructor. Intended to be called from the init
function of a package. Panics if name is already registered

func Serializer(format string) (serializer *goraptor.Serializer)
Return a serializer, basically a wrapper around the
goraptor.NewSerializer that also takes care of setting the
namespaces that we know about.


TYPES

type Catalog struct {
    // contains unexported fields
}
Catalog is a structure that implements some required
common functionality amongst Repository implementations.
It is intended to be embedded into the implementation type.

func NewCatalog(cfg *config.Config) (cat *Catalog, err os.Error)
It is required that this method be called on initialisation of
a type that embeds Catalog.

func (cat *Catalog) Copy(source Repository, store SparqlStore) (err os.Error)

func (cat *Catalog) PutDataset(dset Dataset, store SparqlStore) (err os.Error)
Copy a Dataset into a SparqlStore

func (cat *Catalog) Record(dataset Dataset) (rec *Record)
Produce an RDF representation of the given package as a
dcat:CatalogRecord using the given url as package identifier

type Dataset interface {
    // Return a string identifier for the dataset, usually a UUID
    Id() string
    // Return an RDF Term for the dataset
    Term() goraptor.Term
    // An RDF Term describing the source of the dataset
    Source() goraptor.Term
    // Returns an OPM(V) Process
    Process() *Process
    // Return a channel of RDF statements describing this dataset
    ToRdf() chan *goraptor.Statement
}
Interface that must be satisfied by any concrete dataset type

type MemRepo struct {
    // contains unexported fields
}

func (mr *MemRepo) Count() int

func (mr *MemRepo) Datasets() (ch chan Dataset, err os.Error)

func (mr *MemRepo) GetDataset(id string) (dset Dataset, err os.Error)

func (mr *MemRepo) PutDataset(dset Dataset) (err os.Error)

func (mr *MemRepo) String() string

func (mr *MemRepo) Term() goraptor.Term

func (mr *MemRepo) ToRdf() (ch chan *goraptor.Statement, err os.Error)

type Namespace string
An RDF namespace

var DC Namespace
Dublin Core

var DCAT Namespace
Data Catalog

var FOAF Namespace
Friend of a Friend

var GIS Namespace
GeoSPARQL

var INSP Namespace
INSPIRE

var LIC Namespace
Licenses

var MOAT Namespace
Meaning of a Tag

var OPMV Namespace
Open Provenance Model Vocabulary

var RDF Namespace
RDF

var RDFS Namespace
RDF Schema

var REV Namespace
Reviews

var TIME Namespace
OWL Time

var VOID Namespace
XML Schema Datatypes

var XSD Namespace
VOID descriptions of RDF datasets

func (ns Namespace) U(value string) goraptor.Term
Return a goraptor.Term (actually &goraptor.Uri) that
is the concatenation of the namespace and the provided
value.

type Process struct {
    Node   goraptor.Term
    Used   []goraptor.Term
    OpName goraptor.Term
    Time   *time.Time
}
Implementation of some aspects of the Open Provenance Model
This structure can be used either persistently or on the fly

func NewProcess() (proc *Process)

func (proc *Process) SetOp(opname string)
Indicate that the process was controlled by the entity
with the given name

func (proc *Process) ToRdf() (ch chan *goraptor.Statement)
Generate an RDF description of the process

func (proc *Process) Use(url string)
Indicate that the process used a particular resource

type Record struct {
    // contains unexported fields
}

func (rec *Record) Term() goraptor.Term

func (rec *Record) ToRdf() (ch chan *goraptor.Statement)

type Repository interface {
    // the URI to identify of this repository
    Term() goraptor.Term
    // number of packages present
    Count() int
    // a channel over which all packages are sent
    Datasets() (chan Dataset, os.Error)
    // retrieve a particular package
    GetDataset(id string) (Dataset, os.Error)
    // add or replace a particular package
    PutDataset(dset Dataset) os.Error
    // return a description of the repository
    ToRdf() (chan *goraptor.Statement, os.Error)
}
Interface to the Repository

func MakeRepository(cfg *config.Config, section string, store SparqlStore) (repo Repository, err os.Error)

func NewMemRepo(cfg *config.Config, section string, store SparqlStore) (repo Repository, err os.Error)

type RepositoryFactory func(cfg *config.Config, section string, store SparqlStore) (repo Repository, err os.Error)

type SparqlStore interface {
    // Execute a sparql query and give back a series (slice) of result rows
    Query(query string) (results []map[string]goraptor.Term, err os.Error)
    // Execute a sparql update or delete query
    Execute(query string) (err os.Error)
    // Replace the given graph, expressed as statements sent over a channel
    PutGraph(graph string, ch chan *goraptor.Statement) (err os.Error)
    // Replace the given graph, expressed as serialised text with associated mime type
    PutGraphText(graph, text, mime_type string) (err os.Error)
    // Append to the given graph, expressed as statements sent over a channel
    AppendGraph(graph string, ch chan *goraptor.Statement) (err os.Error)
    // Append to the given graph, expressed as serialised text and mime type
    AppendGraphText(graph string, text, mime_type string) (err os.Error)
    // Delete the given graph
    DeleteGraph(graph string) (err os.Error)
}
Interface that must be satisfied by a SPARQL store


SUBDIRECTORIES

	.hg
	ckanclient
	config
	cswclient
	deref
	garlik
	harvest
	static
	utils

Recent activity

website_scraping

website_scraping began watching ww/gold

w...@epsilon.styx.org

Commits by w...@epsilon.styx.org were pushed to ww/gold

7d98c2f - Add documentation
w...@epsilon.styx.org

Commits by w...@epsilon.styx.org were pushed to ww/gold

a8c572b - Add beginnings of WMS visualisation...
w...@epsilon.styx.org

Commits by w...@epsilon.styx.org were pushed to ww/gold

73732d2 - strip out explicit WMS namespace for backwards compatibility
w...@epsilon.styx.org

Commits by w...@epsilon.styx.org were pushed to ww/gold

2658308 - add script to import the get capabilities of wms services
w...@epsilon.styx.org

Commits by w...@epsilon.styx.org were pushed to ww/gold

9d0d2f8 - pull in keywords and srs for layers
w...@epsilon.styx.org

Commits by w...@epsilon.styx.org were pushed to ww/gold

2d92800 - add gallows namespaces
w...@epsilon.styx.org

Commits by w...@epsilon.styx.org were pushed to ww/gold

d02a30d - link ows into the build process... change ows namespace to gallows.inf
w...@epsilon.styx.org

Commits by w...@epsilon.styx.org were pushed to ww/gold

114c156 - add misc queries, script
w...@epsilon.styx.org

Commits by w...@epsilon.styx.org were pushed to ww/gold

6e30aca - capabilities for wms
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.