ontology population

1 view
Skip to first unread message

Diana Magdi

unread,
Apr 15, 2015, 3:00:27 AM4/15/15
to sta...@clarkparsia.com
I used this code to create new instances in the ontology but i have not found these instance in the file.owl.  is there are other methods that i have to use it to do this ?

       IO aAdder = aConn.add().io().format(RDFFormat.RDFXML);

       aAdder.file(new File("data/FatherBrotherOnto.owl"));

        URI Boys = ValueFactoryImpl.getInstance().createURI("http://www.lsis.fr/myOnto.owl#Boys");

URI Alice = ValueFactoryImpl.getInstance().createURI("http://www.lsis.fr/myOnto.owl#Alice");


Graph aGraph = Graphs.newGraph();

  aGraph.add(Alice, RDF.TYPE, Boys);

  aConn.add().graph(aGraph);

  aConn.commit();


Michael Grove

unread,
Apr 15, 2015, 7:43:46 AM4/15/15
to stardog
On Wed, Apr 15, 2015 at 3:00 AM, Diana Magdi <diana...@gmail.com> wrote:
I used this code to create new instances in the ontology but i have not found these instance in the file.owl.  

Are you expecting the RDF to be saved back to the file?

Cheers,

Mike
 
is there are other methods that i have to use it to do this ?

       IO aAdder = aConn.add().io().format(RDFFormat.RDFXML);

       aAdder.file(new File("data/FatherBrotherOnto.owl"));

        URI Boys = ValueFactoryImpl.getInstance().createURI("http://www.lsis.fr/myOnto.owl#Boys");

URI Alice = ValueFactoryImpl.getInstance().createURI("http://www.lsis.fr/myOnto.owl#Alice");


Graph aGraph = Graphs.newGraph();

  aGraph.add(Alice, RDF.TYPE, Boys);

  aConn.add().graph(aGraph);

  aConn.commit();


--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Reply all
Reply to author
Forward
0 new messages