当我将RDF海龟添加到芝麻服务器时出现错误消息



我对语义网技术很陌生,我正在努力理解。

我已经安装了芝麻2.8服务器和Apache Tomcat

我试图向存储库添加一些RDF数据,并且成功地使用了来自Internet的一些示例。然而,我试图建立一个小的海龟文件,并将其添加到存储库作为一个文件,我得到了以下消息:序言中不允许有内容。[第1行,第1列]"

我试着添加乌龟代码,而不是一个文件,我得到了这个消息:"期望':',发现';'[第51行]"

我的示例代码是:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ex: <http://www.example.com> .
<P1>
        a   foaf:Person;
        foaf:firstName  "Ben";
        foaf:lastName   "Edward";
        ex:DOB  "14/1/2004";
        ex:weight   '35';
        ex:height   '157';
        foaf:Phone  "00447857451285";
        foaf:email  "Ben.Edward@example.com".
<P2>
        a   foaf:Person;
        foaf:firstName  "Gareath";
        foaf:lastName   "Jamies";
        ex:DOB  "11/05/2001";
        ex:weight   '34';
        ex:height   '154';
        foaf:Phone  "00447857111200";
        foaf:email  "Gareath.Jamies@example.com".
<P3>
        a   foaf:Person;
        foaf:firstName  "Sarah";
        foaf:lastName   "Lloyd";
        ex:DOB  "12/11/1986";
        ex:weight   '50';
        ex:height   '160';
        foaf:Phone  "0044785700349";
        foaf:email  "Sarah.Lloyd@example.com".
<S1>
        foaf:firstName  "Mark";
        foaf:lastName   "Jhon";
        ex:qualification    "Specialist";
        ex:speciality   "Dermatology".

<R1>
        ex:reportFor    P1;
        ex:reportDate   "15/01/2010";
        ex:editedBy S1.
<R2>
        ex:reportFor    P1;
        ex:reportDate   "17/02/2010";
        ex:editedBy S1.

我不知道我是否必须从第一次定义新的谓词,或者我可以尝试它并在该数据上执行查询。

请您提前解释和感谢。

这不是一个有效的Turtle文件。您使用了相对URI作为主题,而没有声明基URI。我建议您查看规范[http://www.w3.org/TR/turtle/#sec-iri],以获取所有可选的有效IRIs形式的示例。

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ex: <http://www.example.com> .
@base <http://www.example.com/> .

<P1>
         a   foaf:Person;
        foaf:firstName  "Ben";
        foaf:lastName   "Edward";
        ex:DOB  "14/1/2004";
        ex:weight   '35';
        ex:height   '157';
        foaf:Phone  "00447857451285";
        foaf:email  "Ben.Edward@example.com".
<P2>
        a   foaf:Person;
        foaf:firstName  "Gareath";
        foaf:lastName   "Jamies";
        ex:DOB  "11/05/2001";
        ex:weight   '34';
        ex:height   '154';
        foaf:Phone  "00447857111200";
        foaf:email  "Gareath.Jamies@example.com".
<P3>
        a   foaf:Person;
        foaf:firstName  "Sarah";
        foaf:lastName   "Lloyd";
        ex:DOB  "12/11/1986";
        ex:weight   '50';
        ex:height   '160';
        foaf:Phone  "0044785700349";
        foaf:email  "Sarah.Lloyd@example.com".
<S1>
        foaf:firstName  "Mark";
        foaf:lastName   "Jhon";
        ex:qualification    "Specialist";
        ex:speciality   "Dermatology".

<R1>
        ex:reportFor    <P1>;
        ex:reportDate   "15/01/2010";
        ex:editedBy <S1>.
<R2>
        ex:reportFor    <P1>;
        ex:reportDate   "17/02/2010";
        ex:editedBy <S1>.

相关内容

  • 没有找到相关文章

最新更新