skos2web

package module
v0.0.0-...-ba86f5d Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: MIT Imports: 18 Imported by: 0

README

skos2web

Notes on development

Source skos files must be in ntriples format Source SKOS files must contain one conceptScheme

Recommended to run the SKOS files through Skosify, to clean up the syntax and optionally add some semantics. Also, exports from iQVoc lack a conceptScheme, and Skosify can automatically add one of these.

skosify \
  --namespace="http://purl.org/coar/access_right/" \
  --label="Access Rights" \
  --set-modified \
  --mark-top-concepts \
  --narrower \
  --eliminate-redundancy \
  --cleanup-classes \
  --cleanup-properties \
  --cleanup-unreachable \
  -o ./skosified/access_rights.nt \
  ./access_rights.nt
skosify \
  --namespace="http://purl.org/coar/resource_type/" \
  --label="Resource Types" \
  --set-modified \
  --mark-top-concepts \
  --narrower \
  --eliminate-redundancy \
  --cleanup-classes \
  --cleanup-properties \
  --cleanup-unreachable \
  -o ./skosified/resource_types.nt \
  ./resource_types.nt
skosify \
  --namespace="http://purl.org/coar/version/" \
  --label="Version Types" \
  --set-modified \
  --mark-top-concepts \
  --narrower \
  --eliminate-redundancy \
  --cleanup-classes \
  --cleanup-properties \
  --cleanup-unreachable \
  -o ./skosified/version_types.nt \
  ./version_types.nt

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableDebugging

func EnableDebugging()

Types

type Concept

type Concept struct {
	ki.Node          `yaml:"-"`
	ID               string    `yaml:"-"`
	Title            string    `yaml:"title"`
	Uri              string    `yaml:"uri"`
	Definition       string    `yaml:"description"`
	HugoLayout       string    `yaml:"layout"`
	EditorialNote    string    `yaml:"-"`
	RelatedMatches   []Match   `yaml:"related"`
	PrefLabels       []Label   `yaml:"pref_labels"`
	AltLabels        []Label   `yaml:"alt_labels"`
	Body             string    `yaml:"-"`
	Updated          time.Time `yaml:"date"`
	IsTopConcept     bool      `yaml:"isTopConcept"`
	NarrowerConcepts []string  `yaml:"narrower_concepts"`
	BroaderConcepts  []string  `yaml:"broader_concepts"`
}

type ConceptScheme

type ConceptScheme struct {
	ki.Node                 `yaml:"-"`
	ID                      string     `yaml:"-"`
	Version                 string     `yaml:"version"`
	Title                   string     `yaml:"title"`
	Description             string     `yaml:"description"`
	Namespace               string     `yaml:"namespace"`
	Uri                     string     `yaml:"uri"`
	SkosProcessedFolderPath string     `yaml:"-"`
	WorkingFilePathNTriples string     `yaml:"-"`
	Updated                 time.Time  `yaml:"date"`
	Creators                []string   `yaml:"creators"`
	Contributors            []string   `yaml:"contributors"`
	Concepts                []*Concept `yaml:"-"`
	HugoLayout              string     `yaml:"layout,omitempty"`
}

func (*ConceptScheme) CalculateFolderPath

func (conceptScheme *ConceptScheme) CalculateFolderPath(webRootContentPath string) string

func (*ConceptScheme) GetConceptById

func (conceptScheme *ConceptScheme) GetConceptById(id string) *Concept

func (*ConceptScheme) Initialise

func (conceptScheme *ConceptScheme) Initialise(id, title, uri, namespace, description, version, skosSourceFolderPath string, creators, contributors []string, updated time.Time) error

func (*ConceptScheme) Marshal

func (conceptScheme *ConceptScheme) Marshal() ([]byte, error)

type Label

type Label struct {
	LanguageCode string `yaml:"language_code"`
	LanguageName string `yaml:"language_name"`
	Value        string `yaml:"value"`
}

type Match

type Match struct {
	MatchType string `yaml:"type"`
	MatchUri  string `yaml:"uri"`
}

type Website

type Website struct {
	WebrootFolderPath       string
	ContentFolderPath       string
	StaticContentFolderPath string
}

func (*Website) GenerateConceptPages

func (website *Website) GenerateConceptPages(conceptScheme *ConceptScheme) error

func (*Website) GenerateHtmlTree

func (website *Website) GenerateHtmlTree(conceptScheme *ConceptScheme) error

func (*Website) GeneratePrintableSinglePage

func (website *Website) GeneratePrintableSinglePage(conceptScheme *ConceptScheme) error

func (*Website) GenerateZip

func (website *Website) GenerateZip(conceptScheme *ConceptScheme, filesPathsToZip []string) error

func (*Website) Initialise

func (website *Website) Initialise(webrootPath string)

func (*Website) ProcessConceptScheme

func (website *Website) ProcessConceptScheme(conceptScheme *ConceptScheme) error

Jump to

Keyboard shortcuts

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