trig

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Example (Example1)
package main

import (
	"embed"
	_ "embed"
	"fmt"
	"github.com/0x51-dev/rdf/trig"
)

var example1 string

func main() {
	doc, _ := trig.ParseDocument(example1)
	fmt.Println(doc)
}
Output:

@prefix ex: <http://www.example.org/vocabulary#> .
@prefix : <http://www.example.org/exampleDocument#> .
:G1 { :Monica a ex:Person ; ex:email <mailto:monica@monicamurphy.org> ; ex:hasSkill ex:Management, ex:Programming ; ex:homepage <http://www.monicamurphy.org> ; ex:name "Monica Murphy" . }

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvaluateDocument

func EvaluateDocument(doc Document) (nq.Document, error)

func ValidateDocument

func ValidateDocument(doc Document) bool

Types

type Base

type Base ttl.Base

func (Base) String

func (b Base) String() string

type BlankNode

type BlankNode ttl.BlankNode

func (BlankNode) String

func (b BlankNode) String() string

type Block

type Block interface {
	Statement

	fmt.Stringer
	// contains filtered or unexported methods
}

func ParseBlock

func ParseBlock(n *parser.Node) (Block, error)

type Context

type Context struct {
	*ttl.Context
}

func NewContext

func NewContext() *Context

func (*Context) EvaluateWrappedGraph

func (ctx *Context) EvaluateWrappedGraph(wg WrappedGraph) bool

type Document

type Document []Statement

func ParseDocument

func ParseDocument(doc string) (Document, error)

func (Document) String

func (d Document) String() string

type IRI

type IRI ttl.IRI

func (IRI) String

func (i IRI) String() string

type LabelOrSubject

type LabelOrSubject interface {
	fmt.Stringer
	// contains filtered or unexported methods
}

LabelOrSubject is either an IRI or a BlankNode.

func ParseLabelOrSubject

func ParseLabelOrSubject(n *parser.Node) (LabelOrSubject, error)

type Prefix

type Prefix ttl.Prefix

func (Prefix) String

func (p Prefix) String() string

type Statement

type Statement interface {
	fmt.Stringer
	// contains filtered or unexported methods
}

type Triple2

type Triple2 struct {
	BlankNodePropertyList ttl.BlankNodePropertyList
	Collection            ttl.Collection
	PredicateObjectList   ttl.PredicateObjectList
}

func ParseTriples

func ParseTriples(n *parser.Node) (*Triple2, error)

func (Triple2) String

func (t Triple2) String() string

type TriplesBlock

type TriplesBlock []ttl.Triple

func ParseTriplesBlock

func ParseTriplesBlock(n *parser.Node) (TriplesBlock, error)

func (TriplesBlock) String

func (t TriplesBlock) String() string

type TriplesOrGraph

type TriplesOrGraph struct {
	LabelOrSubject      LabelOrSubject
	WrappedGraph        WrappedGraph
	PredicateObjectList ttl.PredicateObjectList
}

func ParseTriplesOrGraph

func ParseTriplesOrGraph(n *parser.Node) (*TriplesOrGraph, error)

func (*TriplesOrGraph) String

func (t *TriplesOrGraph) String() string

type WrappedGraph

type WrappedGraph TriplesBlock

func ParseWrappedGraph

func ParseWrappedGraph(n *parser.Node) (WrappedGraph, error)

func (WrappedGraph) String

func (w WrappedGraph) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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