79.7k views
0 votes
Is whitespace a concern in SPARQL syntax?

a) Yes, excessive whitespace can lead to syntax errors.
b) No, SPARQL ignores all whitespace characters.
c) Whitespace only matters within string literals.
d) SPARQL syntax is not sensitive to whitespace.

User Izikandrw
by
7.7k points

1 Answer

0 votes

Final answer:

Whitespace is a concern in SPARQL syntax because excessive whitespace can lead to syntax errors.

SPARQL syntax is not sensitive to all whitespace characters, but it does have specific rules about whitespace usage. Whitespace matters within string literals and may affect the interpretation of the query.

Therefore, the correct answer is: option a) Yes, excessive whitespace can lead to syntax errors.

Step-by-step explanation:

A SPARQL query consists of a set of triple patterns in which each element (the subject, predicate and object) can be a variable (wildcard). Solutions to the variables are then found by matching the patterns in the query to triples in the dataset.

Whitespace is a concern in SPARQL syntax because excessive whitespace can lead to syntax errors.

SPARQL syntax is not sensitive to all whitespace characters, but it does have specific rules about whitespace usage. Whitespace matters within string literals and may affect the interpretation of the query.

For example, consider the query:

SELECT ?name WHERE { ?person foaf:name ?name }

If there is an extra space between 'foaf:name' and '?name' like this:

SELECT ?name WHERE { ?person foaf:name ?name }

The query will result in a syntax error.

User Chris Bednarski
by
8.2k points