我单击file->project structure->libraries
并添加了apache-jena-3.0.0/lib
,/libsrc
和javadoc-core
.
然后我将src-example文件夹中的教程复制到我的intellij项目的src文件中,然后
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.vocabulary.*;
public class Tutorial01 extends Object {
// some definitions
static String personURI = "http://somewhere/JohnSmith";
static String fullName = "John Smith";
public static void main (String args[]) {
// create an empty model
Model model = ModelFactory.createDefaultModel();
// create the resource
Resource johnSmith = model.createResource(personURI);
// add the property
johnSmith.addProperty(VCARD.FN, fullName);
}
}
然后它说无法解析hp,MODEl,Resource。有谁知道为什么?
jena version 3.0.0
ubuntu 15.04
intellij 14.1.4
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
whereis java: /jvm/java-8-oracle/jre/bin/java