Documentation
¶
Overview ¶
Package rdflibgo is an RDF library for Go, ported from Python's rdflib.
This root package re-exports all public types and functions from subpackages for backward compatibility. New code may import subpackages directly: term, store, namespace, graph, paths, plugin, testutil.
Index ¶
- Constants
- Variables
- func CompareTerm(a, b Term) int
- func FormatFromContent(data []byte) (string, bool)
- func FormatFromFilename(filename string) (string, bool)
- func FormatFromMIME(contentType string) (string, bool)
- func RegisterParser(name string, factory func() Parser)
- func RegisterSerializer(name string, factory func() Serializer)
- func RegisterStore(name string, factory func() Store)
- func SortTerms(terms []Term)
- type AlternativePath
- type BNode
- type ClosedNamespace
- type Collection
- type ConjunctiveGraph
- type Dataset
- type Graph
- type GraphOption
- type InvPath
- type Literal
- type LiteralOption
- type MemoryStore
- type MulPath
- type NSManager
- type Namespace
- type NamespaceIterator
- type NamespaceManager
- type NegatedPath
- type Parser
- type Path
- type Predicate
- type Quad
- type Resource
- type SequencePath
- type Serializer
- type Store
- type Subject
- type Term
- type TermIterator
- type TermPairIterator
- type TermSlice
- type Triple
- type TripleIterator
- type TriplePattern
- type TripleTerm
- type URIRef
- type URIRefPath
- type Variable
Constants ¶
View Source
const ( XSDNamespace = term.XSDNamespace RDFNamespace = term.RDFNamespace RDFSNamespace = namespace.RDFSNamespace OWLNamespace = namespace.OWLNamespace )
Variables ¶
View Source
var ( ErrInvalidIRI = term.ErrInvalidIRI ErrUnknownFormat = term.ErrUnknownFormat ErrTermNotInNamespace = term.ErrTermNotInNamespace ErrInvalidCURIE = term.ErrInvalidCURIE ErrPrefixNotBound = term.ErrPrefixNotBound )
View Source
var ( XSDString = term.XSDString XSDInteger = term.XSDInteger XSDInt = term.XSDInt XSDLong = term.XSDLong XSDFloat = term.XSDFloat XSDDouble = term.XSDDouble XSDDecimal = term.XSDDecimal XSDBoolean = term.XSDBoolean XSDDateTime = term.XSDDateTime XSDDate = term.XSDDate XSDTime = term.XSDTime XSDAnyURI = term.XSDAnyURI RDFLangString = term.RDFLangString RDFDirLangString = term.RDFDirLangString RDFReifies = term.RDFReifies )
Functions ¶
func CompareTerm ¶
func FormatFromContent ¶
func FormatFromFilename ¶
func FormatFromMIME ¶
func RegisterParser ¶
func RegisterSerializer ¶
func RegisterSerializer(name string, factory func() Serializer)
func RegisterStore ¶
Types ¶
type AlternativePath ¶
type AlternativePath = paths.AlternativePath
func Alternative ¶
func Alternative(ps ...Path) *AlternativePath
type ClosedNamespace ¶
type ClosedNamespace = namespace.ClosedNamespace
func NewClosedNamespace ¶
func NewClosedNamespace(base string, terms []string) ClosedNamespace
type Collection ¶
type Collection = graph.Collection
func NewCollection ¶
func NewCollection(g *Graph, head Subject) *Collection
func NewEmptyCollection ¶
func NewEmptyCollection(g *Graph) *Collection
type ConjunctiveGraph ¶
type ConjunctiveGraph = graph.ConjunctiveGraph
func NewConjunctiveGraph ¶
func NewConjunctiveGraph(opts ...GraphOption) *ConjunctiveGraph
type Dataset ¶
func NewDataset ¶
func NewDataset(opts ...GraphOption) *Dataset
type GraphOption ¶
type GraphOption = graph.GraphOption
func WithBase ¶
func WithBase(base string) GraphOption
func WithIdentifier ¶
func WithIdentifier(id Term) GraphOption
func WithStore ¶
func WithStore(s Store) GraphOption
type Literal ¶
func NewLiteral ¶
func NewLiteral(value any, opts ...LiteralOption) Literal
type LiteralOption ¶
type LiteralOption = term.LiteralOption
func WithDatatype ¶
func WithDatatype(dt URIRef) LiteralOption
func WithDir ¶ added in v0.0.6
func WithDir(dir string) LiteralOption
func WithLang ¶
func WithLang(lang string) LiteralOption
type MemoryStore ¶
type MemoryStore = store.MemoryStore
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
type MulPath ¶
func ZeroOrMore ¶
type NSManager ¶
func NewNSManager ¶
type Namespace ¶
func NewNamespace ¶
type NamespaceManager ¶
type NamespaceManager = term.NamespaceManager
type NegatedPath ¶
type NegatedPath = paths.NegatedPath
func Negated ¶
func Negated(excluded ...URIRef) *NegatedPath
type Resource ¶
func NewResource ¶
type SequencePath ¶
type SequencePath = paths.SequencePath
func Sequence ¶
func Sequence(ps ...Path) *SequencePath
type Serializer ¶
type Serializer = plugin.Serializer
func GetSerializer ¶ added in v0.0.2
func GetSerializer(name string) (Serializer, bool)
type TermIterator ¶
type TripleIterator ¶
type TriplePattern ¶
type TriplePattern = term.TriplePattern
type TripleTerm ¶ added in v0.0.6
type TripleTerm = term.TripleTerm
func NewTripleTerm ¶ added in v0.0.6
func NewTripleTerm(s Subject, p URIRef, o Term) TripleTerm
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
format_examples
command
Package main demonstrates parsing and serializing RDF in multiple formats.
|
Package main demonstrates parsing and serializing RDF in multiple formats. |
|
load_example
command
Example demonstrating SPARQL UPDATE LOAD with rdfloader.
|
Example demonstrating SPARQL UPDATE LOAD with rdfloader. |
|
property_paths_example
command
Package main demonstrates SPARQL-style property paths.
|
Package main demonstrates SPARQL-style property paths. |
|
resource_example
command
Package main demonstrates the Resource API for node-centric graph access.
|
Package main demonstrates the Resource API for node-centric graph access. |
|
shacl_constraints_example
command
Package main demonstrates various SHACL constraint types.
|
Package main demonstrates various SHACL constraint types. |
|
shacl_example
command
Package main demonstrates SHACL validation with shapes and data graphs.
|
Package main demonstrates SHACL validation with shapes and data graphs. |
|
simple_example
command
Package main demonstrates basic RDF graph creation, triple manipulation, and serialization.
|
Package main demonstrates basic RDF graph creation, triple manipulation, and serialization. |
|
sparql_query_example
command
Package main demonstrates SPARQL queries on an RDF graph.
|
Package main demonstrates SPARQL queries on an RDF graph. |
|
sparql_update_example
command
Package main demonstrates SPARQL Update operations on RDF graphs.
|
Package main demonstrates SPARQL Update operations on RDF graphs. |
|
transitive_example
command
Package main demonstrates transitive closure queries using property paths.
|
Package main demonstrates transitive closure queries using property paths. |
|
Package graph provides the RDF Graph type with triple storage, pattern matching, and set operations (union, intersection, difference).
|
Package graph provides the RDF Graph type with triple storage, pattern matching, and set operations (union, intersection, difference). |
|
internal
|
|
|
ntsyntax
Package ntsyntax provides shared N-Triples/N-Quads parsing and serialization helpers.
|
Package ntsyntax provides shared N-Triples/N-Quads parsing and serialization helpers. |
|
Package jsonld implements a JSON-LD parser and serializer using piprate/json-gold.
|
Package jsonld implements a JSON-LD parser and serializer using piprate/json-gold. |
|
Package namespace provides built-in RDF namespace bindings (RDF, RDFS, OWL, XSD, FOAF, DC, SKOS, PROV, etc.) and namespace management utilities.
|
Package namespace provides built-in RDF namespace bindings (RDF, RDFS, OWL, XSD, FOAF, DC, SKOS, PROV, etc.) and namespace management utilities. |
|
Package nq implements an N-Quads parser and serializer.
|
Package nq implements an N-Quads parser and serializer. |
|
Package nt implements an N-Triples parser and serializer.
|
Package nt implements an N-Triples parser and serializer. |
|
Package paths implements RDF property path evaluation including inverse, sequence, alternative, and repetition operators.
|
Package paths implements RDF property path evaluation including inverse, sequence, alternative, and repetition operators. |
|
Package plugin provides format auto-detection by filename, MIME type, or content sniffing.
|
Package plugin provides format auto-detection by filename, MIME type, or content sniffing. |
|
Package rdfloader provides a Loader that fetches RDF data from URIs and parses it into graphs.
|
Package rdfloader provides a Loader that fetches RDF data from URIs and parses it into graphs. |
|
Package rdfxml implements an RDF/XML parser and serializer.
|
Package rdfxml implements an RDF/XML parser and serializer. |
|
Package reasoning provides RDF entailment (inference) support.
|
Package reasoning provides RDF entailment (inference) support. |
|
Package shacl implements SHACL (Shapes Constraint Language) validation for RDF graphs, supporting core constraint components.
|
Package shacl implements SHACL (Shapes Constraint Language) validation for RDF graphs, supporting core constraint components. |
|
Package sparql implements a SPARQL query engine supporting SELECT, ASK, CONSTRUCT, FILTER, OPTIONAL, UNION, BIND, ORDER BY, LIMIT/OFFSET, DISTINCT, and 30+ built-in functions.
|
Package sparql implements a SPARQL query engine supporting SELECT, ASK, CONSTRUCT, FILTER, OPTIONAL, UNION, BIND, ORDER BY, LIMIT/OFFSET, DISTINCT, and 30+ built-in functions. |
|
Package store provides the in-memory triple store with SPO/POS/OSP indices for efficient pattern-based lookups.
|
Package store provides the in-memory triple store with SPO/POS/OSP indices for efficient pattern-based lookups. |
|
badgerstore
Package badgerstore provides a persistent store.Store implementation backed by Badger (dgraph-io/badger/v4), an LSM-tree key-value engine.
|
Package badgerstore provides a persistent store.Store implementation backed by Badger (dgraph-io/badger/v4), an LSM-tree key-value engine. |
|
sparqlstore
Package sparqlstore provides a store.Store implementation that communicates with a remote SPARQL endpoint over HTTP using the W3C SPARQL 1.1 Protocol.
|
Package sparqlstore provides a store.Store implementation that communicates with a remote SPARQL endpoint over HTTP using the W3C SPARQL 1.1 Protocol. |
|
sqlitestore
Package sqlitestore provides a persistent store.Store implementation backed by SQLite via modernc.org/sqlite (pure Go, zero CGo).
|
Package sqlitestore provides a persistent store.Store implementation backed by SQLite via modernc.org/sqlite (pure Go, zero CGo). |
|
Package testutil provides test helpers for comparing RDF graphs, including blank node isomorphism.
|
Package testutil provides test helpers for comparing RDF graphs, including blank node isomorphism. |
|
Package trig implements TriG (Turtle with named graphs) serialization and parsing for RDF datasets.
|
Package trig implements TriG (Turtle with named graphs) serialization and parsing for RDF datasets. |
|
Package turtle implements Turtle (Terse RDF Triple Language) serialization and parsing for RDF graphs.
|
Package turtle implements Turtle (Terse RDF Triple Language) serialization and parsing for RDF graphs. |
Click to show internal directories.
Click to hide internal directories.