Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make termType values a closed set #121

Open
RubenVerborgh opened this issue Sep 21, 2017 · 6 comments
Open

Make termType values a closed set #121

RubenVerborgh opened this issue Sep 21, 2017 · 6 comments

Comments

@RubenVerborgh
Copy link
Member

Following https://lists.w3.org/Archives/Public/public-rdfjs/2017Sep/0003.html, I suggest we make the language more strict and only allow those 5 values.

@rubensworks
Copy link
Member

I propose changing the following sentence describing a Term:

Possible values include "NamedNode", "BlankNode", "Literal", "Variable" and "DefaultGraph".

to

Allowed values are "NamedNode", "BlankNode", "Literal", "Variable" and "DefaultGraph".

or

The only allowed values are "NamedNode", "BlankNode", "Literal", "Variable" and "DefaultGraph".

@elf-pavlik
Copy link
Member

To make it an absolute requirement we should define it using MUST https://tools.ietf.org/html/rfc2119

@elf-pavlik
Copy link
Member

@bergos you wrote all the WebIDL in ReSpec version, I wonder if we should use WebIDL Enumerations

enum TermType {  "NamedNode", "BlankNode", "Literal", "Variable", "DefaultGraph };
interface Term {
    attribute TermType termType;
    attribute string value;
    boolean equals(Term other);
};

@timbl
Copy link

timbl commented Dec 8, 2017

Well, what happens when you extend a term to be able to be a nested graph? Maybe add "Graph" to the list now?

@elf-pavlik
Copy link
Member

@timbl does it mean that in a Quad you would like to use a "Graph" for subject or object?
In Generalized RDF1.1 s, p, o, g can take IRI, blank node or literal

A generalized RDF triple is a triple having a subject, a predicate, and object, where each can be an IRI, a blank node or a literal. A generalized RDF graph is a set of generalized RDF triples. A generalized RDF dataset comprises a distinguished generalized RDF graph, and zero or more pairs each associating an IRI, a blank node or a literal to a generalized RDF graph.

How does a "nested graph" differ from having a graph named with IRI (NamedNode) or BlankNode and Quads just using those names to reference them instead of "nesting"?

@LaurensRietveld
Copy link

+1 to make to having a closed set.
In practice (e.g. when used in a quad), in the current spec, a term is already a closed set. See http://rdf.js.org/#quad-interface , where the quad positions are subsets of the current term types (e.g. subject is NamedNode, BlankNode or Variable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants