Hello, I loaded the following file ttl file in Sesame:

# filename: ex074.ttl @prefix dc: http://purl.org/dc/elements/1.1/ . @prefix rdfs: http://www.w3.org/2000/01/rdf-schema# . @prefix c: http://learningsparql.com/ns/citations# . @prefix : http://learningsparql.com/ns/papers# . :paperA dc:title "Paper A". :paperB rdfs:label "Paper B"; c:cites :paperA . :paperC c:cites :paperA . :paperD c:cites :paperA , :paperB . :paperE c:cites :paperA . :paperF c:cites :paperC , :paperE . :paperG c:cites :paperC , :paperE . :paperH c:cites :paperD . :paperI c:cites :paperF , :paperG .

When I run the following query:

PREFIX dc: http://purl.org/dc/elements/1/ . PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema# . prefix c: http://learningsparql.com/ns/citations# . prefix : http://learningsparql.com/ns/papers# .

select * {?s ?p ?o}

I get this error: Encountered " "." ". "" at line 1, column 45. Was expecting one of: "base" ... "prefix" ... "select" ... "construct" ... "describe" ... "ask" ...

What am I doing wrong? Plz help. Thanks.

asked 02 Oct '13, 16:35

Vijender%20Singh%20Aswal's gravatar image

Vijender Sin...
16112
accept rate: 0%


In the question text such as you posted it, the angle brackets ('<' and '>') around the URIs in your prefix declarations are missing, but I suspect that that is caused by a copy-paste problem, and that your actual query looks like this:

PREFIX dc: <http://purl.org/dc/elements/1/> .
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
prefix c: <http://learningsparql.com/ns/citations#> .
prefix : <http://learningsparql.com/ns/papers#> .

select * {?s ?p ?o}

The problem is the trailing dot ('.') behind each prefix declaration - this is not allowed in SPARQL. Just modify your query to this:

PREFIX dc: <http://purl.org/dc/elements/1/> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
prefix c: <http://learningsparql.com/ns/citations#> 
prefix : <http://learningsparql.com/ns/papers#>

select * {?s ?p ?o}

and it should work fine.

link

answered 02 Oct '13, 16:42

Jeen%20Broekstra's gravatar image

Jeen Broekstra
14611
accept rate: 66%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×18

Asked: 02 Oct '13, 16:35

Seen: 8,076 times

Last updated: 02 Oct '13, 16:42

powered by BitNami OSQA