rdf在净豆上使用apache jena [英] rdf using apache jena on net beans
问题描述
我想创建一个简单的RDF图,然后尝试使用SPARQL进行简单查询.由于我熟悉Java和Net Bean,因此我想在NetBeans上使用Apache Jena.我从 http://www.apache.org/dist/jena/下载了相关文件.
I want to create a simple RDF graph and then try simple querying using SPARQL. Since I'm familiar with java and net beans, I want to use Apache Jena on NetBeans. I downloaded the related files from http://www.apache.org/dist/jena/ .
接下来应该怎么做才能在Net Bean上编写RDF代码?即我应该在某处安装某些东西还是添加lib文件/jar文件?
What should I do next to write RDF codes on net beans? i.e Should I install something or add lib files/jar files somewhere?
推荐答案
(对Ian的回复发表评论的时间太长了)
(Too long for a comment on Ian's reply)
在Netbeans上,Maven很容易,并且是入门所需的一切的好方法(如Ian所说).这是启动耶拿项目的快速指南:
Maven is easy on netbeans, and a good way to get started with everything you need (as Ian says). Here's a quick guide to start a jena project:
-
File -> New Project
.选择Maven
然后选择Java Application
. - 选择项目名称,位置等,然后选择
Finish
. - Netbeans将创建一个新的maven项目并打开它.
- 右键单击
Dependencies
,选择Add Dependency...
. - 使用
org.apache.jena
作为组ID,使用jena-core
(如果需要SPARQL,则使用jena-arq
)作为工件ID,并使用2.10.1
作为版本. - 打开
Dependencies
文件夹.它应该有一个数字罐子-这些是jena及其必需的罐子.您可能需要再次右键单击Dependencies
,然后选择Download Declared Dependencies
以确保可以使用jena. - 在
Source Packages
下,您会找到App.java
.尝试一些简单的jena api教程,然后尝试运行它们.
File -> New Project
. ChooseMaven
thenJava Application
.- Pick project name, location, etc., then
Finish
. - Netbeans will create a new maven project and open it.
- Right click on
Dependencies
, chooseAdd Dependency...
. - Use
org.apache.jena
as the Group ID,jena-core
(orjena-arq
if you want SPARQL) as the Artifact ID, and2.10.1
as the Version. - Open the
Dependencies
folder. It ought to have a number jars present -- these are jena and its required jars. You might need to right-click onDependencies
again and chooseDownload Declared Dependencies
to ensure jena is ready for use. - Under
Source Packages
you'll findApp.java
. Try some of the simple jena api tutorials and try running them.
这篇关于rdf在净豆上使用apache jena的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!