2017-02-21 15 views
1

AllegroGraphサーバーが稼働していて、リモートデータストアの照会に問題があります。ドキュメントに関する情報はほとんどありません。 AllegroGraphのWebViewの中で、私は同じクエリおよび名前空間がリポジトリにロードされ、正確に実行できますがdotnetRDFを使用したAllegroGraphの照会

using System; 
using VDS.RDF; 
using VDS.RDF.Storage; 

namespace PoC { 
    class Program { 
    static void Main(string[] args) { 
     string server = "http://server"; 
     string repo = "repo"; 
     string username = "username"; 
     string password = "password"; 

     AllegroGraphConnector agraph = new AllegroGraphConnector(server, repo, username, password); 

     Options.HttpDebugging = true; 
     Options.HttpFullDebugging = true; 

     agraph.Query("SELECT * WHERE { emid:_PCAT_0001 ?p ?o }"); 
     Console.ReadLine(); 
    } 
    } 
} 

MALFORMED QUERY: Parse error: namespace mapping for "emid" not defined when expanding QName "emid:_PCAT_0001".

:ここ

はコードの私のlilの作品です。

どうすれば解決できますか?

答えて

1

クエリ内に接頭辞emid:を宣言する必要があります。おそらく、AllegroGraph WebView UIは自動的にそれを実行していますが、プレーンなSPARQLエンドポイントはそうではありません。

このような何かを使用してみてください:接頭マップへ:

agraph.Query("PREFIX emid: <http://your.uri.goes/here> SELECT * WHERE { emid:_PCAT_0001 ?p ?o }"); 

は明らかにあなたがそのあなたのEMID本当のURIとその偽のURIを交換する必要があります!

関連する問題