From 47a1b35ba153c661a1579e9f17a5a822d2433a97 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Mon, 18 Nov 2024 21:29:00 +0000 Subject: [PATCH] feat: add triple term names --- README.md | 8 ++++++++ query/common.d.ts | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 414c44c..0e9445f 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,14 @@ import type { DatasetCore } from '@rdfjs/types/dataset' import type { Stream } from '@rdfjs/types/stream' `````` +## Helper Terms + +Note that some helper types exist that do not exist within the RDF/JS specifications. These include: + +```typescript +import type { TripleTermName, QuadTermName } from '@rdfjs/types' +``` + ## Contributing Everyone is invited to open issues and pull requests. When you create a PR, please add or update the `rdf-js-tests.ts` file to reflect your changes. diff --git a/query/common.d.ts b/query/common.d.ts index f2a63cf..00e007b 100644 --- a/query/common.d.ts +++ b/query/common.d.ts @@ -4,10 +4,15 @@ import { EventEmitter } from "events"; import * as RDF from '../data-model'; +/** + * Helper union type for triple term names. + */ +export type TripleTermName = 'subject' | 'predicate' | 'object'; + /** * Helper union type for quad term names. */ -export type QuadTermName = 'subject' | 'predicate' | 'object' | 'graph'; +export type QuadTermName = TripleTermName | 'graph'; // TODO: merge this with Stream upon the next major change /**