sparql - 对我的 Sesame 数据存储的所有 SPARQL 查询都失败(不返回任何内容)。我什么配置不正确?

标签 sparql sesame openrdf sparqlwrapper

我已经在 ubuntu Linux 上的 tomcat7 下安装了 openrdf-sesame 和 openrdf-workbench (2.8.6)。我加载了以下数据:

@prefix mur: <http://madeup.com/recipe#>.
@prefix branda: <http://madeup.com/branda#>.
@prefix brandb: <http://madeup.com/brandb#>.
@prefix brandc: <http://madeup.com/brandc#>.

mur:sausage a mur:sausage;
    mur:label "sausage".

branda:sausage a mur:sausage;
    branda:label "Brand A extra spicy sausage";
    branda:href "http://www.google.com/";
    branda:image "http://lorempixel.com/600/300/food/4/Brand%20A%20extra%20spicy%20sausage";
    mur:upc "01234".

brandb:sausage a mur:sausage;
    brandb:label "Brand B mild sausage";
    brandb:href "http://www.bing.com/";
    brandb:image "http://lorempixel.com/600/300/food/3/Brand%20B%20mild%20sausage";
    mur:upc "56789".

brandc:stockpot a mur:stockpot.

mur:spaghetti_recipe a mur:Recipe;
    mur:label "World famous sausage and spaghetti";
    mur:has_ingredient mur:sausage,
        [ a mur:sausage;
          mur:quantity "2";
          mur:units "lbs";
          mur:note "2 lbs sausage casings removed";
          branda:note "2 lbs Brand A extra spicy sausage (caseless)";
          brandb:note "2 lbs (1 package) of Brand B mild sausage with the casings removed"
        ];
    mur:has_ingredient mur:onion,
        [ a mur:onion;
          mur:quantity "1";
          mur:size "small";
          mur:label "1 small onion, chopped (optional)"
        ];
    mur:has_ingredient mur:garlic,
        [ a mur:garlic;
          mur:quantity "3";
          mur:label "3 garlic cloves, minced"
        ];
    mur:has_ingredient mur:tomato,
        [ a mur:tomato;
          mur:quantity "28";
          mur:units "ounces";
          mur:label "28 ounces of diced tomatoes"
        ];
    mur:has_ingredient mur:tomato_paste,
        [ a mur:tomato_paste;
          mur:quantity "12";
          mur:units "ounces";
          mur:label "12 ounces of tomato paste"
        ];
    mur:has_ingredient mur:water,
        [ a mur:water;
          mur:quantity "2";
          mur:units "cups";
          mur:label "If you want to simmer it as less, add less)"
        ];
   mur:has_ingredient mur:basil,
        [ a mur:basil;
          mur:quantity "3";
          mur:units "teaspoons";
          mur:label "3 teaspoons basil"
        ];
    mur:has_ingredient mur:spaghetti,
        [ a mur:spaghetti;
          mur:subtype "thin";
          mur:quantity "1";
          mur:units "lb";
          mur:label "1 lb thin spaghetti"
        ];
    mur:has_direction
        [ mur:step 1;
          mur:uses mur:sausage;
          mur:uses mur:stockpot;
          mur:label "In large, heavy stockpot, brown sausage, breaking up as you stir";
          branda:label "In large, heavy stockpot, brown Brand A extra spicy sausage, breaking up as you stir";
          brandb:label "In large, heavy stockpot, brown Brand B mild sausage breaking up as you stir"
        ].

我似乎无法对其执行任何 sparql 查询。我试过:

select distinct ?property
where { 
    ?s ?property ?o .
}

我没有从该查询中得到任何结果。当我从工作台尝试时,我在浏览器中看到一个页面,上面写着:此 XML 文件似乎没有任何与之关联的样式信息。文档树如下所示。然后下面就什么都没有了。当我在 python 中使用 SPARQLWrapper 尝试相同的查询时,我还得到一个空的 XML 文档作为我的结果。在工作台中,如果我单击上下文,我可以看到我的上下文,如果我单击命名空间,我可以看到我的 nsamspaces,但是如果我单击类型,服务器会抛出 500 错误。 “java.lang.NoClassDefFoundError: java/util/Objects”位于堆栈跟踪的顶部。

有什么想法吗?

最佳答案

事实证明,一些 Java 7 功能意外进入了 Sesame 2.8 代码库。尽管文档说 Sesame 2.8 与 Java 6 兼容,但 2.8.6 版本实际上需要 Java 7 运行时。

这是一个错误(请参阅 SES-2325 ),并将在下一个 Sesame 补丁版本中修复。与此同时,解决方法是升级到 Java 7 或 8(无论如何,这确实是一个非常好的主意)。

关于sparql - 对我的 Sesame 数据存储的所有 SPARQL 查询都失败(不返回任何内容)。我什么配置不正确?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32924061/

相关文章:

java - 芝麻 2.7.11 更改服务器消息

android - 如何在 Android 中使用 SPARQL 在 Sesame openrdf 中查询?

java - Java中如何使用RDFS描述类和属性

java - Sesame中BNode的解决方案

mysql - 通过 openRDF Sesame 访问后端数据库

string - 使用 SPARQL 查询与字符串的最佳匹配?

sparql - 使用 Sparql 创建 URI 的最佳方法(如自动递增)

javascript - 如何在 Javascript 中查询 Dbpedia

SPARQL 查找孙子的数量

maven - 不包括依赖的依赖