Documentation
¶
Index ¶
Constants ¶
const BaseRules = `
% Auto-map quads to triples (ignoring graph context)
triple(S, P, O) :- quad(S, P, O, _).
`
BaseRules acts as the Datalog schema compatibility layer, mapping quads to triples.
const DefaultGraph = "default"
DefaultGraph is the default graph name used when parsing N-Triples or when the graph component is missing.
Variables ¶
This section is empty.
Functions ¶
func GetPredicates ¶
GetPredicates extracts unique predicates from a slice of triples.
func ParseNTriples ¶
ParseNTriples reads an N-Triples stream and returns Datalog facts. Format: triple("Subject", "Predicate", "Object")
func SanitizePredicate ¶
SanitizePredicate cleans up predicates (Shared logic).
func TriplesToFacts ¶
TriplesToFacts converts graph triples to Datalog atoms.
Types ¶
type NQuadsLoader ¶
type NQuadsLoader struct{}
NQuadsLoader is a Zero-Dependency parser that handles both N-Triples (.nt) and N-Quads (.nq) formats. It normalizes all entries into Datalog "quad/4" facts, using a default graph for triples.
func NewNQuadsLoader ¶
func NewNQuadsLoader() *NQuadsLoader
NewNQuadsLoader creates a new instance of NQuadsLoader.
func (*NQuadsLoader) GetBaseRules ¶
func (l *NQuadsLoader) GetBaseRules() string
GetBaseRules returns the base Datalog rules associated with this loader.
type NTriplesLoader ¶
type NTriplesLoader struct{}
NTriplesLoader is a zero-dependency, high-performance loader for N-Triples data. Deprecated: Use ParseNTriples function instead.
func NewNTriplesLoader ¶
func NewNTriplesLoader() *NTriplesLoader
NewNTriplesLoader creates a new instance of NTriplesLoader.
type RDFLoader ¶
type RDFLoader struct{}
RDFLoader stub for when rdf build tag is not present.
func NewRDFLoader ¶
func NewRDFLoader() *RDFLoader
NewRDFLoader creates a new instance of RDFLoader stub.