Documentation
¶
Index ¶
- func BuildReverseMap(ldContext json.RawMessage) map[string]string
- func ExpandIRI(compact, vocab string, ctx map[string]any) string
- func IsAbstract(ldContext json.RawMessage) bool
- func IsValueObject(ldContext json.RawMessage) bool
- func ParseContext(ldContext json.RawMessage) (string, map[string]string)
- func ResolvePredicateIRI(propName, vocab string, contextMap map[string]string) string
- func SubClassOf(ldContext json.RawMessage) string
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 ¶
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 ¶
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.