2015-05-20 83 views
0

我正在使用DBpedia SPARQL查詢以獲取人員列表的詳細信息。 我有DBpedia轉儲數據這是本地存儲。當我查詢,演奏家得到停止在dbpedia sparql查詢中超時。嘗試使用多個字段

查詢 -

SELECT DISTINCT ?dbpedia_link ?freebase_link str(?abstract) as ?abstract str(?alias) as ?alias 
         str(?birthDate) as ?birthDate str(?birthName) as ?birthName str(?birthPlace) as ?birthPlace 
         str(?label) as ?label str(?occupation) as ?occupation str(?residence) as ?residence 
         str(?spouse) as ?spouse str(?education) as ?education str(?networth) as ?networth str(?salary) as ?salary 
         str(?wikiPageID) as ?wikiPageID str(?wikiPageRevisionID) as ?wikiPageRevisionID str(?shortDescription) as ?shortDescription 
         WHERE { 
        { 
         ?dbpedia_link rdf:type dbpedia-owl:Person 
        } 
        OPTIONAL {?dbpedia_link dbpedia-owl:abstract ?abstract. } 
        OPTIONAL {?dbpedia_link dbpedia-owl:alias ?alias .} 
        OPTIONAL {?dbpedia_link dbpprop:birthDate ?birthDate .} 
        OPTIONAL {?dbpedia_link dbpprop:birthName ?birthName .} 
        OPTIONAL {?dbpedia_link dbpprop:birthPlace ?birthPlace .} 
        OPTIONAL {?dbpedia_link rdfs:label ?label .} 
        OPTIONAL {?dbpedia_link dbpprop:occupation ?occupation .} 
        OPTIONAL {?dbpedia_link dbpprop:residence ?residence .} 
        OPTIONAL {?dbpedia_link dbpprop:spouse ?spouse .} 
        OPTIONAL {?dbpedia_link dbpprop:education ?education .} 
        OPTIONAL {?dbpedia_link dbpprop:networth ?networth .} 
        OPTIONAL {?dbpedia_link dbpprop:salary ?salary .} 
        OPTIONAL {?dbpedia_link dbpedia-owl:wikiPageID ?wikiPageID .} 
        OPTIONAL {?dbpedia_link dbpedia-owl:wikiPageRevisionID ?wikiPageRevisionID .} 
        OPTIONAL {?dbpedia_link dbpprop:shortDescription ?shortDescription .} 
        OPTIONAL {?dbpedia_link owl:sameAs ?freebase_link 
        FILTER regex(?freebase_link, "^http://rdf.freebase.com") .} 
       }LIMIT "1" 
      OFFSET "225930" 

任何幫助?

+0

爲什麼不增加超時變量? – Artemis

+0

@Artemis我做到了。我將** MaxQueryExecutionTime **增加到** 600000 **。依然不成功。 – iNikkz

+0

我認爲它與偏移有關。它沒有抵消工作嗎?你能解釋一下你想達到什麼嗎?在抵消之後你想要一個具有這些特質的人嗎? – Artemis

回答

0

第1條 - 爲清晰起見而編輯的查詢,並附有一些語法更正。

SELECT DISTINCT        ?dbpedia_link 
               ?freebase_link 
       (   str(?abstract) AS ?abstract   ) 
       (    str(?alias) AS ?alias    ) 
       (   str(?birthDate) AS ?birthDate   ) 
       (   str(?birthName) AS ?birthName   ) 
       (  str(?birthPlace) AS ?birthPlace  ) 
       (    str(?label) AS ?label    ) 
       (  str(?occupation) AS ?occupation  ) 
       (   str(?residence) AS ?residence   ) 
       (   str(?spouse) AS ?spouse   ) 
       (   str(?education) AS ?education   ) 
       (   str(?networth) AS ?networth   ) 
       (   str(?salary) AS ?salary   ) 
       (  str(?wikiPageID) AS ?wikiPageID  ) 
       (str(?wikiPageRevisionID) AS ?wikiPageRevisionID) 
       ( str(?shortDescription) AS ?shortDescription ) 
    WHERE { 
        { ?dbpedia_link   rdf:type    dbpedia-owl:Person } 
      OPTIONAL { ?dbpedia_link dbpedia-owl:abstract   ?abstract   } 
      OPTIONAL { ?dbpedia_link dbpedia-owl:alias    ?alias    } 
      OPTIONAL { ?dbpedia_link  dbpprop:birthDate   ?birthDate   } 
      OPTIONAL { ?dbpedia_link  dbpprop:birthName   ?birthName   } 
      OPTIONAL { ?dbpedia_link  dbpprop:birthPlace   ?birthPlace   } 
      OPTIONAL { ?dbpedia_link   rdfs:label    ?label    } 
      OPTIONAL { ?dbpedia_link  dbpprop:occupation   ?occupation   } 
      OPTIONAL { ?dbpedia_link  dbpprop:residence   ?residence   } 
      OPTIONAL { ?dbpedia_link  dbpprop:spouse    ?spouse    } 
      OPTIONAL { ?dbpedia_link  dbpprop:education   ?education   } 
      OPTIONAL { ?dbpedia_link  dbpprop:networth   ?networth   } 
      OPTIONAL { ?dbpedia_link  dbpprop:salary    ?salary    } 
      OPTIONAL { ?dbpedia_link dbpedia-owl:wikiPageID   ?wikiPageID   } 
      OPTIONAL { ?dbpedia_link dbpedia-owl:wikiPageRevisionID ?wikiPageRevisionID } 
      OPTIONAL { ?dbpedia_link  dbpprop:shortDescription ?shortDescription } 
      OPTIONAL { ?dbpedia_link   owl:sameAs    ?freebase_link 
          FILTER regex(?freebase_link, "^http://rdf.freebase.com")  } 
     } 
    LIMIT 1 
OFFSET 225930 

事情2 - 你有未定義的前綴在那裏。 dbpedia-owldbpprop

隨機的修修補補,並要求隨機的人在網絡上尋求幫助可能給你一些成果,但你很可能會得到更快,有關特定產品和工具更準確,更相關的答案被要求在專用於這些論壇產品和工具,例如,DBpedia discussion mailing listVirtuoso Users mailing list