From 9d27bde64f8eba95201e3123a537963a4ea8271d Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Thu, 9 Nov 2023 14:19:53 +0200 Subject: [PATCH 1/3] Add optional direction for literals --- data-model.d.ts | 28 ++++++++++++++++++++-------- rdf-js-tests.ts | 7 +++++++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/data-model.d.ts b/data-model.d.ts index 6fff406..e0ad372 100644 --- a/data-model.d.ts +++ b/data-model.d.ts @@ -73,6 +73,10 @@ export interface Literal { * @link http://tools.ietf.org/html/bcp47 */ language: string; + /** + * the direction of the language-tagged string. + */ + direction?: 'ltr' | 'rtl' | ''; /** * A NamedNode whose IRI represents the datatype of the literal. */ @@ -81,7 +85,7 @@ export interface Literal { /** * @param other The term to compare with. * @return True if and only if other has termType "Literal" - * and the same `value`, `language`, and `datatype`. + * and the same `value`, `language`, `direction`, and `datatype`. */ equals(other: Term | null | undefined): boolean; } @@ -254,16 +258,19 @@ export interface DataFactory {}; From 5eb5b3f4cf882656c023477409db0fafe170e100 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Thu, 9 Nov 2023 14:24:33 +0200 Subject: [PATCH 2/3] Add changeset --- .changeset/famous-parrots-rush.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/famous-parrots-rush.md diff --git a/.changeset/famous-parrots-rush.md b/.changeset/famous-parrots-rush.md new file mode 100644 index 0000000..61eaa41 --- /dev/null +++ b/.changeset/famous-parrots-rush.md @@ -0,0 +1,5 @@ +--- +"@rdfjs/types": minor +--- + +Add optional direction for literals From 14f33a2ac02fa48b9a3a4c0716ca6d06667e57bf Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Thu, 9 Nov 2023 17:22:30 +0200 Subject: [PATCH 3/3] Also allow null directions --- data-model.d.ts | 4 ++-- rdf-js-tests.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data-model.d.ts b/data-model.d.ts index e0ad372..78c1f28 100644 --- a/data-model.d.ts +++ b/data-model.d.ts @@ -76,7 +76,7 @@ export interface Literal { /** * the direction of the language-tagged string. */ - direction?: 'ltr' | 'rtl' | ''; + direction?: 'ltr' | 'rtl' | '' | null; /** * A NamedNode whose IRI represents the datatype of the literal. */ @@ -298,5 +298,5 @@ export interface DataFactory