You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by David Jordan <Da...@sas.com> on 2011/09/22 20:54:18 UTC

infinite loop encountered and other confusing results

I hit the following infinite loop (see a part of the stack trace below.
I know this query is likely wrong, but it should not result in infinite loop.

select distinct ?subjid ?diagType
FROM NAMED <urn:x-arq:UnionGraph>
where {
        GRAPH ?g {
                ?subj p:hasDiagnosis ?diag .
                ?subj p:hasPatientID ?subjid .
                ?diag rdf:type ?diagType .
        }
}


The ' characters around the executable and arguments are
not part of the command.
Exception in thread "main" java.lang.StackOverflowError
    at java.util.HashMap$KeyIterator.<init>(HashMap.java:826)
    at java.util.HashMap$KeyIterator.<init>(HashMap.java:826)
    at java.util.HashMap.newKeyIterator(HashMap.java:840)
    at java.util.HashMap$KeySet.iterator(HashMap.java:874)
    at com.hp.hpl.jena.sparql.core.DatasetGraphMap.listGraphNodes(DatasetGraphMap.java:99
    at com.hp.hpl.jena.tdb.migrate.GraphOps.unionGraph(GraphOps.java:44)
    at com.hp.hpl.jena.tdb.migrate.GraphOps.getGraph(GraphOps.java:38)
    at com.hp.hpl.jena.tdb.migrate.GraphUnionRead.graphBaseFind(GraphUnionRead.java:69)
    at com.hp.hpl.jena.sparql.graph.GraphBase2.find(GraphBase2.java:231)
    at com.hp.hpl.jena.tdb.migrate.GraphUnionRead.graphBaseFind(GraphUnionRead.java:69)
    at com.hp.hpl.jena.sparql.graph.GraphBase2.find(GraphBase2.java:231)
    at com.hp.hpl.jena.tdb.migrate.GraphUnionRead.graphBaseFind(GraphUnionRead.java:69)
    at com.hp.hpl.jena.sparql.graph.GraphBase2.find(GraphBase2.java:231)
    at com.hp.hpl.jena.tdb.migrate.GraphUnionRead.graphBaseFind(GraphUnionRead.java:69)
    at com.hp.hpl.jena.sparql.graph.GraphBase2.find(GraphBase2.java:231)
    at com.hp.hpl.jena.tdb.migrate.GraphUnionRead.graphBaseFind(GraphUnionRead.java:69)
    at com.hp.hpl.jena.sparql.graph.GraphBase2.find(GraphBase2.java:231)
    at com.hp.hpl.jena.tdb.migrate.GraphUnionRead.graphBaseFind(GraphUnionRead.java:69)
    at com.hp.hpl.jena.sparql.graph.GraphBase2.find(GraphBase2.java:231)
    at com.hp.hpl.jena.tdb.migrate.GraphUnionRead.graphBaseFind(GraphUnionRead.java:69)
    at com.hp.hpl.jena.sparql.graph.GraphBase2.find(GraphBase2.java:231)

keeps repeating, adnauseum

With the following query, I do get results, but there is a long delay.
However if I take out the FROM, but use tdb:unionDefaultGraph=true, and only include
triple patterns for one of the graphs, I get results, and immediately, no delay.
Since I supposedly have stated the default graph should be the union anyway,
adding this FROM seems redundant.
Yet, when I include it, I do get results, without it, I get no results.
This inconsistency does not make any sense (to me).

select distinct ?subjid ?diagType
FROM <urn:x-arq:UnionGraph>
where {
                ?subj p:hasDiagnosis ?diag .
                ?subj p:hasPatientID ?subjid .
                ?diag rdf:type ?diagType .
}


David Jordan
Software Developer
SAS Institute Inc.
Health & Life Sciences, Research & Development
Bldg R ▪ Office 4467
600 Research Drive ▪ Cary, NC 27513
Tel: 919 531 1233 ▪ david.jordan@sas.com<ma...@sas.com>
www.sas.com<http://www.sas.com>
SAS® … THE POWER TO KNOW®