Error message when I'm adding RDF turtle to sesame server

556 views Asked by At

I'm so new on the semantic web technology and I'm trying to understand.

I have installed The Sesame 2.8 server and Apache Tomcat.

I'm trying to add some RDF data to the repository, and I succeed to use some example from the Internet. However, I've tried to build a small turtle file and add it to the repository as a file and I got the following message: "Content is not allowed in prolog. [line 1, column 1]"

I've tried to add the turtle code and not a file and I got this message: "Expected ':', found ';' [line 51]"

My example code was:

@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  "[email protected]".

<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  "[email protected]".

<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  "[email protected]".

<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.

I don't know if I have to define the new predicate from the first time or I can try it and do the query on that data before.

Could you please explain and thanks in advance.

1

There are 1 answers

4
chrisis On

This is not a valid Turtle file. You have used relative URIs as subjects without declaring a base URI. I suggest you take a look at the spec [http://www.w3.org/TR/turtle/#sec-iri] for examples of all the alternative forms of valid 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  "[email protected]".

<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  "[email protected]".

<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  "[email protected]".

<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>.