W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > July 2012

SPARQL BINDING/VALUES Keyword

From: James Leigh <james@3roundstones.com>
Date: Fri, 06 Jul 2012 08:35:01 -0400
Message-ID: <1341578101.1955.2.camel@james-PBL21>
To: public-rdf-dawg-comments <public-rdf-dawg-comments@w3.org>
Hello all,

I think it would improve the readability of SPARQL 1.1 if the new
in-line data keyword was an English verb.

It is generally common practise to use noun, noun phrase, or an
adjective for variable names. Languages that also use verbs, verb
phrases, adverb, adjective, conjunction, and preposition as keywords
makes the language easier to read as the mix of nouns and verbs more
closely reflects the syntax of the English language (among many others).

Instead of a noun like BINDINGS/VALUES/DATA/TABLE/VAR consider using a
verb like the following.

CHAIN
CONFINE
CONSTRAIN
FORCE
GIVEN
HEM IN
HOGTIE
INHIBIT
LET
LINK
MAKE
MODERATE
ONE OF
PASS
PERMIT
PIN DOWN
REGULATE
RESTRAIN
RESTRICT
RESTRICT TO
SHELL OUT
THROW IN
TIE

By using verbs, SPARQL reads a little more like an English sentence.

SELECT ?theBook ?theVersion
WHERE {
      ?theBook dcterms:hasVersion ?theVersion
      GIVEN ?theBook { :b1 :b2 }
}

The above query could be read almost as: "Select the book and the
version, where the book has that version, given the books b1 and b2",
which is a valid English sentence. However, if the keyword GIVEN was
replaced with a noun, the reader would trip over the three nouns in a
row (i.e. ?theVersion VALUES ?theBook).


SPARQL has a few noun keywords:
PREFIX	GRAPH	SERVICE	UNION


However, SPARQL uses many more verbs (or verb phrases) as keywords:

ADD	ASK	BIND	CONSTRUCT	COPY	CREATE	DELETE
DELETE DATA	DESCRIBE	DROP	EXISTS	FILTER	GROUP BY
HAVING	INSERT	INSERT DATA	LIMIT	LOAD	MOVE	NAMED
OFFSET	ORDER BY	REDUCED	SELECT	USING

Therefore SPARQL 1.1 could better be read by new comers by using verbs
for keywords to join variables. Please consider using a verb for the new
in-line data keyword.

Regards,
James
Received on Friday, 6 July 2012 12:35:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 6 July 2012 12:35:31 GMT