Search code examples
sparqlrdf

When I running gh-rdf3x engine's commend rdf3xquery It prompt:parse error: unknown prefix 'http'


I try to use gh-rdf3x engine to do some SPARQL search, so I use LUBM-100 dataset and then I use RDF2RDF tool to make all .owl file into a test.nt file. then I use gh-rdf3x command

./rdf3xload dataDB test.nt

to build a dataDB file. At last, I want to do some search so I use LUBM SPARQL#1 as test.sparql.

Then I do the command

./rdf3xquery dataDB test.sparql

It prompts

parse error: unknown prefix 'http'

I do all the thing as described in the GH-RDF3X Wiki, so I don't know why it prompt that. And the message may be from file gh-rdf3x/cts/parser/TurtleParser.cpp

Thank you for your help.


Solution

  • I guess you're using the LUBM query from this file which unfortunately contains several syntax errors.

    The first query is missing the angle brackets < and > which must be put around full URIs:

    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    PREFIX ub: <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#>
    SELECT ?X WHERE {
      ?X rdf:type ub:GraduateStudent .
      ?X ub:takesCourse <http://www.Department0.University0.edu/GraduateCourse0>
    }