Skip to content

Export Quad Component Types #5

Open
@blake-regalia

Description

@blake-regalia

I'd like to propose adding simple union types for the various quad components. Generally, I am all for adding these types of semantic shortcuts that provide utility to implementations since there really is no overhead to consider. Of course though, the naming and organization of such additions is paramount.

// for 'hard' RDF 1.1 data; which excludes Quads and Variables 
export namespace Role {  // idk, it's shorter than 'Component'
   export type Subject = NamedNode | BlankNode;
   export type Predicate = NamedNode;
   export type Object = NamedNode | BlankNode | Literal;
   export type Graph = DefaultGraph | NamedNode | BlankNode;
   export type Datatype = NamedNode;
}

There could be another namespace for RDF-star, although it still seems quite uncertain to me at this point whether it will survive the standards track. IMO, Variables can be union'ed in on user-side for each of these component types.

I would also like to see Quad_Subject and the like put into a namespace, but I'm sure others had reasons for not doing that initially so I'd like to hear from them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions