1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #ifndef _LSUP_NT_PARSER_H
- #define _LSUP_NT_PARSER_H
- #include "codec.h"
- /** @brief Parse a single term.
- *
- * @param[in] rep N-Triples representation as a character string.
- *
- * @param[in] map Unused: there is no namespace prefixing in N-triples. Kept
- * for interface compatibility. May be NULL.
- *
- * @param[out] term Term to be created from the string.
- *
- * @return LSUP_OK on success, LSUP_VALUE_ERR if the string is not valid
- * N-Triples syntax for a IRI ref, Literal or BNode.
- */
- LSUP_rc
- LSUP_nt_parse_term (const char *rep, const LSUP_NSMap *map, LSUP_Term **term);
- /** @brief Parse a N-Triples document from a file handle.
- *
- * @param[in] stream N-Triples doc file handler.
- *
- * @param[out] gr Pointer to a graph handle to be created. The new graph will
- * have a random UUID URN.
- *
- * @param[out] ct If not NULL it is populated with the number of triples
- * parsed. This may be more than the triples in the resulting graph.
- *
- * @param[out] err String handle to be populated with an error message.
- *
- * @return LSUP_OK on success, LSUP_VALUE_ERR if a parsing error was
- * encountered. On error, `err` will contain the error message.
- */
- LSUP_rc
- LSUP_nt_parse_doc (FILE *stream, LSUP_Graph **gr, size_t *ct, char **err);
- #endif
|