Yasgui SPARQL查询搜索FOAF名称不';行不通

Yasgui SPARQL查询搜索FOAF名称不';行不通,sparql,Sparql,我使用Jamendo Yasgui SPARQL查询来搜索艺术家姓名。它的工作原理如下: 前缀mo: 前缀foaf: 前缀rdf: 选择*WHERE{a mo:MusicArtist;foaf:name?name;} 如果我想找到一个像下面这样的特定名称,它不起作用。为什么? 前缀mo: 前缀foaf: 前缀rdf: 选择*WHERE{a mo:MusicArtist;foaf:name“Carton”;} 数据存在,如您在RDF/XML中所见: 纸箱 由于SPARQL语法的构建类似于Tur

我使用Jamendo Yasgui SPARQL查询来搜索艺术家姓名。它的工作原理如下:

前缀mo:
前缀foaf:
前缀rdf:
选择*WHERE{a mo:MusicArtist;foaf:name?name;}
如果我想找到一个像下面这样的特定名称,它不起作用。为什么?

前缀mo:
前缀foaf:
前缀rdf:
选择*WHERE{a mo:MusicArtist;foaf:name“Carton”;}
数据存在,如您在RDF/XML中所见:

纸箱

由于SPARQL语法的构建类似于Turtle语法(反之亦然),因此在构建SPARQL查询时,查看Turtle中的数据通常会很有帮助。这是RDF/XML--


纸箱
--跟这只乌龟说的一样--

前缀rdfs:。
前缀owl:。
前缀foaf:。
前缀xsd:。
A.
rdfs:资源;
猫头鹰:萨摩亚;
foaf:based_near;
foaf:主页;
foaf:img;
foaf:制造;
foaf:name“Carton”^^xsd:string。
--因此您的SPARQL查询必须是(模空格,每个空格可以缩减为一个空格)--

前缀mo:
前缀foaf:
前缀rdf:
前缀xsd:
选择*WHERE{?a mo:MusicArtist;
foaf:name“Carton”^^xsd:string}

ok,但您也可以在RDF/XML示例中看到数据类型……您必须为RDF中的文本使用给定的数据类型,因为SPARQL是精确的模式匹配<代码>前缀mo:前缀foaf:前缀rdf:选择*WHERE{?a mo:MusicArtist;foaf:名称“Carton”^^}非常感谢。我是Sparql的新手,还有很多我不明白的地方。根据介绍,以下代码应该可以工作,因为foaf:Based_near连接到geonames。但它不起作用。你知道为什么吗<代码>前缀rdf:前缀rdfs:前缀foaf:前缀gn:选择不同的?一个地方?地理{?一个foaf:名称?名称。?一个foaf:基于附近的?地方。?地方gn:名称?地理。}按?地理排序您希望该地方得到什么?它不起作用,因为数据不存在,或者更好地说,没有加载到您使用的triple store(又名数据库)中。哪一个教程告诉您它应该工作?在这里的第4点下:在xml数据中,每个foaf:based_near属性都有一个地理位置URI。难道我就不能找到那个地理位置的标签吗?如果不是,我不理解链接数据的概念。好的,但是这个页面可能已经过时或者仅仅是错误的。您可以使用
SELECT*WHERE{s?place.?place?p?o}limit 10检查是否没有关于这些地点的此类数据
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE rdf:RDF><rdf:RDF xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:ns1="http://purl.org/ontology/mo/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
<ns1:MusicArtist rdf:about="http://dbtune.org/jamendo/artist/5655">
  <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource"/>
  <owl:sameAs rdf:resource="http://zitgist.com/music/artist/b8b40a3c-91c0-413b-a4f9-194ef0c7151a"/>
  <foaf:based_near rdf:resource="http://sws.geonames.org/2802361/"/>
  <foaf:homepage rdf:resource="http://cartonpate.com"/>
  <foaf:img rdf:resource="http://img.jamendo.com/artists/c/carton.jpg"/>
  <foaf:made rdf:resource="http://dbtune.org/jamendo/record/4957"/>
  <foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Carton</foaf:name>
</ns1:MusicArtist>

</rdf:RDF>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
PREFIX  owl: <http://www.w3.org/2002/07/owl#> .
PREFIX foaf: <http://xmlns.com/foaf/0.1/> .
PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://dbtune.org/jamendo/artist/5655>
   a               <http://purl.org/ontology/mo/MusicArtist>, 
                   rdfs:Resource ;
   owl:sameAs      <http://zitgist.com/music/artist/b8b40a3c-91c0-413b-a4f9-194ef0c7151a> ;
   foaf:based_near <http://sws.geonames.org/2802361/> ;
   foaf:homepage   <http://cartonpate.com> ;
   foaf:img        <http://img.jamendo.com/artists/c/carton.jpg> ;
   foaf:made       <http://dbtune.org/jamendo/record/4957> ;
   foaf:name       "Carton"^^xsd:string .
PREFIX   mo: <http://purl.org/ontology/mo/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX  rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#> 

SELECT * WHERE { ?a a         mo:MusicArtist ;
                    foaf:name "Carton"^^xsd:string }