Prefix namespace not showing in results, only full URI namespace

Original mailing list message:

Hi Guys,

When I make a SPARQL query in Stardog for some reason the 
prefix is not used, and the whole URI is shown? 

In my 'database namespaces' the prefix I am referring to is defined. 
Also in the Query page under 'prefixes' the prefix is there. But 
when getting my results it does not appear. 

Hi Arbaz,

Are you running these SPARQL queries via the web console, CLI, or some other method? Are the prefixes showing as defined if you run stardog namespace list <myDb> on the CLI?

Yes, I just ran that in CLI and it is there.

Oh and I am running my queries in the web console :slight_smile:

Are you able to send/attach a minimal dataset and query that reproduces this?

In my graph turtle model this is a part of the data:

@prefix ifcowl: http://www.buildingsmart-tech.org/ifcOWL/IFC2X3_TC1# .
@prefix inst: http://linkedbuildingdata.net/ifc/resources20160114_172659/ .

inst:IfcWindow_226 rdf:type ifcowl:IfcWindow .

So in Stardog web console I run the following:

As you can see the full URI is given in the results. This is not a problem as such. I am just curious as to why this happens. Because I have tried other graphs where this is not the case.

Hi Arbaz,

The prefix you have in the database (the screenshot showing the namespaces) is different from the inst: prefix in your query:

DB:

http://linkedbuildingdata.net/ifc/resources20161101_112954/

Query:

@prefix inst: http://linkedbuildingdata.net/ifc/resources20160114_172659/ .

Jess

2 Likes

Thanks jess!

I believed that when sending a graph to my database via CLI the prefixes would be registrered automatically? Because the prefix in my Stardog server i sent through CLI interface because it wouldnt record if I just add a graph to my database.

The set of namespaces in the database generally has to be managed explicitly. They are only added automatically when bulk loading RDF files during database creation.

Jess

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.