The original query:

SELECT ?it1 ?st1 ?p01 ?x01 ?p02 ?x02 ?p03 WHERE {?it1 ?st1
<http://bio2rdf.org/omim_vocabulary:Gene> . ?it1 ?p01 ?x01 . ?x01 ?p02
?x02 . <http://bio2rdf.org/pharmgkb:PA446359> ?p03 ?x02 . FILTER
(isIRI(?it1) && isIRI(?x01) && isIRI(?x02)) FILTER (?it1 != ?x01)
FILTER (?it1 != ?x02) FILTER (?x01 != ?x02) FILTER (str(?p01) NOT IN
("http://rdfs.org/ns/void#inDataset",
"http://bio2rdf.org/omim_vocabulary:refers-to",
"http://bio2rdf.org/omim_vocabulary:article",
"http://bio2rdf.org/omim_vocabulary:mapping-method",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
"http://www.w3.org/2000/01/rdf-schema#subClassOf",
"http://bioportal.bioontology.org/ontologies/umls/hasSTY")) FILTER
(str(?p02) NOT IN ("http://rdfs.org/ns/void#inDataset",
"http://bio2rdf.org/omim_vocabulary:refers-to",
"http://bio2rdf.org/omim_vocabulary:article",
"http://bio2rdf.org/omim_vocabulary:mapping-method",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
"http://www.w3.org/2000/01/rdf-schema#subClassOf",
"http://bioportal.bioontology.org/ontologies/umls/hasSTY")) FILTER
(str(?p03) NOT IN ("http://rdfs.org/ns/void#inDataset",
"http://bio2rdf.org/omim_vocabulary:refers-to",
"http://bio2rdf.org/omim_vocabulary:article",
"http://bio2rdf.org/omim_vocabulary:mapping-method",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
"http://www.w3.org/2000/01/rdf-schema#subClassOf",
"http://bioportal.bioontology.org/ontologies/umls/hasSTY")) FILTER
(str(?st1) IN ("http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
"http://www.w3.org/2000/01/rdf-schema#subClassOf",
"http://bioportal.bioontology.org/ontologies/umls/hasSTY"))} LIMIT 10

==Test 1 ==

FedX:

Rewriting the query by filling the predicate parts:

select ?s1 ?o1 ?o2 
where{
?s1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>   <http://bio2rdf.org/omim_vocabulary:Gene>.
?s1   <http://bio2rdf.org/omim_vocabulary:phenotype> ?o1.
?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2.
<http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-SnoMedCT> ?o2.
}
select ?s1 ?o1 ?o2 
where{
?s1 ?p1 <http://bio2rdf.org/omim_vocabulary:Gene>.
?s1   <http://bio2rdf.org/omim_vocabulary:phenotype> ?o1.
?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2.
<http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-SnoMedCT> ?o2.
}

select ?s1 ?o1 ?o2 
where{
?s1 ?P1 <http://bio2rdf.org/omim_vocabulary:Gene>.
?s1   ?P2 ?o1.
?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2.
<http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-SnoMedCT> ?o2.
}

ALl of these three queries can be finished within 5 seconds.

select ?s ?p1 ?o1 ?o2
where{
?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://bio2rdf.org/omim_vocabulary:Gene>.
?s ?p2 ?o1.
?o1 ?p3 ?o2.
<http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-SnoMedCT> ?o2.}

Error while using the FedX CLI. System will exit. Details: -1

As for the original query,the following error occurs:

Exception in thread "pool-31-thread-2" Exception in thread "Union Scheduler_12" java.lang.OutOfMemoryError?: Java heap space

==Test 2 ==

Virtuoso:

select ?s1 ?o1 ?o2 
where{
service<http://pharmgkb.bio2rdf.org/sparql>
{<http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-SnoMedCT> ?o2.}
service<http://omim.bio2rdf.org/sparql>
{
?s1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>   <http://bio2rdf.org/omim_vocabulary:Gene>.
?s1   <http://bio2rdf.org/omim_vocabulary:phenotype> ?o1.
?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2.}

} 

OK!

select ?s1 ?o1 ?o2 
where{
service<http://omim.bio2rdf.org/sparql>
{
?s1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>   <http://bio2rdf.org/omim_vocabulary:Gene>.
?s1   <http://bio2rdf.org/omim_vocabulary:phenotype> ?o1.
?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2.}
service<http://pharmgkb.bio2rdf.org/sparql>
{<http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-SnoMedCT> ?o2.}
}

wrong!

Virtuoso RDFZZ Error DB.DBA.SPARQL_REXEC('http://pharmgkb.bio2rdf.org/sparql', ...) has received result with unexpected variable name 'stubvar11'

Conclusion

1. Virtuoso requires explicitly specified Service keyword, namely SPARQL endpoints;

2. Even with the explicitly specified SPARQL endpoints, queries may not get an ideal result.

添付ファイル