Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added Skeleton XML-RDF parser.

Ignore-this: 73fdd6c2ca9b55e5f7c30d0c4f692051

darcs-hash:20110115060231-1786f-f743f28dcbc8fb21bc851f18b58883865cd6922a.gz
  • Loading branch information...
commit 93a94da0c1e639f296a04df6c4724e22b8ad326a 1 parent 3389aea
Alex McCausland authored

Showing 2 changed files with 27 additions and 0 deletions. Show diff stats Hide diff stats

  1. +4 0 rdf4h.cabal
  2. +23 0 src/Text/RDF/RDF4H/XmlParser.hs
4 rdf4h.cabal
@@ -43,6 +43,7 @@ library
43 43 , Text.RDF.RDF4H.NTriplesSerializer
44 44 , Text.RDF.RDF4H.TurtleParser
45 45 , Text.RDF.RDF4H.TurtleSerializer
  46 + , Text.RDF.RDF4H.XmlParser
46 47 if flag(small_base)
47 48 build-depends: base >= 3, bytestring, directory, containers
48 49 else
@@ -50,6 +51,7 @@ library
50 51 build-depends: parsec >= 3 && < 3.2
51 52 , network >= 2.2.0.0 && < 2.3
52 53 , HTTP >= 4000.0.0 && < 4000.2
  54 + , hxt >= 9.0.0 && < 9.1
53 55 other-modules: Data.RDF.Utils
54 56 , Text.RDF.RDF4H.ParserUtils
55 57 , Text.RDF.RDF4H.Interact
@@ -66,6 +68,7 @@ executable rdf4h
66 68 build-depends: parsec >= 3 && < 3.2
67 69 , network >= 2.2.0.0 && < 2.3
68 70 , HTTP >= 4000.0.0 && < 4000.2
  71 + , hxt >= 9.0.0 && < 9.1
69 72 hs-source-dirs: src
70 73 extensions: BangPatterns
71 74 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
103 106 , Text.RDF.RDF4H.NTriplesSerializer
104 107 , Text.RDF.RDF4H.TurtleParser
105 108 , Text.RDF.RDF4H.TurtleSerializer
  109 + , Text.RDF.RDF4H.XmlParser
106 110 hs-source-dirs: src, testsuite/tests
23 src/Text/RDF/RDF4H/XmlParser.hs
... ... @@ -0,0 +1,23 @@
  1 +{-# LANGUAGE RankNTypes #-}
  2 +-- |An parser for the RDF/XML format
  3 +-- <http://www.w3.org/TR/REC-rdf-syntax/>.
  4 +
  5 +module Text.RDF.RDF4H.XmlParser(
  6 + parseXmlRDF
  7 +) where
  8 +
  9 +import Data.RDF
  10 +import Data.RDF.Namespace
  11 +
  12 +import Text.XML.HXT.Core
  13 +import Data.Tree.NTree.TypeDefs (NTree(..))
  14 +
  15 +import Data.ByteString.Lazy.Char8(ByteString)
  16 +
  17 +parseXmlRDF :: forall rdf. (RDF rdf)
  18 + => Maybe BaseUrl -- ^ The base URL for the RDF if required
  19 + -> Maybe ByteString -- ^ DocUrl: The request URL for the RDF if available
  20 + -> ByteString -- ^ The contents to parse
  21 + -> Either ParseFailure rdf -- ^ The RDF representation of the triples or ParseFailure
  22 +parseXmlRDF bUrl dUrl xmlStr = Left (ParseFailure "XML parsing not implemented")
  23 +

0 comments on commit 93a94da

Please sign in to comment.
Something went wrong with that request. Please try again.