10.12.2015, 18:52, Andy Seaborne kirjoitti:
JENA-1018 looks like the relevant change.
In the commit for that, processing all Op was added to VarFinder
including property functions. Previous they didn't contribute and
that's a bug. So this looks like the unknown bug getting fixed.
Thanks Andy. That seems to be exactly the issue. My query relied on the
old behaviour where variables were expected to be visible when they
shouldn't be. The problem is not with Jena but with my query.
Now I just need a solution for this problem:
1. make a jena-text query *without any graph*
2. using bindings from the results of that query, match additional patterns
from specific graphs
I think I found one way to do this, but it's not pretty and it relies on
knowledge of ARQ and jena-text internals. But since the jena-text lookup
is Jena-specific anyway, maybe this will do:
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX text: <http://jena.apache.org/text#>
SELECT *
WHERE {
GRAPH <http://www.yso.fi/onto/yso/> {
GRAPH <urn:x-arq:UnionGraph> {
(?s ?score ?literal) text:query 'musiikkikasv*' .
}
?s skos:prefLabel ?label .
FILTER (LANG(?label)=LANG(?literal))
}
}
This is fast (~30ms) and it returns a solution where ?label is bound to
"musiikkikasvatus"@fi, as I wanted it to be.
Here the inner GRAPH is executed on the special union graph URI, which
is recognized by jena-text and therefore the Lucene lookup is performed
on all graphs (i.e. no graph restriction set).
As I see it, the problem is that in SPARQL, if you don't have a GRAPH
clause, you are addressing the default graph, but once you go inside
one, there is no way back; you can switch to another named graph using
another GRAPH clause, but not back to the default graph, because it has
no name. Unless I've missed something.
-Osma
PS. You asked about Fuseki2 in an earlier message and I forgot to reply.
I've been lazy about switching since I don't use the UI much anyway,
just the APIs and occasionally http://yasgui.org for SPARQL queries. I
have a custom Jetty configuration [1] and some other server
configuration (startup scripts and symlinks) that maybe needs some
migration to be able to switch to Fuseki2.
[1] https://github.com/NatLibFi/Skosmos/wiki/FusekiTuning#tuning-jetty
--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 26 (Kaikukatu 4)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
[email protected]
http://www.nationallibrary.fi