Relative to the second topic in this this posting, I got my query working.
The following query works:

select distinct ?subjid ?diag
FROM  <http://purl.bioontology.org/ontology/HOM_ICD9_inferred/>
FROM  <http://www.sas.com/hls/hoa/patient/>
where {
        ?subj p:hasDiagnosis ?diag .
        ?subj p:hasPatientID ?subjid .
        FILTER( EXISTS { ?diag rdf:type HOM_ICD9:HOM_ICD_1224 } )
}

However, I thought using
--set tdb:unionDefaultGraph=true
would put the two graphs into the default graph (those are my only 2 graphs 
right now),
not requiring me to have the FROM clause at all. But with that, I had no 
results.
So this seems like an inconsistency to me.


_____________________________________________
From: David Jordan
Sent: Thursday, September 22, 2011 2:54 PM
To: [email protected]
Subject: 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 ▪ [email protected]<mailto:[email protected]>
www.sas.com<http://www.sas.com>
SAS® … THE POWER TO KNOW®



Reply via email to