我是Neo4j的新手,现在是我所有图形数据库的主要候选人。我正在撰写关于将数据库集成到智能城市的论文,而Neo4j是最适合此目的的候选者之一,如果不是最好的话。
但是,我无法让Neo4j的SPARQL插件正常运行。我也是Maven的新手,但是我能够从GitHub下载插件并编译它 - 但是,我必须跳过测试才能编译它。无论如何,'建立成功。'
我按照说明
http://neo4j-contrib.github.io/sparql-plugin/
我想我能够将示例四边形(示例1)插入到我的数据库中:
curl -X POST -H Content-Type:application / json -H Accept:application / json --data-binary @ sampledata.txt -v
http:// l o c a l h o s t :7474/db/data/ext/SPARQLPlugin/graphdb/insert_quad
响应:
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 7474 (#0)
> POST /db/data/ext/SPARQLPlugin/graphdb/insert_quad HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:7474
> Content-Type:application/json
> Accept:application/json
> Content-Length: 130
>
* upload completely sent off: 130 out of 130 bytes
< HTTP/1.1 204 No Content
< Access-Control-Allow-Origin: *
* Server Jetty(9.0.5.v20130815) is not blacklisted
< Server: Jetty(9.0.5.v20130815)
<
* Connection #0 to host localhost left intact
但是,我在我的数据库中找不到那个四元组。我想这是一个查询&#39; MATCH(n)RETURN n LIMIT 100&#39;会告诉他们,对吗?无论如何,我只找到一个带有一个属性的节点,&#39;值:urn:com.tinkerpop.blueprints.pgm.oupls.sail:namespaces。&#39;当我尝试查询时(例2):
curl -X POST -H Content-Type:application / json -H Accept:application / json --data-binary @ sampledata.txt -v http:// localhost:7474 / db / data / ext / SPARQLPlugin / graphdb / execute_sparql
响应:
- 在DNS缓存中找不到主机名
- 尝试127.0.0.1 ...
- 连接到localhost(127.0.0.1)端口7474(#0)
POST / db / data / ext / SPARQLPlugin / graphdb / execute_sparql HTTP / 1.1 User-Agent:curl / 7.35.0 主持人:localhost:7474 内容类型:应用程序/ JSON 接受:应用/ JSON 内容长度:74
- 上传已完全发送:74个字节中的74个&lt; HTTP / 1.1 500服务器错误&lt; Content-Type:application / json; charset = UTF-8&lt; Access-Control-Allow-Origin:*&lt;内容长度:3274
- Server Jetty(9.0.5.v20130815)未列入黑名单&lt;服务器:Jetty(9.0.5.v20130815)&lt; {&#34; message&#34; : &#34; org.openrdf.query.algebra.Var.setConstant(Z)V&#34;,&#34; exception&#34; : &#34; NoSuchMethodError&#34;,&#34; fullname&#34; :&#34; java.lang.NoSuchMethodError&#34;,
&#34;堆栈跟踪&#34; :[ &#34; org.openrdf.query.parser.sparql.TupleExprBuilder.createConstVar(TupleExprBuilder.java:340)&#34 ;, &#34; org.openrdf.query.parser.sparql.TupleExprBuilder.mapValueExprToVar(TupleExprBuilder.java:271)&#34 ;, &#34; org.openrdf.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:1512)&#34 ;, &#34; org.openrdf.query.parser.sparql.ast.ASTPathSequence.jjtAccept(ASTPathSequence.java:20)&#34 ;, &#34; org.openrdf.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:1323)&#34 ;, &#34; org.openrdf.query.parser.sparql.ast.ASTPathAlternative.jjtAccept(ASTPathAlternative.java:18)&#34 ;, &#34; org.openrdf.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:1875)&#34 ;, &#34; org.openrdf.query.parser.sparql.ast.ASTPropertyListPath.jjtAccept(ASTPropertyListPath.java:18)&#34 ;, &#34; org.openrdf.query.parser.sparql.ast.SimpleNode.childrenAccept(SimpleNode.java:157)&#34 ;, &#34; org.openrdf.query.parser.sparql.ASTVisitorBase.visit(ASTVisitorBase.java:979)&#34 ;, &#34; org.openrdf.query.parser.sparql.ast.ASTTriplesSameSubjectPath.jjtAccept(ASTTriplesSameSubjectPath.java:18)&#34 ;, &#34; org.openrdf.query.parser.sparql.ast.SimpleNode.childrenAccept(SimpleNode.java:157)&#34 ;, &#34; org.openrdf.query.parser.sparql.ASTVisitorBase.visit(ASTVisitorBase.java:421)&#34 ;, &#34; org.openrdf.query.parser.sparql.ast.ASTBasicGraphPattern.jjtAccept(ASTBasicGraphPattern.java:19)&#34 ;, &#34; org.openrdf.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:1144)&#34 ;, &#34; org.openrdf.query.parser.sparql.ast.ASTGraphPatternGroup.jjtAccept(ASTGraphPatternGroup.java:19)&#34 ;, &#34; org.openrdf.query.parser.sparql.ast.SimpleNode.childrenAccept(SimpleNode.java:157)&#34 ;, &#34; org.openrdf.query.parser.sparql.ASTVisitorBase.visit(ASTVisitorBase.java:1021)&#34 ;, &#34; org.openrdf.query.parser.sparql.ast.ASTWhereClause.jjtAccept(ASTWhereClause.java:19)&#34 ;, &#34; org.openrdf.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:389)&#34 ;, &#34; org.openrdf.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:228)&#34 ;, &#34; org.openrdf.query.parser.sparql.ast.ASTSelectQuery.jjtAccept(ASTSelectQuery.java:19)&#34 ;, &#34; org.openrdf.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:378)&#34 ;, &#34; org.openrdf.query.parser.sparql.TupleExprBuilder.visit(TupleExprBuilder.java:228)&#34 ;, &#34; org.openrdf.query.parser.sparql.ast.ASTQueryContainer.jjtAccept(ASTQueryContainer.java:21)&#34 ;, &#34; org.openrdf.query.parser.sparql.SPARQLParser.buildQueryModel(SPARQLParser.java:210)&#34 ;, &#34; org.openrdf.query.parser.sparql.SPARQLParser.parseQuery(SPARQLParser.java:164)&#34 ;, &#34; org.neo4j.server.plugin.sparql.SPARQLPlugin.executeSPARQL(SPARQLPlugin.java:68)&#34 ;, &#34; java.lang.reflect.Method.invoke(Method.java:606)&#34 ;, &#34; org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:61)&#34 ;, &#34; org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:159)&#34 ;, &#34; org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:312)&#34 ;, &#34; org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:134)&#34 ;, &#34; java.lang.reflect.Method.invoke(Method.java:606)&#34 ;, &#34; org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)&#34 ;, &#34; java.lang.Thread.run(Thread.java:744)&#34; ]- 连接#0以托管localhost保持原样
我想知道可能导致这种行为的原因。根据我发现的所有说明,我已经尝试了许多配置的SPARQL插件,但该插件只是拒绝工作。
顺便说一句,我想知道它是否适合生产使用。有人可以对此发表评论吗?
或许有更多方法让RDF在Neo4j中运行?由于我是Neo4j的新手,我当然对那些易于安装和定制的解决方案感兴趣。嗯,首先,它们应该真正用于生产。
Neo4j工作得很好! REST API工作正常,但我想尽可能将它与SPARQL端点进行比较。