From c77d546d7f34dfddc3075db634e928da84849ae4 Mon Sep 17 00:00:00 2001 From: Keerthan Poojary Date: Fri, 11 Sep 2026 02:24:10 +0530 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75539=20[n3]?= =?UTF-8?q?=20add=20emptyFormulaAsTrue=20to=20ParserOptions=20by=20@Thunde?= =?UTF-8?q?rcloud12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/n3/index.d.ts | 2 ++ types/n3/n3-tests.ts | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/types/n3/index.d.ts b/types/n3/index.d.ts index 9b2c10dfbd4eaa..db053dd4e72cad 100644 --- a/types/n3/index.d.ts +++ b/types/n3/index.d.ts @@ -201,10 +201,12 @@ export interface ParserOptions { baseIRI?: string | undefined; blankNodePrefix?: string | undefined; isImpliedBy?: boolean | undefined; + emptyFormulaAsTrue?: boolean | undefined; } export interface StreamParserOptions extends ParserOptions { options?: boolean | undefined; + comments?: boolean | undefined; } export type ParseCallback = (error: Error, quad: Q, prefixes: Prefixes) => void; diff --git a/types/n3/n3-tests.ts b/types/n3/n3-tests.ts index 6cf4a92ef52c60..4e18683b79c5db 100644 --- a/types/n3/n3-tests.ts +++ b/types/n3/n3-tests.ts @@ -522,6 +522,16 @@ function test_parser_options() { format: "text/Turtle*", blankNodePrefix: "", }); + const parser7 = new N3.Parser({ + baseIRI: "http://example.org/", + factory: N3.DataFactory, + format: "text/n3", + blankNodePrefix: "", + emptyFormulaAsTrue: true, + }); + const streamParser = new N3.StreamParser({ + comments: true, + }); } function test_term_to_and_from_id() { From a015e2759f7011c3aabbe5308f8e37f39467c6d7 Mon Sep 17 00:00:00 2001 From: Keerthan Poojary Date: Fri, 11 Sep 2026 02:25:01 +0530 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75527=20[n3]?= =?UTF-8?q?=20add=20baseIRI=20and=20writeBase=20to=20WriterOptions=20by=20?= =?UTF-8?q?@Thundercloud12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/n3/index.d.ts | 2 ++ types/n3/n3-tests.ts | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/types/n3/index.d.ts b/types/n3/index.d.ts index db053dd4e72cad..556984cd8ec3cc 100644 --- a/types/n3/index.d.ts +++ b/types/n3/index.d.ts @@ -239,6 +239,8 @@ export interface WriterOptions { format?: string | MimeFormat | undefined; prefixes?: Prefixes | undefined; end?: boolean | undefined; + baseIRI?: string | undefined; + writeBase?: boolean | undefined; } export class Writer { diff --git a/types/n3/n3-tests.ts b/types/n3/n3-tests.ts index 4e18683b79c5db..a7abccb05af3eb 100644 --- a/types/n3/n3-tests.ts +++ b/types/n3/n3-tests.ts @@ -648,5 +648,10 @@ function test_get_rules_from_dataset() { const rules: N3.Rule[] = N3.getRulesFromDataset(store); } +function test_writer_base_iri() { + const writer1 = new N3.Writer({ baseIRI: "http://example.org/" }); + const writer2 = new N3.Writer({ baseIRI: "http://example.org/", writeBase: true }); +} + export const namedNode: ReturnType = N3.DataFactory.namedNode("hello world"); export const df: RDF.DataFactory = N3.DataFactory;