jsonld

package
v3.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildReverseMap

func BuildReverseMap(ldContext json.RawMessage) map[string]string

BuildReverseMap builds a predicate IRI → property name map from a JSON-LD context. This is the inverse of ParseContext's property→IRI mapping.

func ExpandIRI

func ExpandIRI(compact, vocab string, ctx map[string]any) string

ExpandIRI expands a compact IRI (e.g., "schema:object") to a full IRI using prefixes defined in the context, or falls back to @vocab.

func IsAbstract

func IsAbstract(ldContext json.RawMessage) bool

IsAbstract checks whether a JSON-LD context declares "weos:abstract": true. Abstract types serve as base types for child types (via rdfs:subClassOf). Each type gets its own projection table; child resources are dual-projected into both their own table and all ancestor tables.

func IsValueObject

func IsValueObject(ldContext json.RawMessage) bool

IsValueObject checks whether a JSON-LD context declares "weos:valueObject": true. Value object types are referenced by other types' properties but don't appear in navigation.

func ParseContext

func ParseContext(ldContext json.RawMessage) (string, map[string]string)

ParseContext extracts the @vocab and per-property predicate mappings from a JSON-LD context. Returns the vocab IRI and a map of property name → expanded predicate IRI.

func ResolvePredicateIRI

func ResolvePredicateIRI(propName, vocab string, contextMap map[string]string) string

ResolvePredicateIRI resolves the predicate IRI for a property name. Priority: explicit context mapping > @vocab + property name.

func SubClassOf

func SubClassOf(ldContext json.RawMessage) string

SubClassOf extracts the rdfs:subClassOf value from a JSON-LD context. Returns the parent type slug or empty string if not declared.

Types

This section is empty.

Jump to

Keyboard shortcuts

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