Search code examples
sparqlrdfdatalogrdfox

RDFox: The prefix name in the local IRI ':born_in' has not been bound


I have imported the following triples into RDFox v3:

@prefix : <https://oxfordsemantic.tech/> .

:charlie_chaplin a :ComicActor;
     :name "Charlie Chaplin";
     :born_in :uk .

:douglas_adams a :ComicAuthor ;
     :name "Douglas Adams";
     :born_in  :uk .

:ComicActor  :subClassOf :Comic .
:ComicAuthor :subClassOf :Comic .

When doing the following SPARQL query from the console:

SELECT ?comic
WHERE {
  ?comic :born_in :uk
}

I am getting the following error: The prefix name in the local IRI ':born_in' has not been bound.

Any tips? enter image description here


Solution

  • The IRI fragment for the prefix expansion in the input data needs to be surrouded in angle brackets.

    @prefix : <https://oxfordsemantic.tech/> .
    

    Even if that is correctly specified when the data is imported, the "default" prefix ":" has not been supplied as part of the SPARQL query. Add the following line to the query: note it is in SPARQL syntax, not Turtle.

    prefix : <https://oxfordsemantic.tech/> 
    

    The prefix specified in the Turtle input does actually have a scope beyond the initial import: if a prefix is imported as part of a file it will be available when data is imported from other files in the same shell session (even imported into other data stores).

    But unlike the imported triple data, the prefix is not stored in the active data store so is unavailable to the SPARQL console.