| 1 |  | Test | 
                      
                        |  | 1 | The original query: | 
                        |  | 2 |  | 
                        |  | 3 | {{{ | 
                        |  | 4 | SELECT ?it1 ?st1 ?p01 ?x01 ?p02 ?x02 ?p03 WHERE {?it1 ?st1 | 
                        |  | 5 | <http://bio2rdf.org/omim_vocabulary:Gene> . ?it1 ?p01 ?x01 . ?x01 ?p02 | 
                        |  | 6 | ?x02 . <http://bio2rdf.org/pharmgkb:PA446359> ?p03 ?x02 . FILTER | 
                        |  | 7 | (isIRI(?it1) && isIRI(?x01) && isIRI(?x02)) FILTER (?it1 != ?x01) | 
                        |  | 8 | FILTER (?it1 != ?x02) FILTER (?x01 != ?x02) FILTER (str(?p01) NOT IN | 
                        |  | 9 | ("http://rdfs.org/ns/void#inDataset", | 
                        |  | 10 | "http://bio2rdf.org/omim_vocabulary:refers-to", | 
                        |  | 11 | "http://bio2rdf.org/omim_vocabulary:article", | 
                        |  | 12 | "http://bio2rdf.org/omim_vocabulary:mapping-method", | 
                        |  | 13 | "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", | 
                        |  | 14 | "http://www.w3.org/2000/01/rdf-schema#subClassOf", | 
                        |  | 15 | "http://bioportal.bioontology.org/ontologies/umls/hasSTY")) FILTER | 
                        |  | 16 | (str(?p02) NOT IN ("http://rdfs.org/ns/void#inDataset", | 
                        |  | 17 | "http://bio2rdf.org/omim_vocabulary:refers-to", | 
                        |  | 18 | "http://bio2rdf.org/omim_vocabulary:article", | 
                        |  | 19 | "http://bio2rdf.org/omim_vocabulary:mapping-method", | 
                        |  | 20 | "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", | 
                        |  | 21 | "http://www.w3.org/2000/01/rdf-schema#subClassOf", | 
                        |  | 22 | "http://bioportal.bioontology.org/ontologies/umls/hasSTY")) FILTER | 
                        |  | 23 | (str(?p03) NOT IN ("http://rdfs.org/ns/void#inDataset", | 
                        |  | 24 | "http://bio2rdf.org/omim_vocabulary:refers-to", | 
                        |  | 25 | "http://bio2rdf.org/omim_vocabulary:article", | 
                        |  | 26 | "http://bio2rdf.org/omim_vocabulary:mapping-method", | 
                        |  | 27 | "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", | 
                        |  | 28 | "http://www.w3.org/2000/01/rdf-schema#subClassOf", | 
                        |  | 29 | "http://bioportal.bioontology.org/ontologies/umls/hasSTY")) FILTER | 
                        |  | 30 | (str(?st1) IN ("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", | 
                        |  | 31 | "http://www.w3.org/2000/01/rdf-schema#subClassOf", | 
                        |  | 32 | "http://bioportal.bioontology.org/ontologies/umls/hasSTY"))} LIMIT 10 | 
                        |  | 33 | }}} | 
                        |  | 34 |  | 
                        |  | 35 | ==Test 1 == | 
                        |  | 36 |  | 
                        |  | 37 | '''FedX:''' | 
                        |  | 38 |  | 
                        |  | 39 | Rewriting the query by filling the predicate parts: | 
                        |  | 40 |  | 
                        |  | 41 | {{{ | 
                        |  | 42 | select ?s1 ?o1 ?o2 | 
                        |  | 43 | where{ | 
                        |  | 44 | ?s1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>   <http://bio2rdf.org/omim_vocabulary:Gene>. | 
                        |  | 45 | ?s1   <http://bio2rdf.org/omim_vocabulary:phenotype> ?o1. | 
                        |  | 46 | ?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2. | 
                        |  | 47 | <http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-SnoMedCT> ?o2. | 
                        |  | 48 | } | 
                        |  | 49 | }}} | 
                        |  | 50 |  | 
                        |  | 51 |  | 
                        |  | 52 | {{{ | 
                        |  | 53 | select ?s1 ?o1 ?o2 | 
                        |  | 54 | where{ | 
                        |  | 55 | ?s1 ?p1 <http://bio2rdf.org/omim_vocabulary:Gene>. | 
                        |  | 56 | ?s1   <http://bio2rdf.org/omim_vocabulary:phenotype> ?o1. | 
                        |  | 57 | ?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2. | 
                        |  | 58 | <http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-SnoMedCT> ?o2. | 
                        |  | 59 | } | 
                        |  | 60 |  | 
                        |  | 61 | }}} | 
                        |  | 62 |  | 
                        |  | 63 | Both of the two queries can be finished within 5 seconds. | 
                        |  | 64 |  | 
                        |  | 65 |  | 
                        |  | 66 | {{{ | 
                        |  | 67 | select ?s1 ?o1 ?o2 | 
                        |  | 68 | where{ | 
                        |  | 69 | ?s1 ?P1 <http://bio2rdf.org/omim_vocabulary:Gene>. | 
                        |  | 70 | ?s1   ?P2 ?o1. | 
                        |  | 71 | ?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2. | 
                        |  | 72 | <http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-SnoMedCT> ?o2. | 
                        |  | 73 | } | 
                        |  | 74 |  | 
                        |  | 75 | }}} | 
                        |  | 76 |  | 
                        |  | 77 |  | 
                        |  | 78 |  | 
                        |  | 79 |  | 
                        |  | 80 | ==Test 2 == | 
                        |  | 81 |  | 
                        |  | 82 |  | 
                        |  | 83 | ''' Virtuoso:''' | 
                        |  | 84 |  | 
                        |  | 85 |  | 
                        |  | 86 | {{{ | 
                        |  | 87 | select ?s1 ?o1 ?o2 | 
                        |  | 88 | where{ | 
                        |  | 89 | service<http://pharmgkb.bio2rdf.org/sparql> | 
                        |  | 90 | {<http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-SnoMedCT> ?o2.} | 
                        |  | 91 | service<http://omim.bio2rdf.org/sparql> | 
                        |  | 92 | { | 
                        |  | 93 | ?s1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>   <http://bio2rdf.org/omim_vocabulary:Gene>. | 
                        |  | 94 | ?s1   <http://bio2rdf.org/omim_vocabulary:phenotype> ?o1. | 
                        |  | 95 | ?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2.} | 
                        |  | 96 |  | 
                        |  | 97 | } | 
                        |  | 98 |  | 
                        |  | 99 | }}} | 
                        |  | 100 |  | 
                        |  | 101 |  | 
                        |  | 102 |  | 
                        |  | 103 | OK! | 
                        |  | 104 |  | 
                        |  | 105 |  | 
                        |  | 106 | {{{ | 
                        |  | 107 |  | 
                        |  | 108 | select ?s1 ?o1 ?o2 | 
                        |  | 109 | where{ | 
                        |  | 110 | service<http://omim.bio2rdf.org/sparql> | 
                        |  | 111 | { | 
                        |  | 112 | ?s1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>   <http://bio2rdf.org/omim_vocabulary:Gene>. | 
                        |  | 113 | ?s1   <http://bio2rdf.org/omim_vocabulary:phenotype> ?o1. | 
                        |  | 114 | ?o1   <http://bio2rdf.org/omim_vocabulary:x-snomed> ?o2.} | 
                        |  | 115 | service<http://pharmgkb.bio2rdf.org/sparql> | 
                        |  | 116 | {<http://bio2rdf.org/pharmgkb:PA446359> <http://bio2rdf.org/pharmgkb_vocabulary:x-SnoMedCT> ?o2.} | 
                        |  | 117 | } | 
                        |  | 118 | }}} | 
                        |  | 119 |  | 
                        |  | 120 | wrong! | 
                        |  | 121 |  | 
                        |  | 122 | {{{ | 
                        |  | 123 | Virtuoso RDFZZ Error DB.DBA.SPARQL_REXEC('http://pharmgkb.bio2rdf.org/sparql', ...) has received result with unexpected variable name 'stubvar11' | 
                        |  | 124 | }}} | 
                        |  | 125 |  | 
                        |  | 126 | '''Conclusion''' | 
                        |  | 127 |  | 
                        |  | 128 | 1. Virtuoso requires explicitly specified Service keyword, namely SPARQL endpoints; | 
                        |  | 129 |  | 
                        |  | 130 | 2. Even with the explicitly specified SPARQL endpoints, queries may not get an ideal result. |