module UnifIn where import "TripleData" import "Utils" import "Observe" -- import "N3Prolog" must add parser to this source because of recursive def -- Author: G.Naudts. Mail: naudts_vannoten@yahoo.com. functionListUn = [] -- [n3Pro] -- first tripleset is goal; second is from db unifIn :: (Triple,Triple) -> (Triple, Triple) unifIn (t1, t2) = (t3, t4) where (t3, t4, _) = fLoop (t1, t2, functionListUn) fLoop (t1, t2, []) = (t1, t2, []) fLoop (t1, t2, functionList@(x:xs)) = fLoop (t3, t4, xs) where (t3, t4) = x (t1, t2) -- this is an implementation of a kind of prolog using the rdf inference -- engine. -- format of predicate e.g. sum(sum(4,5,A),B,X) -- use parser of N3Prolog (MP Jones) parsed = clause input -- prop1 and prop2 must both be ':predicate' --n3Pro :: (Triple,Triple) -> (Triple, Triple) --n3Pro (Triple(sub1, prop1, obj1)) (Triple(sub2, prop2, obj2)) -- where -- bv1 = tesLiteral obj1 -- bv2 = tesLiteral obj2 -- Literal l1 = obj1 -- Literal l2 = obj2 -- (_, _, r1) = parseUntil ' ' l1 -- (_, _, r2) = parseUntil ' ' l2 -- p1 = clause l1 -- p2 = clause l2