diff options
author | Dave Beckett <dave@dajobe.org> | 2001-07-22 20:51:24 +0000 |
---|---|---|
committer | Dave Beckett <dave@dajobe.org> | 2001-07-22 20:51:24 +0000 |
commit | 85b18259d9135165369d9bb284d98a0ad3074bd6 (patch) | |
tree | 5f6ce6325d19d95b195af1a6f23518ba244b2091 | |
parent | 765e6dff76ec02b47dabb74805bacad8c3a8497e (diff) | |
download | raptor-85b18259d9135165369d9bb284d98a0ad3074bd6.tar.gz |
(raptor_ntriples_generate_statement): Handle _:name object stored
as strings, not URIs.
-rw-r--r-- | src/ntriples_parse.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ntriples_parse.c b/src/ntriples_parse.c index b6c502ef..2af8b54d 100644 --- a/src/ntriples_parse.c +++ b/src/ntriples_parse.c @@ -276,11 +276,13 @@ raptor_ntriples_generate_statement(raptor_ntriples_parser *parser, statement->predicate_type=RAPTOR_PREDICATE_TYPE_PREDICATE; /* Three choices for object from N-Triples */ - if((object_type == RAPTOR_NTRIPLES_TERM_TYPE_URI_REF) || - (object_type == RAPTOR_NTRIPLES_TERM_TYPE_ANON_NODE)) { + if(object_type == RAPTOR_NTRIPLES_TERM_TYPE_URI_REF) { object_uri=raptor_make_uri(parser->base_uri, object); statement->object=object_uri; - statement->object_type=(object_type == RAPTOR_NTRIPLES_TERM_TYPE_ANON_NODE) ? RAPTOR_OBJECT_TYPE_ANONYMOUS : RAPTOR_OBJECT_TYPE_RESOURCE; + statement->object_type=RAPTOR_OBJECT_TYPE_RESOURCE; + } else if(object_type == RAPTOR_NTRIPLES_TERM_TYPE_ANON_NODE) { + statement->object=object; + statement->object_type=RAPTOR_OBJECT_TYPE_ANONYMOUS; } else { statement->object_type=RAPTOR_OBJECT_TYPE_LITERAL; statement->object=object; @@ -292,7 +294,8 @@ raptor_ntriples_generate_statement(raptor_ntriples_parser *parser, /* Generate the statement; or is it fact? */ (*parser->statement_handler)(parser->user_data, statement); - RAPTOR_FREE_URI(subject_uri); + if(subject_uri) + RAPTOR_FREE_URI(subject_uri); RAPTOR_FREE_URI(predicate_uri); if(object_uri) RAPTOR_FREE_URI(object_uri); |