我打算在社交网站上工作,我想利用文档和图形数据库来获得所有需要的功能.有没有办法让Meteor.js或Sail.js(或更好)与ArangoDB或OrientDB一起工作?或者我应该坚持使用捆绑的MongoDB并集成像allegrograph DB这样的东西?
这两个图形数据库有什么区别:Neo4j和AllegroGraph?哪个更适合Java Web编程?
我正在使用AllegroGraph来存储这样的语句:
<newsid1  hasAnnotation  Gamma>
<newsid1  hasAnnotation Beta>
我想在这个staments上定义一条规则:如果主题 newsid1 hasAnnotation 是 Gamma 或者 Beta,那么 在triplestore中添加一个说明主题的新语句hasAnnotation Theta,即语句
<newsid1  hasAnnotation Theta>
我的问题如下:
我想用rails编写一个Web应用程序,它使用RDF来表示链接数据.但我真的不知道在数据库中存储RDF图表以实现持久存储的最佳方法.另外,我想使用像paper_trail这样的东西来提供版本控制数据库对象.
我读到了RDF.rb和activeRDF.但是RDF.rb不包含用于在数据库中存储数据的层.那么activeRDF怎么样?
我是RDF的新手.使用rails处理大型RDF图的最佳方法是什么?
编辑:
我发现4Store和AllegroGraph适合Ruby on Rails.我读到4Store完全是免费的,AllegroGraph在免费版中限制为5000万三倍.他们每个人的优势是什么?
谢谢.
我有以下SPARQL查询:
SELECT ?label ?img 
WHERE
{
  ?uri rdfs:label ?label .
  ?uri vtio:hasImage ?img .
}
结果如下:
label | img
-------------
label | link1
labe2 | link2
…
我也希望标签没有?img也匹配ie条目在哪里?img,NULL即我想要如下结果:
label  | img
--------------
label1 | link1
label2 |
label3 | link3
…
如果我使用我之前的查询,结果label2将不会显示?
如何修改我的查询以包括这样的行?
考虑具有根节点“A”和“hasChild”关系(例如产品结构)的树如下:

目标是找出:哪些节点在树外有父节点?
在这种情况下,答案应该是“B”和“Q”,因为它们在树外有父母。
查询应该去每个节点并检查它的父节点,而不是创建一个子节点列表并检查每个节点我猜。
我怎样才能有效地(应该为数百万个节点工作)用 SPARQL 遍历这棵树并回答这个问题?
这是我尝试过的,但结果为 0:
PREFIX xxx:         <http://example.org/xxx#>
select * where {
   xxx:A   xxx:hasChild*  ?child .
   ?child  ^xxx:hasChild  ?foreignParent . 
   ?child  ^xxx:hasChild  ?parent .
   FILTER (?parent =! ?foreignParent) .
}
附上各自的样本数据:
<?xml version="1.0"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:xxx="http://example.org/xxx#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
  xml:base="http://example.org/xxx">
  <owl:Ontology rdf:about="">
    <owl:versionInfo>Created with TopBraid Composer</owl:versionInfo>
  </owl:Ontology>
  <owl:Class rdf:ID="Other">
    <rdfs:label>Other</rdfs:label>
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
  </owl:Class>
  <owl:Class rdf:ID="Item">
    <rdfs:label>Item</rdfs:label>
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
  </owl:Class>
  <rdf:Property rdf:ID="hasChild">
    <rdfs:range rdf:resource="#Item"/>
    <rdfs:range rdf:resource="#Other"/>
    <rdfs:domain rdf:resource="#Item"/>
    <rdfs:label>has child</rdfs:label>
  </rdf:Property>
  <xxx:Other rdf:ID="Fake_1">
    <xxx:hasChild>
      <xxx:Item rdf:ID="B">
        <xxx:hasChild> …您好我正在使用AllegroGraph和Sparql查询来检索结果.这是一个重现我的问题的示例数据.考虑以下数据,其中一个人有姓,中名和姓.
<http://mydomain.com/person1> <http://mydomain.com/firstName> "John"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person1> <http://mydomain.com/middleName> "Paul"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person1> <http://mydomain.com/lastName> "Jai"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
<http://mydomain.com/person6> <http://mydomain.com/middleName> "Mannan"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person6> <http://mydomain.com/lastName> "Sathish"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person6> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
现在我需要通过组合所有3个名称来计算人名.名称是可选的,一个人可能没有任何名字,中间名和姓.
查询我试过了
select ?person ?name ?firstName ?middleName ?lastName where 
{
  ?person rdf:type  <http://mydomain.com/person>.
    optional {?person <http://mydomain.com/firstName> ?firstName}.
    optional {?person <http://mydomain.com/middleName> ?middleName}.
    optional {?person <http://mydomain.com/lastName> ?lastName}.    
    bind (concat(str(?firstName),str(?middleName),str(?lastName)) as ?name).
} 
但是结果集不包含person6(Mannan Sathish)的名称,因为第一个名称不存在.如果我没有绑定,请告诉我是否可以忽略firstName.

Allegrograph基本上是一个RDF三合一(实际上是五个领域)商店.那么为什么我们不能创建一个包含五列的MySQL表并将三元组存储在其中.?
AG对这样的MySql表有什么功能?
我使用AllegroGraph和Sparql来查询结果.我试图基于字母顺序排序,但Sparql给大写更多的偏好.下面是类似的数据和查询,类似于我的问题.
数据:
<http://mydomain.com/person1> <http://mydomain.com/name> "John"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
<http://mydomain.com/person2> <http://mydomain.com/name> "Abraham"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>    
<http://mydomain.com/person3> <http://mydomain.com/name> "edward"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
我试图根据名字的字母顺序排序 - 所以结果应该是亚伯拉罕,爱德华和约翰.但结果是亚伯拉罕,约翰和爱德华,因为爱德华从小案开始.请让我知道如何实现这一目标.
查询:
select ?person ?name where
{
  ?person <http://mydomain.com/name> ?name.
  ?person <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>.
  } order by asc(str(?name))
我使用 AllegroGraph 和 Sparql 1.1。
我需要对列进行升序排序,并使 Sparql 查询最后返回空值。
样本数据:
<http://mydomain.com/person1> <http://mydomain.com/name> "John"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
<http://mydomain.com/person2> <http://mydomain.com/name> "Abraham"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
<http://mydomain.com/person2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
<http://mydomain.com/person3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>
这里我需要 Sparql 来返回 Abraham,然后是没有 name 属性的 John 和 person3。
我使用的查询:
select ?name ?person {
  ?person <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mydomain.com/person>.
  optional {?person  <http://mydomain.com/name> ?name.}
  } order by asc(?name )
当前输出是 person3 (null),其次是 Abraham 和 John。
 请让我知道你的想法。
请让我知道你的想法。
allegrograph ×10
sparql ×5
rdf ×3
semantic-web ×2
4store ×1
activerecord ×1
arangodb ×1
graph ×1
meteor ×1
neo4j ×1
nosql ×1
orientdb ×1
rdfstore ×1
reasoning ×1
sails.js ×1
social-graph ×1
sql ×1
triplestore ×1