Permalink
Browse files

Added Skeleton XML-RDF parser.

Ignore-this: 73fdd6c2ca9b55e5f7c30d0c4f692051

darcs-hash:20110115060231-1786f-f743f28dcbc8fb21bc851f18b58883865cd6922a.gz
  • Loading branch information...
1 parent 3389aea commit 93a94da0c1e639f296a04df6c4724e22b8ad326a @amccausl committed Jan 15, 2011
Showing with 27 additions and 0 deletions.
  1. +4 −0 rdf4h.cabal
  2. +23 −0 src/Text/RDF/RDF4H/XmlParser.hs
View
4 rdf4h.cabal
@@ -43,13 +43,15 @@ library
, Text.RDF.RDF4H.NTriplesSerializer
, Text.RDF.RDF4H.TurtleParser
, Text.RDF.RDF4H.TurtleSerializer
+ , Text.RDF.RDF4H.XmlParser
if flag(small_base)
build-depends: base >= 3, bytestring, directory, containers
else
build-depends: base < 3
build-depends: parsec >= 3 && < 3.2
, network >= 2.2.0.0 && < 2.3
, HTTP >= 4000.0.0 && < 4000.2
+ , hxt >= 9.0.0 && < 9.1
other-modules: Data.RDF.Utils
, Text.RDF.RDF4H.ParserUtils
, Text.RDF.RDF4H.Interact
@@ -66,6 +68,7 @@ executable rdf4h
build-depends: parsec >= 3 && < 3.2
, network >= 2.2.0.0 && < 2.3
, HTTP >= 4000.0.0 && < 4000.2
+ , hxt >= 9.0.0 && < 9.1
hs-source-dirs: src
extensions: BangPatterns
ghc-options: -O2 -Wall -fglasgow-exts -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-unused-do-bind
@@ -103,4 +106,5 @@ executable test-rdf4h
, Text.RDF.RDF4H.NTriplesSerializer
, Text.RDF.RDF4H.TurtleParser
, Text.RDF.RDF4H.TurtleSerializer
+ , Text.RDF.RDF4H.XmlParser
hs-source-dirs: src, testsuite/tests
View
23 src/Text/RDF/RDF4H/XmlParser.hs
@@ -0,0 +1,23 @@
+{-# LANGUAGE RankNTypes #-}
+-- |An parser for the RDF/XML format
+-- <http://www.w3.org/TR/REC-rdf-syntax/>.
+
+module Text.RDF.RDF4H.XmlParser(
+ parseXmlRDF
+) where
+
+import Data.RDF
+import Data.RDF.Namespace
+
+import Text.XML.HXT.Core
+import Data.Tree.NTree.TypeDefs (NTree(..))
+
+import Data.ByteString.Lazy.Char8(ByteString)
+
+parseXmlRDF :: forall rdf. (RDF rdf)
+ => Maybe BaseUrl -- ^ The base URL for the RDF if required
+ -> Maybe ByteString -- ^ DocUrl: The request URL for the RDF if available
+ -> ByteString -- ^ The contents to parse
+ -> Either ParseFailure rdf -- ^ The RDF representation of the triples or ParseFailure
+parseXmlRDF bUrl dUrl xmlStr = Left (ParseFailure "XML parsing not implemented")
+

0 comments on commit 93a94da

Please sign in to comment.