diff --git a/types/n3/index.d.ts b/types/n3/index.d.ts index 9b2c10dfbd4eaa..556984cd8ec3cc 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; @@ -237,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 6cf4a92ef52c60..a7abccb05af3eb 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() { @@ -638,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;