voc

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package voc implements an RDF namespace (vocabulary) registry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneTo

func CloneTo(p *Namespaces)

CloneTo adds all global namespaces to a given list.

func FullIRI

func FullIRI(iri string) string

FullIRI replaces known prefix in IRI with it's full vocabulary IRI.

FullIRI("rdf:type") // returns "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"

func Register

func Register(ns Namespace)

Register adds namespace to a global registered list.

func RegisterPrefix

func RegisterPrefix(pref string, ns string)

RegisterPrefix globally associates a given prefix with a base vocabulary IRI.

func ShortIRI

func ShortIRI(iri string) string

ShortIRI replaces a base IRI of a known vocabulary with it's prefix.

ShortIRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type") // returns "rdf:type"

Types

type ByFullName

type ByFullName []Namespace

func (ByFullName) Len

func (o ByFullName) Len() int

func (ByFullName) Less

func (o ByFullName) Less(i, j int) bool

func (ByFullName) Swap

func (o ByFullName) Swap(i, j int)

type Namespace

type Namespace struct {
	Full   string
	Prefix string
}

Namespace is a RDF namespace (vocabulary).

func List

func List() []Namespace

List enumerates all registered namespace pairs.

type Namespaces

type Namespaces struct {
	Safe bool // if set, assume no locking is required
	// contains filtered or unexported fields
}

Namespaces is a set of registered namespaces.

func Clone

func Clone() *Namespaces

Clone makes a copy of global namespaces list.

func (*Namespaces) Clone

func (p *Namespaces) Clone() *Namespaces

Clone makes a copy of namespaces list.

func (*Namespaces) CloneTo

func (p *Namespaces) CloneTo(p2 *Namespaces)

CloneTo adds registered namespaces to a given list.

func (*Namespaces) FullIRI

func (p *Namespaces) FullIRI(iri string) string

FullIRI replaces known prefix in IRI with it's full vocabulary IRI.

FullIRI("rdf:type") // returns "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"

func (*Namespaces) List

func (p *Namespaces) List() (out []Namespace)

List enumerates all registered namespace pairs.

func (*Namespaces) Register

func (p *Namespaces) Register(ns Namespace)

Register adds namespace to registered list.

func (*Namespaces) ShortIRI

func (p *Namespaces) ShortIRI(iri string) string

ShortIRI replaces a base IRI of a known vocabulary with it's prefix.

ShortIRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type") // returns "rdf:type"

Directories

Path Synopsis
Package core imports all well-known RDF vocabularies.
Package core imports all well-known RDF vocabularies.
Package rdf contains constants of the RDF Concepts Vocabulary (RDF)
Package rdf contains constants of the RDF Concepts Vocabulary (RDF)
Package rdfs contains constants of the RDF Schema vocabulary (RDFS)
Package rdfs contains constants of the RDF Schema vocabulary (RDFS)
Package schema contains constants of the Schema.org vocabulary.
Package schema contains constants of the Schema.org vocabulary.

Jump to

Keyboard shortcuts

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