resource

package
v0.0.0-...-9c67b44 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NsContent   = "https://content.deichman.no/ontology/"
	NsKatalog   = "http://data.deichman.no/ontology#"
	NsTjenester = "https://tjenester.deichman.no/ontology/"

	GraphTjenester = "https://tjenester.deichman.no"
	GraphKatalog   = "https://katalog.deichman.no"
	GraphContent   = "https://content.deichman.no"
)

Variables

View Source
var (
	// katalog
	CompositionType = newResourceType("CompositionType", GraphKatalog, NsKatalog)
	Corporation     = newResourceType("Corporation", GraphKatalog, NsKatalog)
	Event           = newResourceType("Event", GraphKatalog, NsKatalog)
	Genre           = newResourceType("Genre", GraphKatalog, NsKatalog)
	Instrument      = newResourceType("Instrument", GraphKatalog, NsKatalog)
	Person          = newResourceType("Person", GraphKatalog, NsKatalog)
	Place           = newResourceType("Place", GraphKatalog, NsKatalog)
	Publication     = newResourceType("Publication", GraphKatalog, NsKatalog)
	Serial          = newResourceType("Serial", GraphKatalog, NsKatalog)
	Subject         = newResourceType("Subject", GraphKatalog, NsKatalog)
	Work            = newResourceType("Work", GraphKatalog, NsKatalog)
	WorkSeries      = newResourceType("WorkSeries", GraphKatalog, NsKatalog)

	// tjenester
	Branch               = newResourceType("Branch", GraphTjenester, NsTjenester)
	Campaign             = newResourceType("Campaign", GraphTjenester, NsTjenester)
	Editor               = newResourceType("Editor", GraphContent, NsKatalog)
	Floor                = newResourceType("Floor", GraphTjenester, NsTjenester)
	LibraryEventInstance = newResourceType("LibraryEventInstance", GraphTjenester, NsTjenester)
	Page                 = newResourceType("Page", GraphTjenester, NsTjenester)
	Room                 = newResourceType("Room", GraphTjenester, NsTjenester)
	Service              = newResourceType("Service", GraphTjenester, NsTjenester)
	AudioVideo           = newResourceType("AudioVideo", GraphTjenester, NsTjenester)

	// content
	Like            = newResourceType("Like", GraphContent, NsContent)
	Recommendation  = newResourceType("Recommendation", GraphContent, NsContent)
	PublicationList = newResourceType("PublicationList", GraphContent, NsContent)
)

Functions

func GetTypeAndIdFromURI

func GetTypeAndIdFromURI(uri string) (typ string, id string)

assumes URIs on the form http://data.deichman.no/type/id (which holds for authorities that are not authorized values)

Types

type ProcessingReq

type ProcessingReq struct {
	URI    string
	Type   ResourceType
	Fields log.Fields
}

func NewProcessingReq

func NewProcessingReq(uri string, fields log.Fields) (ProcessingReq, error)

type ResourceType

type ResourceType struct {
	Name         string // used in type IRIs, i.e. 'CompositionType'
	InstanceName string // used in instance IRIS, i.e. 'compositionType'
	Graph        string // which graph the type is located in
	Ns           string // which namespace the type is located in, i.e. 'http://data.deichman.no/ontology#'
}

func FromType

func FromType(typeName string) (ResourceType, error)

func (ResourceType) TypeUri

func (r ResourceType) TypeUri() string

Jump to

Keyboard shortcuts

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