Hi Miika,
After some investigation, it seems that prefixes aren't working for text
datasets - and if you restart, then the ones on the default graph will
disappear. I thought there was a quick fix for this but the quick fix
breaks some tests (it looks like the tests are wrong/fragile with
respect to transaction boundaries).
We have started a JIRA to discuss prefixes on datasets: JENA-1045.
Prefixes are just helpers - if necessary, you can add them client side.
Andy
On 05/10/15 08:56, Miika Alonen wrote:
Sorry about the numerous emails on the matter, but i just realized that:
http://localhost:3030/search/data
http://localhost:3030/search/data?graph=default
doesnt mean the same thing, so removing the union graph from the dataset
configuration works, but the earlier example is still not working if using
named graphs:
http://localhost:3030/search/data?graph=default (WORKS - returns prefixed
content)
http://localhost:3030/search/data?graph=http://example.org/ (NOT WORKING -
returns expanded content)
- Miika
----- Original Message -----
From: "Miika Alonen" <[email protected]>
To: [email protected]
Sent: Monday, 5 October, 2015 10:27:44
Subject: Re: Fuseki 2.3.0 not returning prefix declarations from TextDataset
using graph protocol
Hi,
It seems it is sometimes working (for example with application/ld+json syntax)
- but only when using default graph. Problem shows up the best when using named
graphs.
I also tried to set the default graph tdb:unionDefaultGraph false ; or # comment it
out, but it seems that the <#dataset> default graph stays as union no matter
what.
- Miika
----- Original Message -----
From: "Miika Alonen" <[email protected]>
To: [email protected]
Sent: Monday, 5 October, 2015 09:28:18
Subject: Re: Fuseki 2.3.0 not returning prefix declarations from TextDataset
using graph protocol
Hi,
Thanks for your reply. Sorry, there were some floppiness in my example. What i
was doing was:
PUT http://localhost:3030/search/data HTTP/1.1
Host: localhost:3030
Content-Type: text/turtle; charset=utf-8
BODY:
@prefix example: <http://example.org/> .
example:foo example:bar example:foo .
And then:
GET http://localhost:3030/search/data HTTP/1.1
Host: localhost:3030
Accept: text/turtle; charset=utf-8
And the result is:
<http://example.org/foo> <http://example.org/bar> <http://example.org/foo> .
... so text/turtle or application/ld+json seems not to be working, but if you
omit the Content-Type or use text/trig it returns:
@prefix example: <http://example.org/> .
{ example:foo example:bar example:foo .
}
- Miika
----- Original Message -----
From: "Andy Seaborne" <[email protected]>
To: [email protected]
Sent: Friday, 2 October, 2015 18:50:05
Subject: Re: Fuseki 2.3.0 not returning prefix declarations from TextDataset
using graph protocol
On 01/10/15 10:23, Miika Alonen wrote:
Hi,
Fuseki 2.3.0 doesnt seem to return prefixes and namespaces from
text:TextDataset with graph protocol. You would expect that these return the
same result:
Hi Miika,
I tried your example and it works for me.
If you loaded from N-triples or with a bulk loader there aren't any
prefixes (the bulk loaders do now, post the last releases, save the
prefixes).
IIRC CONSTRUCT gets its prefixes from the query.
GET /textDataset?default HTTP/1.1
which does not agree with the configuration below ...
The form "/dataset?default", directly using the graph store protocol on
the dataset, rather than "/dataset/data?default", got fixed recently
(post the last releases). That might accoutn for twhat you are seeing
(if it worked at all).
Andy
Host: localhost:3030
Accept: text/turtle; charset=utf-8
and
CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }
but graph protocol from TextDataset returns expanded content (without prefixes
and namespaces), while CONSTRUCT queries returns compact data with prefixes and
namespaces.
I'v tried couple of configurations with the same result and it doesnt seem to
matter if the TDB dataset is called trough separate service. Am i missing
something or is this a bug or a feature? :)
So directly on the TDB service, no text dataset, also does not have
prefixes? See above - looks like there aren't any loaded.
My current "simplified" configuration is:
@prefix : <#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix text: <http://jena.apache.org/text#> .
[] rdf:type fuseki:Server ;
fuseki:services (
<#TestService>
) .
# TDB
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
# Text
[] ja:loadClass "org.apache.jena.query.text.TextQuery" .
text:TextDataset rdfs:subClassOf ja:RDFDataset .
text:TextIndexLucene rdfs:subClassOf text:TextIndex .
<#TestService> rdf:type fuseki:Service ;
fuseki:name "search" ;
fuseki:dataset <#text_dataset> ;
fuseki:serviceQuery "sparql" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceReadWriteGraphStore "data" ;
fuseki:serviceUpload "upload" ;
.
<#text_dataset> rdf:type text:TextDataset ;
text:dataset <#dataset> ;
text:index <#indexLucene> ;
.
<#dataset> rdf:type tdb:DatasetTDB ;
tdb:location "TEST_TDB" ;
tdb:unionDefaultGraph true ;
.
<#indexLucene> a text:TextIndexLucene ;
text:directory <file:Lucene> ;
text:entityMap <#entityMap> ;
.
<#entityMap> a text:EntityMap ;
text:entityField "uri" ;
text:graphField "graph" ; ## enable graph-specific indexing
text:defaultField "label" ; ## Must be defined in the text:map
text:map (
# rdfs:label
[ text:field "label" ;
text:predicate rdfs:label ;
text:analyzer [ a text:LowerCaseKeywordAnalyzer ] ]
# rdfs:comment
[ text:field "comment" ;
text:predicate rdfs:comment ;
text:analyzer [ a text:LowerCaseKeywordAnalyzer ] ]
) .
Best Regards,
Miika Alonen
CSC - IT Center for Science
[email protected]