标签: allegrograph

Sails.js或Meteor.js可以与ArangoDB或OrientDB一起使用吗?

我打算在社交网站上工作,我想利用文档和图形数据库来获得所有需要的功能.有没有办法让Meteor.js或Sail.js(或更好)与ArangoDB或OrientDB一起工作?或者我应该坚持使用捆绑的MongoDB并集成像allegrograph DB这样的东西?

allegrograph orientdb meteor arangodb sails.js

6
推荐指数
1
解决办法
1191
查看次数

图数据库之间的区别:Neo4j和AllegroGraph

这两个图形数据库有什么区别:Neo4j和AllegroGraph?哪个更适合Java Web编程?

allegrograph social-graph neo4j nosql

6
推荐指数
4
解决办法
6041
查看次数

定义AllegroGraph三元组的规则以及如何应用它们

我正在使用AllegroGraph来存储这样的语句:

<newsid1  hasAnnotation  Gamma>
<newsid1  hasAnnotation Beta>
Run Code Online (Sandbox Code Playgroud)

我想在这个staments上定义一条规则:如果主题 newsid1 hasAnnotation Gamma 或者 Beta,那么 在triplestore中添加一个说明主题的新语句hasAnnotation Theta,即语句

<newsid1  hasAnnotation Theta>
Run Code Online (Sandbox Code Playgroud)

我的问题如下:

  1. 我如何为Allegro定义这样的规则?
  2. 我如何在声明中应用这些规则?

semantic-web allegrograph reasoning

5
推荐指数
1
解决办法
437
查看次数

如何在数据存储中存储RDF图?

我想用rails编写一个Web应用程序,它使用RDF来表示链接数据.但我真的不知道在数据库中存储RDF图表以实现持久存储的最佳方法.另外,我想使用像paper_trail这样的东西来提供版本控制数据库对象.

我读到了RDF.rb和activeRDF.但是RDF.rb不包含用于在数据库中存储数据的层.那么activeRDF怎么样?

我是RDF的新手.使用rails处理大型RDF图的最佳方法是什么?

编辑:

我发现4StoreAllegroGraph适合Ruby on Rails.我读到4Store完全是免费的,AllegroGraph在免费版中限制为5000万三倍.他们每个人的优势是什么?

谢谢.

activerecord rdf ruby-on-rails allegrograph 4store

5
推荐指数
1
解决办法
757
查看次数

在SPARQL中匹配值为NULL的位置

我有以下SPARQL查询:

SELECT ?label ?img 
WHERE
{
  ?uri rdfs:label ?label .
  ?uri vtio:hasImage ?img .
}
Run Code Online (Sandbox Code Playgroud)

结果如下:

label | img
-------------
label | link1
labe2 | link2
…
Run Code Online (Sandbox Code Playgroud)

我也希望标签没有?img也匹配ie条目在哪里?img,NULL即我想要如下结果:

label  | img
--------------
label1 | link1
label2 |
label3 | link3
…
Run Code Online (Sandbox Code Playgroud)

如果我使用我之前的查询,结果label2将不会显示?

如何修改我的查询以包括这样的行?

sql allegrograph sparql

4
推荐指数
1
解决办法
2518
查看次数

如何在 SPARQL 中遍历 RDF 树并找到树外的连接?

考虑具有根节点“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) .
}
Run Code Online (Sandbox Code Playgroud)

附上各自的样本数据:

<?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> …
Run Code Online (Sandbox Code Playgroud)

rdf semantic-web allegrograph sparql triplestore

4
推荐指数
1
解决办法
461
查看次数

Sparql - 如果未绑定任何一个变量,则连接失败

您好我正在使用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>
Run Code Online (Sandbox Code Playgroud)

现在我需要通过组合所有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).
} 
Run Code Online (Sandbox Code Playgroud)

但是结果集不包含person6(Mannan Sathish)的名称,因为第一个名称不存在.如果我没有绑定,请告诉我是否可以忽略firstName.

结果集

allegrograph sparql

3
推荐指数
1
解决办法
1338
查看次数

allegrograph和五列mysql表之间的区别是什么?

Allegrograph基本上是一个RDF三合一(实际上是五个领域)商店.那么为什么我们不能创建一个包含五列的MySQL表并将三元组存储在其中.?

AG对这样的MySql表有什么功能?

rdf graph allegrograph rdfstore

3
推荐指数
1
解决办法
429
查看次数

Sparql - 按字母顺序排序的问题

我使用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>
Run Code Online (Sandbox Code Playgroud)

我试图根据名字的字母顺序排序 - 所以结果应该是亚伯拉罕,爱德华和约翰.但结果是亚伯拉罕,约翰和爱德华,因为爱德华从小案开始.请让我知道如何实现这一目标.

查询:

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))
Run Code Online (Sandbox Code Playgroud)

allegrograph sparql

2
推荐指数
1
解决办法
1531
查看次数

Sparql - 按顺序最后返回空值

我使用 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>
Run Code Online (Sandbox Code Playgroud)

这里我需要 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 )
Run Code Online (Sandbox Code Playgroud)

当前输出是 person3 (null),其次是 Abraham 和 John。 在此处输入图片说明 请让我知道你的想法。

allegrograph sparql

2
推荐指数
1
解决办法
752
查看次数