From 1644a72d32fec7833c9f487e9ed9b99e303fc015 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 28 Jun 2021 19:25:30 -0400 Subject: Remove support for Turtle named inline nodes extension --- src/n3.c | 21 --------------------- src/writer.c | 36 ++++++------------------------------ 2 files changed, 6 insertions(+), 51 deletions(-) (limited to 'src') diff --git a/src/n3.c b/src/n3.c index 33828258..101768bc 100644 --- a/src/n3.c +++ b/src/n3.c @@ -1057,22 +1057,6 @@ read_BLANK_NODE_LABEL(SerdReader* const reader, return SERD_SUCCESS; } -static Ref -read_blankName(SerdReader* const reader) -{ - eat_byte_safe(reader, '='); - if (eat_byte_check(reader, '=') != '=') { - r_err(reader, SERD_ERR_BAD_SYNTAX, "expected `='\n"); - return 0; - } - - Ref subject = 0; - bool ate_dot = false; - read_ws_star(reader); - read_iri(reader, &subject, &ate_dot); - return subject; -} - static SerdStatus read_anon(SerdReader* const reader, ReadContext ctx, @@ -1086,11 +1070,6 @@ read_anon(SerdReader* const reader, *ctx.flags |= (subject) ? SERD_EMPTY_S : SERD_EMPTY_O; } else { *ctx.flags |= (subject) ? SERD_ANON_S_BEGIN : SERD_ANON_O_BEGIN; - if (peek_delim(reader, '=')) { - if (!(*dest = read_blankName(reader)) || !eat_delim(reader, ';')) { - return SERD_ERR_BAD_SYNTAX; - } - } } if (!*dest) { diff --git a/src/writer.c b/src/writer.c index 6e49156a..d208a1cf 100644 --- a/src/writer.c +++ b/src/writer.c @@ -565,20 +565,13 @@ is_name(const uint8_t* buf, const size_t len) } static bool -write_uri_node(SerdWriter* const writer, - const SerdNode* node, - const Field field, - const SerdStatementFlags flags) +write_uri_node(SerdWriter* const writer, + const SerdNode* node, + const Field field) { SerdNode prefix; SerdChunk suffix; - if (is_inline_start(writer, field, flags)) { - ++writer->indent; - write_sep(writer, SEP_ANON_BEGIN); - sink("== ", 3, writer); - } - const bool has_scheme = serd_uri_string_has_scheme(node->buf); if (supports_abbrev(writer)) { if (field == FIELD_PREDICATE && @@ -632,19 +625,11 @@ write_uri_node(SerdWriter* const writer, } write_sep(writer, SEP_URI_END); - if (is_inline_start(writer, field, flags)) { - sink(" ;", 2, writer); - write_newline(writer); - } - return true; } static bool -write_curie(SerdWriter* const writer, - const SerdNode* node, - const Field field, - const SerdStatementFlags flags) +write_curie(SerdWriter* const writer, const SerdNode* const node) { SerdChunk prefix = {NULL, 0}; SerdChunk suffix = {NULL, 0}; @@ -664,16 +649,7 @@ write_curie(SerdWriter* const writer, break; case SERD_TURTLE: case SERD_TRIG: - if (is_inline_start(writer, field, flags)) { - ++writer->indent; - write_sep(writer, SEP_ANON_BEGIN); - sink("== ", 3, writer); - } write_lname(writer, node->buf, node->n_bytes); - if (is_inline_start(writer, field, flags)) { - sink(" ;", 2, writer); - write_newline(writer); - } } return true; @@ -741,10 +717,10 @@ write_node(SerdWriter* writer, ret = write_literal(writer, node, datatype, lang, flags); break; case SERD_URI: - ret = write_uri_node(writer, node, field, flags); + ret = write_uri_node(writer, node, field); break; case SERD_CURIE: - ret = write_curie(writer, node, field, flags); + ret = write_curie(writer, node); break; case SERD_BLANK: ret = write_blank(writer, node, field, flags); -- cgit v1.2.1