Hi Andy, thanks for the response. I have put off answering because I can't
get to http://openjena.org/TDB/ to see if the RDF description of the triple
store I used with tdbloader to create the database is where I can define a
model as you describe. So my response below is even more un-informed than I
would like.

I can add the prefix declaration to the query and that works when I submit
directly to the Fuseki server, e.g.:

curl 'http://localhost:3030/nalt/query?query=PREFIX+skos:+<
http://www.w3.org/2004/02/skos/core%23>+DESCRIBE+<
http://lod.nal.usda.gov/nalt/2111>'

But I can't figure out how to do that in my Apache frontend because
mod_rewrite insists on escaping the trailing hash in the prefix IRI.

So I am going to have to look into the model suggestion you made, although I
admit I need to learn what that means exactly.

My triple store was loaded from a SKOS file that looks like this:

<rdf:RDF
   xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#";
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
    xmlns:skos="http://www.w3.org/2004/02/skos/core#";>

<skos:Concept rdf:about="http://lod.nal.usda.gov/nalt/907";>
<skos:prefLabel xml:lang="en">(s)-2-hydroxy-acid oxidase</skos:prefLabel>
<skos:altLabel xml:lang="en">EC 1.1.3.15</skos:altLabel>
<skos:broader rdf:resource="http://lod.nal.usda.gov/nalt/912"/>
</skos:Concept>

I tried using an RDF description of the triple store that declared the
namespace but that didn't help (is this a model?):

@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#> .

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

<#dataset> rdf:type      tdb:DatasetTDB ;
     tdb:location "/usr/local/jena/NALTDB" ;
    .

Can I modify the .ttl file to declare the namespace prefix to be used by the
Fuseki SPARQL server without the prefix being explicitly declared in the
query?

thanks, Don


On Sat, Aug 6, 2011 at 3:56 PM, Andy Seaborne <[email protected]>
wrote:
>
>
> On 06/08/11 02:13, Don Gourley wrote:
>>
>> I have a thesaurus in SKOS format that I want to publish as linked
>> data. I am using a simple httpd/fuseki/tdb stack to do this without
>> any custom programming. httpd does the content negotiation, and with
>> mod_rewrite and mod_proxy passes DESCRIBE queries to the fuseki server
>> to deliver RDF responses.
>>
>> fuseki (or TDB?) assigns prefixes like 'j.0' for the namespaces it
>> doesn't know about (even though declared in the SKOS input to
>> tdbloader). I would like the namespace prefix for
>> "http://www.w3.org/2004/02/skos/core#"; to be 'skos' as in my original
>> SKOS file. Is there any way to specify this without writing my own
>> java code for the SPARQL server?
>>
>> For example, see: http://lod.nal.usda.gov/nalt/2111.rdf
>>
>> Let me know if there is any other information about my (very simple)
>> setup that would inform a solution. I understand that this is purely
>> an aesthetic human-readability aspect to my RDF, but it could help
>> sell our early efforts with linked open data in the organization.
>>
>> thanks, Don
>
> Don,
>
> The prefixes come from two places:
>
> * The dataset being queried
> * The query
>
> If loaded from n-triples, there will not be any triples in the dataset.
>
> You an add them later - simply add a model (it does not have to have any
> triples) in Turtle or RDF/XML i.e. a format that does have prefixes.
>
> If that does not work (there was a bug loading in Turtle prefixes IIRC),
> then please coudl you provide a complete, minimal example.
>
> The query should also contribute prefixes, whether used in the pattern or
> not.
>
>        Andy
>

Reply via email to