Maintainer | defanor <defanor@uberspace.net> |
---|---|
Stability | unstable |
Portability | non-portable (GHC extensions are used) |
Safe Haskell | Safe |
Language | Haskell2010 |
Low-level Redland RDF library bindings, a straightforward translation.
- data RedlandWorld
- librdf_new_world :: IO (Ptr RedlandWorld)
- librdf_free_world :: Ptr RedlandWorld -> IO ()
- p_librdf_free_world :: FinalizerPtr RedlandWorld
- librdf_world_open :: Ptr RedlandWorld -> IO ()
- data RedlandHash
- librdf_new_hash :: Ptr RedlandWorld -> CString -> IO (Ptr RedlandHash)
- librdf_free_hash :: Ptr RedlandHash -> IO ()
- p_librdf_free_hash :: FinalizerPtr RedlandHash
- librdf_hash_put_strings :: Ptr RedlandHash -> CString -> CString -> IO CInt
- librdf_hash_get :: Ptr RedlandHash -> CString -> IO CString
- librdf_hash_get_del :: Ptr RedlandHash -> CString -> IO CString
- data RedlandModel
- librdf_new_model :: Ptr RedlandWorld -> Ptr RedlandStorage -> CString -> IO (Ptr RedlandModel)
- librdf_free_model :: Ptr RedlandModel -> IO ()
- p_librdf_free_model :: FinalizerPtr RedlandModel
- librdf_model_query_execute :: Ptr RedlandModel -> Ptr RedlandQuery -> IO (Ptr RedlandQueryResults)
- librdf_model_sync :: Ptr RedlandModel -> IO CInt
- librdf_model_load :: Ptr RedlandModel -> Ptr RedlandURI -> CString -> CString -> Ptr RedlandURI -> IO CInt
- librdf_model_find_statements :: Ptr RedlandModel -> Ptr RedlandStatement -> IO (Ptr RedlandStream)
- data RedlandNode
- librdf_new_node :: Ptr RedlandWorld -> IO (Ptr RedlandNode)
- librdf_free_node :: Ptr RedlandNode -> IO ()
- p_librdf_free_node :: FinalizerPtr RedlandNode
- librdf_new_node_from_node :: Ptr RedlandNode -> IO (Ptr RedlandNode)
- librdf_new_node_from_blank_identifier :: Ptr RedlandWorld -> CString -> IO (Ptr RedlandNode)
- librdf_new_node_from_literal :: Ptr RedlandWorld -> CString -> CString -> CInt -> IO (Ptr RedlandNode)
- librdf_new_node_from_typed_literal :: Ptr RedlandWorld -> CString -> CString -> Ptr RedlandURI -> IO (Ptr RedlandNode)
- librdf_new_node_from_uri :: Ptr RedlandWorld -> Ptr RedlandURI -> IO (Ptr RedlandNode)
- librdf_new_node_from_uri_string :: Ptr RedlandWorld -> CString -> IO (Ptr RedlandNode)
- librdf_node_get_blank_identifier :: Ptr RedlandNode -> IO CString
- librdf_node_get_literal_value :: Ptr RedlandNode -> IO CString
- librdf_node_get_literal_value_language :: Ptr RedlandNode -> IO CString
- librdf_node_get_literal_value_datatype_uri :: Ptr RedlandNode -> IO (Ptr RedlandURI)
- librdf_node_get_literal_value_is_wf_xml :: Ptr RedlandNode -> IO CInt
- librdf_node_get_uri :: Ptr RedlandNode -> IO (Ptr RedlandURI)
- librdf_node_is_blank :: Ptr RedlandNode -> IO CInt
- librdf_node_is_literal :: Ptr RedlandNode -> IO CInt
- librdf_node_is_resource :: Ptr RedlandNode -> IO CInt
- librdf_node_to_string :: Ptr RedlandNode -> IO CString
- data RedlandParser
- librdf_new_parser :: Ptr RedlandWorld -> CString -> CString -> Ptr RedlandURI -> IO (Ptr RedlandParser)
- librdf_free_parser :: Ptr RedlandParser -> IO ()
- p_librdf_free_parser :: FinalizerPtr RedlandParser
- librdf_parser_parse_string_into_model :: Ptr RedlandParser -> CString -> Ptr RedlandURI -> Ptr RedlandModel -> IO CInt
- librdf_parser_guess_name2 :: Ptr RedlandWorld -> CString -> CString -> CString -> IO CString
- data RedlandQuery
- librdf_new_query :: Ptr RedlandWorld -> CString -> Ptr RedlandURI -> CString -> Ptr RedlandURI -> IO (Ptr RedlandQuery)
- librdf_free_query :: Ptr RedlandQuery -> IO ()
- p_librdf_free_query :: FinalizerPtr RedlandQuery
- librdf_query_execute :: Ptr RedlandQuery -> Ptr RedlandModel -> IO (Ptr RedlandQueryResults)
- data RedlandQueryResults
- librdf_free_query_results :: Ptr RedlandQueryResults -> IO ()
- p_librdf_free_query_results :: FinalizerPtr RedlandQueryResults
- librdf_query_results_get_count :: Ptr RedlandQueryResults -> IO CInt
- librdf_query_results_next :: Ptr RedlandQueryResults -> IO CInt
- librdf_query_results_finished :: Ptr RedlandQueryResults -> IO CInt
- librdf_query_results_get_binding_value :: Ptr RedlandQueryResults -> CInt -> IO (Ptr RedlandNode)
- librdf_query_results_get_binding_name :: Ptr RedlandQueryResults -> CInt -> IO CString
- librdf_query_results_get_binding_value_by_name :: Ptr RedlandQueryResults -> CString -> IO (Ptr RedlandNode)
- librdf_query_results_get_bindings_count :: Ptr RedlandQueryResults -> IO CInt
- data RedlandStatement
- librdf_new_statement :: Ptr RedlandWorld -> IO (Ptr RedlandStatement)
- librdf_free_statement :: Ptr RedlandStatement -> IO ()
- p_librdf_free_statement :: FinalizerPtr RedlandStatement
- librdf_new_statement_from_nodes :: Ptr RedlandWorld -> Ptr RedlandNode -> Ptr RedlandNode -> Ptr RedlandNode -> IO (Ptr RedlandStatement)
- librdf_new_statement_from_statement :: Ptr RedlandStatement -> IO (Ptr RedlandStatement)
- librdf_statement_get_subject :: Ptr RedlandStatement -> IO (Ptr RedlandNode)
- librdf_statement_set_subject :: Ptr RedlandStatement -> Ptr RedlandNode -> IO ()
- librdf_statement_get_predicate :: Ptr RedlandStatement -> IO (Ptr RedlandNode)
- librdf_statement_set_predicate :: Ptr RedlandStatement -> Ptr RedlandNode -> IO ()
- librdf_statement_get_object :: Ptr RedlandStatement -> IO (Ptr RedlandNode)
- librdf_statement_set_object :: Ptr RedlandStatement -> Ptr RedlandNode -> IO ()
- data RedlandStorage
- librdf_new_storage :: Ptr RedlandWorld -> CString -> CString -> CString -> IO (Ptr RedlandStorage)
- librdf_free_storage :: Ptr RedlandStorage -> IO ()
- p_librdf_free_storage :: FinalizerPtr RedlandStorage
- librdf_new_storage_with_options :: Ptr RedlandWorld -> CString -> CString -> Ptr RedlandHash -> IO (Ptr RedlandStorage)
- data RedlandStream
- librdf_free_stream :: Ptr RedlandStream -> IO ()
- p_librdf_free_stream :: FinalizerPtr RedlandStream
- librdf_stream_end :: Ptr RedlandStream -> IO CInt
- librdf_stream_next :: Ptr RedlandStream -> IO CInt
- librdf_stream_get_object :: Ptr RedlandStream -> IO (Ptr RedlandStatement)
- data RedlandURI
- librdf_new_uri :: Ptr RedlandWorld -> CString -> IO (Ptr RedlandURI)
- librdf_free_uri :: Ptr RedlandURI -> IO ()
- p_librdf_free_uri :: FinalizerPtr RedlandURI
- librdf_new_uri_from_uri :: Ptr RedlandURI -> IO (Ptr RedlandURI)
- librdf_uri_as_string :: Ptr RedlandURI -> IO CString
World
data RedlandWorld Source #
librdf_new_world :: IO (Ptr RedlandWorld) Source #
librdf_free_world :: Ptr RedlandWorld -> IO () Source #
librdf_world_open :: Ptr RedlandWorld -> IO () Source #
Hashes
data RedlandHash Source #
:: Ptr RedlandWorld | world |
-> CString | name |
-> IO (Ptr RedlandHash) |
librdf_free_hash :: Ptr RedlandHash -> IO () Source #
:: Ptr RedlandHash | hash |
-> CString | key |
-> IO CString | must be freed by the caller |
:: Ptr RedlandHash | hash |
-> CString | key |
-> IO CString | must be freed by the caller |
RDF Graph (librdf_model)
data RedlandModel Source #
:: Ptr RedlandWorld | world |
-> Ptr RedlandStorage | storage |
-> CString | options |
-> IO (Ptr RedlandModel) |
librdf_free_model :: Ptr RedlandModel -> IO () Source #
librdf_model_query_execute Source #
:: Ptr RedlandModel | model |
-> Ptr RedlandQuery | query |
-> IO (Ptr RedlandQueryResults) | NULL on failure |
librdf_model_sync :: Ptr RedlandModel -> IO CInt Source #
:: Ptr RedlandModel | |
-> Ptr RedlandURI | source URI |
-> CString | parser name, can be NULL |
-> CString | MIME type, can be NULL |
-> Ptr RedlandURI | type URI, can be NULL |
-> IO CInt |
librdf_model_find_statements :: Ptr RedlandModel -> Ptr RedlandStatement -> IO (Ptr RedlandStream) Source #
RDF term (librdf_node)
data RedlandNode Source #
librdf_new_node :: Ptr RedlandWorld -> IO (Ptr RedlandNode) Source #
librdf_free_node :: Ptr RedlandNode -> IO () Source #
librdf_new_node_from_node Source #
:: Ptr RedlandNode | old node |
-> IO (Ptr RedlandNode) |
librdf_new_node_from_blank_identifier Source #
:: Ptr RedlandWorld | |
-> CString | blank node identifier, can be NULL |
-> IO (Ptr RedlandNode) |
librdf_new_node_from_literal Source #
:: Ptr RedlandWorld | |
-> CString | string value |
-> CString | literal XML language, can be NULL |
-> CInt | non-zero if literal is XML |
-> IO (Ptr RedlandNode) |
librdf_new_node_from_typed_literal Source #
:: Ptr RedlandWorld | |
-> CString | string value |
-> CString | literal XML language, can be NULL |
-> Ptr RedlandURI | typed literal datatype URI, can be NULL |
-> IO (Ptr RedlandNode) |
librdf_new_node_from_uri :: Ptr RedlandWorld -> Ptr RedlandURI -> IO (Ptr RedlandNode) Source #
librdf_new_node_from_uri_string :: Ptr RedlandWorld -> CString -> IO (Ptr RedlandNode) Source #
librdf_node_get_blank_identifier Source #
:: Ptr RedlandNode | |
-> IO CString | identifier |
librdf_node_get_literal_value Source #
:: Ptr RedlandNode | |
-> IO CString | Literal value, must be copied |
librdf_node_get_literal_value_language Source #
:: Ptr RedlandNode | |
-> IO CString | Literal language value, must be copied |
librdf_node_get_literal_value_datatype_uri Source #
:: Ptr RedlandNode | |
-> IO (Ptr RedlandURI) | Literal datatype URI, must be copied |
librdf_node_get_literal_value_is_wf_xml Source #
:: Ptr RedlandNode | |
-> IO CInt | 0 if it's not well formed XML |
:: Ptr RedlandNode | |
-> IO (Ptr RedlandURI) | URI, must be copied |
librdf_node_is_blank :: Ptr RedlandNode -> IO CInt Source #
Parsers
data RedlandParser Source #
:: Ptr RedlandWorld | world |
-> CString | name |
-> CString | MIME type |
-> Ptr RedlandURI | type URI |
-> IO (Ptr RedlandParser) |
librdf_free_parser :: Ptr RedlandParser -> IO () Source #
librdf_parser_parse_string_into_model Source #
:: Ptr RedlandParser | parser |
-> CString | string to parse |
-> Ptr RedlandURI | base URI |
-> Ptr RedlandModel | model |
-> IO CInt | non-zero on failure |
Querying
data RedlandQuery Source #
:: Ptr RedlandWorld | |
-> CString | language name |
-> Ptr RedlandURI | language URI (can be NULL) |
-> CString | query string |
-> Ptr RedlandURI | base URI (can be NULL) |
-> IO (Ptr RedlandQuery) |
librdf_free_query :: Ptr RedlandQuery -> IO () Source #
:: Ptr RedlandQuery | query |
-> Ptr RedlandModel | model |
-> IO (Ptr RedlandQueryResults) | NULL on failure |
Query results
data RedlandQueryResults Source #
librdf_free_query_results :: Ptr RedlandQueryResults -> IO () Source #
librdf_query_results_get_binding_value Source #
:: Ptr RedlandQueryResults | results |
-> CInt | offset |
-> IO (Ptr RedlandNode) |
librdf_query_results_get_binding_name Source #
:: Ptr RedlandQueryResults | results |
-> CInt | offset |
-> IO CString |
librdf_query_results_get_binding_value_by_name Source #
:: Ptr RedlandQueryResults | results |
-> CString | variable name |
-> IO (Ptr RedlandNode) |
RDF Triple (librdf_statement)
data RedlandStatement Source #
librdf_free_statement :: Ptr RedlandStatement -> IO () Source #
librdf_new_statement_from_nodes :: Ptr RedlandWorld -> Ptr RedlandNode -> Ptr RedlandNode -> Ptr RedlandNode -> IO (Ptr RedlandStatement) Source #
"The node objects become owned by the new statement (or freed on error)."
librdf_statement_get_subject Source #
:: Ptr RedlandStatement | |
-> IO (Ptr RedlandNode) | the returned node is shared, should be copied |
librdf_statement_set_subject Source #
:: Ptr RedlandStatement | |
-> Ptr RedlandNode | becomes owned by the statement |
-> IO () |
librdf_statement_set_predicate :: Ptr RedlandStatement -> Ptr RedlandNode -> IO () Source #
librdf_statement_set_object :: Ptr RedlandStatement -> Ptr RedlandNode -> IO () Source #
Triple stores
data RedlandStorage Source #
:: Ptr RedlandWorld | world |
-> CString | storage type name (e.g., "hashes") |
-> CString | storage identifier |
-> CString | options |
-> IO (Ptr RedlandStorage) |
librdf_free_storage :: Ptr RedlandStorage -> IO () Source #
librdf_new_storage_with_options Source #
:: Ptr RedlandWorld | world |
-> CString | storage type name (e.g., "hashes") |
-> CString | storage identifier |
-> Ptr RedlandHash | options |
-> IO (Ptr RedlandStorage) |
Stream of triples (librdf_statement)
data RedlandStream Source #
librdf_free_stream :: Ptr RedlandStream -> IO () Source #
librdf_stream_end :: Ptr RedlandStream -> IO CInt Source #
librdf_stream_next :: Ptr RedlandStream -> IO CInt Source #
librdf_stream_get_object Source #
:: Ptr RedlandStream | |
-> IO (Ptr RedlandStatement) | a shared statement, should be copied |
URI
data RedlandURI Source #
:: Ptr RedlandWorld | world |
-> CString | URI string |
-> IO (Ptr RedlandURI) |
librdf_free_uri :: Ptr RedlandURI -> IO () Source #
librdf_new_uri_from_uri Source #
:: Ptr RedlandURI | old URI |
-> IO (Ptr RedlandURI) |