You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: Cannot parse RDF file which contains absolute or relative URIs (ex. /void/Dataset) without specifying a base URI. It works when I use mkRdf, but not when I use parseFile.
Sample code:
{-# LANGUAGE OverloadedStrings #-}
import Data.RDF
import Text.RDF.RDF4H.TurtleParser
import Text.RDF.RDF4H.TurtleSerializer
import System.Exit
import qualified Data.Map as Map
main = do
-- mkRdf works for URIs without domain name
let t1 = Triple (unode "/void/Dataset") (unode "http://www.w3.org/1999/02/22-rdf-syntax-ns#type") (unode "http://rdfs.org/ns/void#DatasetDescription")
let triples = [t1]
let voidGraph = mkRdf triples Nothing (PrefixMappings Map.empty) :: RDF TList
putStrLn $ showGraph voidGraph
-- parseFile doesn't work for URIs without domain name
-- test.ttl contains a single RDF triple:
-- </void/Dataset> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/ns/void#DatasetDescription> .
let rdfFile = "test.ttl"
voidGraphE <- parseFile (TurtleParser Nothing Nothing) rdfFile :: IO (Either ParseFailure (RDF TList))
case voidGraphE of
Left err -> do
print err
Right graph -> do
putStrLn $ showGraph graph
Problem: Cannot parse RDF file which contains absolute or relative URIs (ex.
/void/Dataset
) without specifying a base URI. It works when I usemkRdf
, but not when I useparseFile
.Sample code:
Actual output:
Expected output:
The text was updated successfully, but these errors were encountered: