Closed bergos closed 8 years ago
IIRC in Fuseki the graph name is simply default
I'm not happy with a string value, because beside the default graph only IRIs are allowed for named graphs, so strings could be converted just by checking the type.
Ok I get that. true
would be fine for me
I'd rather use a specifi constant for "any graph" as "null" seems to be the most obvious choice for the unnmaed default graph of a sparql dataset.
null
is already used in the triple matcher for any value. That allows function calls like this: graph.match(subject)
to fetch all triples for a single subject. null
should be used for any value, to use the same logic in all methods. Also the default graph construct is a store specific use case. Therefore a consistent API is from my point of view more important.
I'd suggest to define an additional .defaultGraph
method and specify what stores without default graph should do (leave method undefined, invoke the callback with null/undefined?). The only entity in the specs around RDF that is similar to what Store
models is the SPARQL DataSet which has a default graph, so it seems justified to have a dedicated method for this rather than some hacks like zje proposal of using true
.
As for using null
as wildcard, I'm not sure is undefined
wouldn't be the better choice, as the arguments of .match
define filtering restriction, so "undefined" seems to be an intuitive way of saying "no restriction defined", but this if OT for this issue.
Must be defined in the RDFJS Representation Task Force spec.
Some stores may have a default graph, like the SPARQL store. Methods like
.graph
or.match
require a IRI parameter for the named graph. What value should be used for the default graph?null
is already used for any graph.true
would allow to check if the value is set and it's not astring
orRegExp
object. Are there any reasons to not usetrue
? Could it be handled in a different way?