aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-06-28 19:25:30 -0400
committerDavid Robillard <d@drobilla.net>2023-04-06 07:19:11 -0400
commitc852ef7fbfaf00189f771f0163d796b0b73437ca (patch)
tree919fe138158963a427c2c634bb7c4524136cb430
parent7935250bb40dda6d3f66c99b70ba92a3ff942832 (diff)
downloadserd-c852ef7fbfaf00189f771f0163d796b0b73437ca.tar.gz
serd-c852ef7fbfaf00189f771f0163d796b0b73437ca.tar.bz2
serd-c852ef7fbfaf00189f771f0163d796b0b73437ca.zip
Remove support for writing Turtle named inline nodes extension
-rw-r--r--NEWS1
-rw-r--r--src/writer.c36
-rw-r--r--test/extra/pretty/ext-named-blank.ttl11
-rw-r--r--test/extra/pretty/manifest.ttl7
4 files changed, 7 insertions, 48 deletions
diff --git a/NEWS b/NEWS
index cf4c0008..7a105e1c 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,7 @@ serd (0.31.1) unstable; urgency=medium
* Improve writer error handling
* Make URI writing stricter by default
* Override pkg-config dependency within meson
+ * Remove support for writing Turtle named inline nodes extension
* Replace duplicated dox_to_sphinx script with sphinxygen dependency
* Test header for warnings more strictly
* Update standard test suites
diff --git a/src/writer.c b/src/writer.c
index 8fdca6f9..cdd925d7 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -592,21 +592,14 @@ is_name(const uint8_t* buf, const size_t len)
}
SERD_NODISCARD static SerdStatus
-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)
{
SerdStatus st = SERD_SUCCESS;
SerdNode prefix = SERD_NODE_NULL;
SerdChunk suffix = {NULL, 0U};
- if (is_inline_start(writer, field, flags)) {
- ++writer->indent;
- TRY(st, write_sep(writer, SEP_ANON_BEGIN));
- TRY(st, esink("== ", 3, writer));
- }
-
const bool has_scheme = serd_uri_string_has_scheme(node->buf);
if (supports_abbrev(writer)) {
if (field == FIELD_PREDICATE &&
@@ -659,19 +652,11 @@ write_uri_node(SerdWriter* const writer,
}
TRY(st, esink(">", 1, writer));
- if (is_inline_start(writer, field, flags)) {
- TRY(st, esink(" ;", 2, writer));
- TRY(st, write_newline(writer));
- }
-
return SERD_SUCCESS;
}
SERD_NODISCARD static SerdStatus
-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};
@@ -693,16 +678,7 @@ write_curie(SerdWriter* const writer,
write_uri(writer, suffix.buf, suffix.len);
TRY(st, esink(">", 1, writer));
} else {
- if (is_inline_start(writer, field, flags)) {
- ++writer->indent;
- TRY(st, write_sep(writer, SEP_ANON_BEGIN));
- TRY(st, esink("== ", 3, writer));
- }
write_lname(writer, node->buf, node->n_bytes);
- if (is_inline_start(writer, field, flags)) {
- TRY(st, esink(" ;", 2, writer));
- TRY(st, write_newline(writer));
- }
}
return st;
@@ -772,10 +748,10 @@ write_node(SerdWriter* writer,
st = write_literal(writer, node, datatype, lang, flags);
break;
case SERD_URI:
- st = write_uri_node(writer, node, field, flags);
+ st = write_uri_node(writer, node, field);
break;
case SERD_CURIE:
- st = write_curie(writer, node, field, flags);
+ st = write_curie(writer, node);
break;
case SERD_BLANK:
st = write_blank(writer, node, field, flags);
diff --git a/test/extra/pretty/ext-named-blank.ttl b/test/extra/pretty/ext-named-blank.ttl
deleted file mode 100644
index 807d6313..00000000
--- a/test/extra/pretty/ext-named-blank.ttl
+++ /dev/null
@@ -1,11 +0,0 @@
-@prefix eg: <http://example.org/> .
-
-eg:s
- eg:p1 [
- == <http://example.com/vocab#SomeClass> ;
- eg:name "object"
- ] ;
- eg:p2 [
- == eg:o ;
- eg:name "o"
- ] .
diff --git a/test/extra/pretty/manifest.ttl b/test/extra/pretty/manifest.ttl
index 69b951af..6921b741 100644
--- a/test/extra/pretty/manifest.ttl
+++ b/test/extra/pretty/manifest.ttl
@@ -17,7 +17,6 @@
<#empty-list-object>
<#empty-list-subject>
<#empty-list-subject-and-object>
- <#ext-named-blank>
<#graph-abbreviation>
<#inline-blank-subject>
<#inline-blanks-and-lists>
@@ -98,12 +97,6 @@
mf:name "empty-list-subject-and-object" ;
mf:result <empty-list-subject-and-object.ttl> .
-<#ext-named-blank>
- a rdft:TestTurtleEval ;
- mf:action <ext-named-blank.ttl> ;
- mf:name "ext-named-blank" ;
- mf:result <ext-named-blank.ttl> .
-
<#graph-abbreviation>
a rdft:TestTrigEval ;
mf:action <graph-abbreviation.trig> ;