Protege錯誤An error related to DOT的解決辦法
當時安裝protege3.3後,用示例測試,當調用OWLVizTab時總出現An error related to DOT:
到處找原因找不著,是一個叫Graphviz的外掛程式沒有安裝,於是到處找這個外掛程式,最後啃半天英文終於在這裡http://www.graphviz.org/Download_windows.php找到了這個外掛程式,下載後安裝,以為可以了,可是仍然出現這樣的問題。
這個問題再不解決,本體也就無從做起,所以鐵了心把它給解決,在W3C論壇上找到解決辦法。 出錯原因: 事實上出錯圖片已經提示了,為“與DOT應用程式相關的錯誤出現了,原因很可能是OWL VIZ找不到DOT應用程式,請確保DOT應用程式的路徑設置正確”,這點英文倒不難懂,只是不知道DOT是個什麼東西就難辦,實質上DOT就是Graphviz程式中的一個可執行檔,功能是生成關係圖的。 那麼既然安裝了Graphviz這個程式,那為什麼還出錯呢?其實是Protege沒能調用成功,也就是提示說的路徑設置不正確。 解決辦法: 安裝graphviz2.12.exe檔(當然也可是其它版本),可以預設路徑安裝(C:\Program Files\ATT\Graphviz\bin)也可安在其它地方,但要清楚自己安裝在哪了,即記下這個路徑,然後找到protege的安裝目錄,在該目錄下找到plugins資料夾下的dfki.protege.ontoviz 中的protege.properties文件,點右鍵用記事本找開。 檔內容為: #Protege Properties #Thu Nov 09 12:33:49 PST 2000 dot.fontsize=-2 mainframe.rectangle=81\ 95\ 918\ 616 dot.font=Arial dot.command=C\:\\Program\ Files\\graphviz\\bin\\dot 問題就出在dot.command=後面的路徑上,只有把這個路徑改為剛安裝的Graphviz外掛程式中dot.exe檔的路徑才行,但改不是直接的粘貼,可以看到有些地方是雙斜線,那麼可以仿照修改如改為:dot.command=C\:\\Program\ Files\\ATT\\graphviz\\bin\\dot 保存後測試就行了。
|
英國旅遊民宿推薦 發表在 痞客邦 留言(0) 人氣(190)
英國旅遊民宿推薦 發表在 痞客邦 留言(0) 人氣(156)
Protégé Plug-in API is a huge program, consists of well-known packages, such as Jena, Xerces, log4j, Junit, etc. If you have no intention of updating the source code, you can pack the sources into jar files for the convenience in the future.
Installation & Getting Started
Download the sources of Protégé-OWL 3.2.1 and Core Protégé and Protégé-Frames 3.2.1
Unzip the files
Copy the sources of Protégé-OWL and Core Protégé to a directory /src.
Protégé-OWL will create directories and files under edu/stanford/smi/protegex
Core Protégé will create directories and files under edu/stanford/smi/protege
Copy the JAR files to /lib. I suggest that copy the Protégé-OWL library first, it includes lots of JAR files. While copy the Core Protégé to /lib will contain a duplicate JAR (junit.jar), ignore it, and copy the other two JAR files (looks.jar and unicode_panel.jar) to the library.
Using Java IDE to create a new project in , add all JAR in the /lib to java classpath, and then compile all .java files, where the .class files will be created in /class.
Make jar files. Change directory to /class and type the following commands:
jar cvf protegex.jar edu/stanford/smi/protegex/*
jar cvf protege.jar edu/stanford/smi/protege/*
Copy the /lib/*.jar, protegex.jar and protege.jar to your working directory .
A Sample Test Program
In your you can write a small test program, such as the following:
package test;
import edu.stanford.smi.protegex.owl.model.OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.ProtegeOWL;
public class OWLAPIDemoApplication {
public static void
main(String[] args) {
OWLModel owlModel = ProtegeOWL.createJenaOWLModel();
owlModel.getNamespaceManager().setDefaultNamespace("http://hello.com#");
OWLNamedClass worldClass = owlModel.createOWLNamedClass("World");
System.out.println("Class URI: " + worldClass.getURI());
}
}
Execute this program stand-alone. The output should be Class URI: http://hello.com#World.
英國旅遊民宿推薦 發表在 痞客邦 留言(0) 人氣(216)
Protege是很有名的一套編寫ontology的軟體 JessTab可讓Protege使用用JAVA編寫的推理引擎JESS 目前Protege已經都把JessTab的Plug-in裝好了 只要下載JESS放進plug-in的檔案夾中即可以使用 若需使用到模糊變數 我們不論是單獨在JESS中或使用JAVA都可以用FuzzyJ這個套件 但若要在Protege內借助JessTab來整合Ontology、推理語言與模糊變數時 原始的JessTab會無法使用模糊變數 解決的方法為取得JessTab的原始碼 在JessTabEngine.java中將建構式裡的engine = new Rete(); 置換成engine = new FuzzyRete(); 當然也要記得import FuzzyJ的JAR檔 Compile完後打包成JessTab的JAR檔並置換原先的JAR檔 就可以在JessTab內使用FuzzyJ啦 |
英國旅遊民宿推薦 發表在 痞客邦 留言(2) 人氣(169)