On 09/08/11 03:01, Don Gourley wrote:
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.

Don't worry - openjena got taken out by the Amazon Web Services problems in EU-West at the weekend. We've just managed to get a machine back, and it's EBS back but it needs resetting.

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.

Should be fine - it should be unencoded inside Fuseki. (Raw # is a fragment id, and fragment ids don't go over HTTP as you have in curl above.)

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>

How did you load it? If loaded as RDF/XML direcly, there should be prefixes in the database.

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

Couple of things:

1/ Which version of the code is this?

2/ Could you send what the server does output?


I did the following:

# D.rdf has your data above.
tdbloader --loc DB D.rdf
fuseki-server --loc DB /ds

then did:

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

(curl changed to /nalt/907)

and got

<?xml version="1.0"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
    xmlns:skos="http://www.w3.org/2004/02/skos/core#"; >
  <rdf:Description rdf:about="http://lod.nal.usda.gov/nalt/907";>
    <skos:broader rdf:resource="http://lod.nal.usda.gov/nalt/912"/>
    <skos:altLabel xml:lang="en">EC 1.1.3.15</skos:altLabel>
<skos:prefLabel xml:lang="en">(s)-2-hydroxy-acid oxidase</skos:prefLabel>
    <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>
  </rdf:Description>
</rdf:RDF>

I also did it by deleteing the old DB and uploading the data through the Fuseki control panel - same output.

But I did it on the development version.

In case it take a while to get the server back:

svn co https://svn.apache.org/repos/asf/incubator/jena/Jena2/Fuseki/trunk
mvn clean package

        Andy

Reply via email to