Hi,

I have a file user.rdf which has the following:

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
    xmlns:kb="http://protege.stanford.edu/kb#";
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"; >
    <rdf:Description rdf:about="http://protege.stanford.edu/kb#Suresh";>
    <rdf:type rdf:resource="http://protege.stanford.edu/kb#USER"/>
    <kb:Email>[email protected]</kb:Email>
    <kb:Fname>Suresh</kb:Fname>
    <kb:Interest>Java</kb:Interest>
    <kb:Occupation>Agent</kb:Occupation>
    <kb:Password>suresh</kb:Password>
    <kb:Uname>sur</kb:Uname>
    <rdfs:label>Suresh</rdfs:label>
  </rdf:Description>
   <rdf:Description rdf:about="http://protege.stanford.edu/kb#Anvika";>
    <rdf:type rdf:resource="http://protege.stanford.edu/kb#USER"/>
    <kb:Email>[email protected]</kb:Email>
    <kb:Fname>Anvika</kb:Fname>
    <kb:Interest>C language</kb:Interest>
    <kb:Occupation>Student</kb:Occupation>
    <kb:Password>anu</kb:Password>
    <kb:Uname>anvika</kb:Uname>
    <rdfs:label>Anvika</rdfs:label>
  </rdf:Description>
</rdf:RDF>


This file is created in Protege. Then this file is deployed in a web
application in Eclipse.

In my applicaition I have used Schemagen to create the initial settings. The
application uses Java and Jena as front end where the users are supposed to
update their profile through the front end. With help of Jena the different
properties and their values are added into the user.rdf through the
application. But the only line missing in the updated in the rdf file is
<rdf:type rdf:resource="http://protege.stanford.edu/kb#USER"/>.

I need to use this line as a part of inference. How do I add this line in
the rdf file through the application.

The rules for the inference uses the following code:

@prefix kb: http://protege.stanford.edu/kb#
[likec++: (?s rdf:type kb:LikeC++)
           <-
          (?s rdf:type kb:USER)
          (?s kb:Interest ?i)
          print(?s)
          print(?i)
          regex(?i,'C language')


]


I need to match all the rdf:type tags with my tags in user.rdf. Since that
line is not getting updated through the application I am not able to
continue.

The updated user.rdf is as follows:

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
    xmlns:kb="http://protege.stanford.edu/kb#";
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"; >
   <rdf:Description rdf:about="http://protege.stanford.edu/kb#Somanch";>
    <kb:Email>[email protected]</kb:Email>
    <kb:Name>Somanch</kb:Name>
    <kb:Password>henry</kb:Password>
    <kb:Uname>soman</kb:Uname>
    <kb:Interest>C Language</kb:Interest>
    <kb:Occupation>Student</kb:Occupation>
  </rdf:Description>
  <rdf:Description rdf:about="http://protege.stanford.edu/kb#Suresh";>
    <rdf:type rdf:resource="http://protege.stanford.edu/kb#USER"/>
    <kb:Email>[email protected]</kb:Email>
    <kb:Fname>Suresh</kb:Fname>
    <kb:Interest>Java</kb:Interest>
    <kb:Occupation>Agent</kb:Occupation>
    <kb:Password>suresh</kb:Password>
    <kb:Uname>sur</kb:Uname>
    <rdfs:label>Suresh</rdfs:label>
  </rdf:Description>
   <rdf:Description rdf:about="http://protege.stanford.edu/kb#Anvika";>
    <rdf:type rdf:resource="http://protege.stanford.edu/kb#USER"/>
    <kb:Email>[email protected]</kb:Email>
    <kb:Fname>Anvika</kb:Fname>
    <kb:Interest>C language</kb:Interest>
    <kb:Occupation>Student</kb:Occupation>
    <kb:Password>anu</kb:Password>
    <kb:Uname>anvika</kb:Uname>
    <rdfs:label>Anvika</rdfs:label>
  </rdf:Description>
</rdf:RDF>


Please help it is very urgent since my project deadline is nearing.......

Regards,
Archana.

Reply via email to