Closed xristy closed 4 years ago
it doesn't seem to come from any of the queries in this repo... @MarcAgate @berger-n do you remember trying this by hand on the Fuseki interface?
I do before opening https://github.com/buda-base/lds-queries/issues/31 query is https://github.com/buda-base/lds-queries/blob/newbiblio/library/etextContentFacetGraph.arq but I could not get any result copy/pasting it on Fuseki interface ...
ok thanks!
(just to be a bit clearer: in this query you can't just bind ?L_NAME
, you need to substitute it in all instances where it appears)
Interesting. I hadn't paid attention that bind
doesn't propagate into { . . . }
so has to be repeated in each block. Rather a gnarly feature of sparql.
@eroux @xristy thanks for the explanation still the query using text substitution does not yield any result in Fuseki interface I don't know what I'm missing here:
PREFIX bdr: <http://purl.bdrc.io/resource/>
PREFIX : <http://purl.bdrc.io/ontology/core/>
PREFIX adm: <http://purl.bdrc.io/ontology/admin/>
PREFIX tmp: <http://purl.bdrc.io/ontology/tmp/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX bdo: <http://purl.bdrc.io/ontology/core/>
PREFIX bda: <http://purl.bdrc.io/admindata/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
prefix text: <http://jena.apache.org/text#>
construct {
?etext tmp:isMain true .
?etext skos:prefLabel ?etextL .
?etext bdo:eTextHasChunk ?chunk .
?chunk bdo:chunkContents ?lit .
?chunk bdo:sliceStartChar ?startChar .
?chunk bdo:sliceEndChar ?endChar .
?chunk tmp:matchScore ?score .
?etext tmp:provider ?provider .
?etext ?etextp ?etexto .
?etext tmp:forWork ?w .
?w ?wp ?wo .
?etext tmp:author ?author .
?agent skos:prefLabel ?agentL .
?etext tmp:maxScore ?maxScore .
?etext tmp:nbChunks ?nbchunks .
}
where
{
{
(?chunk ?score ?lit) text:query ( :chunkContents "ston dri med 'od zer"@bo-x-ewts "highlight:") .
?etext bdo:eTextHasChunk ?chunk .
?etext bdo:eTextInInstance ?einstance .
?eAdm adm:adminAbout ?einstance .
?eAdm adm:status bda:StatusReleased .
?w :workHasInstance ?einstance .
?chunk bdo:sliceStartChar ?startChar .
?chunk bdo:sliceEndChar ?endChar .
?eAdm adm:metadataLegal/adm:provider ?provider .
?w ?wp ?wo .
FILTER (?wp IN(skos:altLabel , skos:prefLabel , rdf:type , owl:sameAs , tmp:entityScore))
} union {
(?chunk ?score ?lit) text:query ( :chunkContents "ston dri med 'od zer"@bo-x-ewts "highlight:") .
?etext bdo:eTextHasChunk ?chunk .
VALUES ?etextp { skos:prefLabel bdo:eTextIsVolume }
?etext ?etextp ?etexto .
} union {
?chunk text:query ( :chunkContents "ston dri med 'od zer"@bo-x-ewts ) .
?etext bdo:eTextHasChunk ?chunk .
?etext bdo:eTextInInstance ?einstance .
?eAdm adm:adminAbout ?einstance .
?eAdm adm:status bda:StatusReleased .
?w :workHasInstance ?einstance .
?w bdo:creator ?creator .
?creator bdo:role ?role .
?creator bdo:agent ?agent .
?agent skos:prefLabel ?agentL .
bind( if(?role IN(bdr:R0ER0014 , bdr:R0ER0016 , bdr:R0ER0019 , bdr:R0ER0025), ?agent, 1/0) as ?author)
} union {
select ?etext (count (?chunk) as ?nbchunks) (max (?score) as ?maxScore) where {
(?chunk ?score) text:query ( :chunkContents "ston dri med 'od zer"@bo-x-ewts) .
?etext bdo:eTextHasChunk ?chunk .
} group by ?etext
}
}
@berger-n The query-string should be double-quoted as a phrase:
?chunk text:query ( :chunkContents "\"ston dri med 'od zer\""@bo-x-ewts )
As written it is an OR of the terms which typically should produce lots more results than the phrase, so there must be some other issue if you're getting no results.
When I run just the text:query w/o the phrase quoting there are 9990 results and with the quotes there are 11 results
glad to know! thanks
While looking at Fuseki catalina.out, I noticed a cluster of
TextQueryPF WARN
ings from the following eText query.These warnings indicate that
text:query
will produce no results.It's sure not obvious why these warnings are happening, and there is just this one occurrence in this log.