私の目的は、Unity と dotNetRDF を併用して Fuseki トリプル ストアを管理する Windows10-64bit 用のアプリケーションを構築することです。
Unity 2017.3 64 ビット
スクリプティング ランタイム バージョン: 実験的 (.NET 4.6 相当)
スクリプティング バックエンド: Mono
API 互換レベル: .NET 4.6dotNetRFD v2.0.1 net40
に関連付けられたすべての dll を保持しました。
Unity の「ゲーム」は、以下に示すコードを持つ 1 つのボタンで構成されています。ゲームを実行してボタンを押すと、次のエラーが表示されます。
System.InvalidOperationException: request started
at System.Net.HttpWebRequest.CheckRequestStarted ()
at System.Net.HttpWebRequest.set_Accept (System.String value)
ボタンに関連付けられた NewBehaviourScript クラスのコード:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using OntSenseCSharpAPI;
using System;
using VDS.RDF.Query;
using VDS.RDF.Update;
public class NewBehaviourScript : MonoBehaviour {
private SparqlRemoteUpdateEndpoint endpoint;
// Use this for initialization
void Start() {
// Start access to Sparql End Point : just one time at main method is enough
endpoint = new SparqlRemoteUpdateEndpoint("http://localhost:3030/test/update");
}
// Update is called once per frame
void Update() {
}
public void oneTriple() {
String updateCmd =
"PREFIX ontsense: < http://example.org/sense#> " +
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
"INSERT DATA" +
" {" +
" ontsense: dotNetRDF rdf:comment \"dotNetRDF is a great tool.\"@en . " +
"}";
print(updateCmd);
try
{ // Try to access a resource.
endpoint.Update(updateCmd);
}
catch (Exception e)
{
print(e); // // Call a custom error logging procedure.
throw; // Re-throw the error. It is likely to interrupt the application
}
}
}
dotNetRDF パッケージを使用して別の Visual Studio プロジェクトを作成すると、Sparql エンドポイントとのやり取りが完全に機能することに注意してください。
今のところ、そのアプリケーションを構築するためのソリューションを採用しました。したがって、私のシステムは、Unity からソケットを介して送信された Sparql 更新コマンドを受信するアプリケーションで動作します。確かに理想的な形ではありませんが、問題の決定的な解決策が得られるまでは使用されます。