data-model-spec
data-model-spec copied to clipboard
Make termType values a closed set
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.
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".
To make it an absolute requirement we should define it using MUST https://tools.ietf.org/html/rfc2119
@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);
};
Well, what happens when you extend a term to be able to be a nested graph? Maybe add "Graph" to the list now?
@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"?
+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
)