You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Rob Vesse (Commented) (JIRA)" <ji...@apache.org> on 2012/01/19 23:40:39 UTC

[jira] [Commented] (JENA-199) Result Sets returned from TDB give empty output for Text, CSV and TSV formats for certain queries

    [ https://issues.apache.org/jira/browse/JENA-199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13189452#comment-13189452 ] 

Rob Vesse commented on JENA-199:
--------------------------------

Ok so after some playing I have reduced 5b down to a simpler query that exhibits this behavior:

PREFIX foaf:  <http://xmlns.com/foaf/0.1/>
PREFIX dc:    <http://purl.org/dc/elements/1.1/>

SELECT DISTINCT ?person ?name
WHERE {
  ?article dc:creator ?person .
  ?person foaf:name ?name .
}

Interestingly as soon as DISTINCT is removed then the Text, CSV and TSV output works fine.

So I'm still uncertain whether this is a TDB or ARQ issue, problem is that this reduced query works fine with an ARQ in-memory dataset so I'm still leaning towards it being caused by some interaction of TDB and the DISTINCT operator

Yet when I look at OpExecutorTDB I see:

    @Override
    protected QueryIterator execute(OpDistinct opDistinct, QueryIterator input)
    {
        return super.execute(opDistinct, input) ;
    }

Which leaves me none the wiser, following the code I end up in QueryIterDistinct but I assume an ARQ in-memory dataset would also use QueryIterDistinct so why should the query not return properly for some formats on TDB and yet return fine on the same formats with an ARQ in-memory dataset?
                
> Result Sets returned from TDB give empty output for Text, CSV and TSV formats for certain queries
> -------------------------------------------------------------------------------------------------
>
>                 Key: JENA-199
>                 URL: https://issues.apache.org/jira/browse/JENA-199
>             Project: Jena
>          Issue Type: Bug
>          Components: TDB
>            Reporter: Rob Vesse
>              Labels: csv, results, sparql, tdb, tsv
>         Attachments: 5b.txt, 8.txt, sp2b10k.nt
>
>
> This is a strange bug which I have been unable to reduce to a more minimal example than the files I will attach so I apologize for that.
> Essentially the problem manifests as follows, when using a TDB dataset with Fuseki some queries will return blank output if the user requests Text, CSV or TSV.  When using XML/JSON the output is fine.
> The test data used is SP2B 10k, two of the SP2B queries that exhibit this issue are as follows:
> PREFIX rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX foaf:  <http://xmlns.com/foaf/0.1/>
> PREFIX bench: <http://localhost/vocabulary/bench/>
> PREFIX dc:    <http://purl.org/dc/elements/1.1/>
> SELECT DISTINCT ?person ?name
> WHERE {
>   ?article rdf:type bench:Article .
>   ?article dc:creator ?person .
>   ?inproc rdf:type bench:Inproceedings .
>   ?inproc dc:creator ?person .
>   ?person foaf:name ?name
> }
> And:
> PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#> 
> PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX foaf: <http://xmlns.com/foaf/0.1/>
> PREFIX dc:   <http://purl.org/dc/elements/1.1/>
> SELECT DISTINCT ?name
> WHERE {
>   ?erdoes rdf:type foaf:Person .
>   ?erdoes foaf:name "Paul Erdoes"^^xsd:string .
>   {
>     ?document dc:creator ?erdoes .
>     ?document dc:creator ?author .
>     ?document2 dc:creator ?author .
>     ?document2 dc:creator ?author2 .
>     ?author2 foaf:name ?name
>     FILTER (?author!=?erdoes &&
>             ?document2!=?document &&
>             ?author2!=?erdoes &&
>             ?author2!=?author)
>   } UNION {
>     ?document dc:creator ?erdoes.
>     ?document dc:creator ?author.
>     ?author foaf:name ?name
>     FILTER (?author!=?erdoes)
>   }
> }
> I will attach these as files as well for convenience.
> If you run Fuseki with a memory dataset using the --mem option, load this data and run the same queries the Text, CSV and TSV output works fine.  This implies that there is something in the TDB code related to its return of results or iterators which somehow causes the Text, CSV and TSV formatters to either error or to believe that they have no results to format.
> I'm completely unfamiliar with the TDB codebase so I haven't attempted to discover what the cause of the issue is though I may poke around anyway

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira