Matt wrote:
> QUERY1: This gives an error. Encountered "<VAR> ?parent at line 2 was
> expecting...." However, according to SPARQL standard as I've read it,
> this is permissible.
> SELECT ?child ?title
> WHERE {
> ?child :isAlive :Living; :hasAge 10.
> ?parent :hasChild ?child; :reads ?book.
> ?book sods:hasTitle ?title.
> }
>
>
The problem is rather silly; 10. could be a number in its own right,
in decimal form. That means you are missing the terminal period.
Change it to
SELECT ?child ?title
WHERE {
?child :isAlive :Living; :hasAge 10 .
?parent :hasChild ?child; :reads ?book.
?book sods:hasTitle ?title.
}
and it works.
What did I change? Look closely . . . . I put a space before the
trailing period. This makes it syntactically clear that 10 is an
integer, and the period terminates the triple pattern.
I consider it good practice when typing SPARQL to put a space before
terminal periods in all cases, so I would actually write this query as
follows:
SELECT ?child ?title
WHERE {
?child :isAlive :Living ; :hasAge 10 .
?parent :hasChild ?child ; :reads ?book .
?book sods:hasTitle ?title .
}
This helps the parsers out a bit.
> QUERY2: This works.
> SELECT ?child ?title
> WHERE {
> ?parent :hasChild ?child; :reads ?book.
> ?book sods:hasTitle ?title.
> ?child :isAlive :Living; :hasAge 10.
> }
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TopBraid Composer Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---