Commits

Doug Burke committed 799319f

SPARQL: metadata about graphs now stored in a named graph (urn:graph-metadata) rather than default graph

Comments (0)

Files changed (1)

          , makeQuery'
          , queryStore
          , fromStores
+         , graphMetadata
        ) where
 
 import qualified Data.Text as T
                  
     Right rs -> return $ mapMaybe f rs
 
-{-  
+{-|  
 Find all the named graphs which contain tweet data
 within the endpoint. Returns a list of URIs.
+
+This assumes that the graph metadata is in the store with
+the name `graphMetadata`.
 -}
+
+graphMetadata :: NamedGraph
+graphMetadata = "urn:graph-metadata"
+
 queryStore :: String -> IO [NamedGraph]
 queryStore endpoint = 
   makeQuery getNG endpoint
-  "SELECT ?gr { ?gr a <http://purl.org/net/djburke/demo/twitter#TweetStore> . }"
+  $ "SELECT ?gr " ++ fromStores [graphMetadata] ++ " { ?gr a <http://purl.org/net/djburke/demo/twitter#TweetStore> . }"
 
 getNG :: [BindingValue] -> Maybe NamedGraph
 getNG [URI u] = Just u