[Mulgara-dev] Jena Model write in Mulgara

Life is hard, and then you die ronald at innovation.ch
Sat Nov 8 02:13:51 UTC 2008


On Fri, Nov 07, 2008 at 07:27:36PM +0100, Carlo Bernava wrote:
> mhmhm Yes my Jena system is accessible via HTTP (i'm usign JSP), but the
> this isn't what i'm looking for...My Jena model is a big RDFXML created
> dinamically...and there are many big rdf
> 
> (i'm doing a social tagging system using scot onotlogy, so there are many
> rdf, one for eache object, and every rdf have a property called TagCloud
> where there are in many other sub-property #hasTag, moreover in each rdf
> there are specification for each objcet of property #hasTag that describe
> the frequency of a tag)
> 
> So when i'm receive an http request to tag an object if there isn't an rdf
> for the request object i must create it, so my jsp create a Model and i'm
> looking for put this big RDFXML model into mulgara.

Instead of trying to load an rdf/xml document directly you could also
just generate a series of triples and use tql's 'insert' command (this
is how we load all our data). If Jena can dump the model as N3 triples
then the conversion to tql triples is fairly trivial (basically
converting double-quotes to single-quotes around literals and removing
the trailing '.'); another option is to write the rdf/xml to a buffer
and use an xslt stylesheet to transform the rdf/xml to tql inserts
(we've created one to do just this - see 
http://www.topazproject.org/trac/browser/head/plos/libs/article-util/src/main/resources/org/plos/article/util/RdfXmlToTriples.xslt?rev=4860 )


  Cheers,

  Ronald


> 2008/11/7 Paul Gearon <gearon at ieee.org>
> 
> > Is your Jena system accessible via http? If so, then you could extract
> > your data via a "create" command in a URL, and then make this URL the
> > place you load your data from.
> >
> > I don't know the Jena way of doing this, but I suspect it is along the
> > lines of:
> >
> >
> > http://yourserver.com/sparql?query=create+%3Fs+%3Fp+%3Fo+where+%7B+%3Fs+%3Fp+%3Fo+%7D
> >
> > Once you have this URL, you can make it the source of a load command.
> > So to create the graph and load data into it, the commands would be:
> >
> > create <http://mydomain.com/data#mydata>;
> > load <
> > http://yourserver.com/sparql?query=create+%3Fs+%3Fp+%3Fo+where+%7B+%3Fs+%3Fp+%3Fo+%7D
> > >
> > into <http://mydomain.com/data#mydata>;
> >
> > Does this answer the question?
> >
> > Regards,
> > Paul
> >
> > On Fri, Nov 7, 2008 at 12:01 PM, Carlo Bernava <carlo.bernava at gmail.com>
> > wrote:
> > > Hi all,
> > >
> > > I have a little trouble with Jena and mulgara:
> > >
> > >
> > > I have a JSP page where there is a function that create a model with Jena
> > > API, this function create a model and "populate" it with many triple of
> > > subject predicate and object.
> > > When this model is created I want to insert it in a Mulgare Graph ( like
> > > ITQL command "load", to read a RDF file and put it in a graph)....how can
> > i
> > > do this?
> > >
> > >
> > >
> > > One way is to write the model in a RDF file (whit JENA
> > > Model.write(OutputStreamWriter writer) )   and load it in Mulgara doing a
> > > ITQL query whit a load command....but I'm sure there is another way more
> > > efficient..
> > >
> > >
> > > Thanks a lot for helps :)
> > >
> > >
> > >
> > > Carlo
> > >
> > > _______________________________________________
> > > Mulgara-dev mailing list
> > > Mulgara-dev at mulgara.org
> > > http://mulgara.org/mailman/listinfo/mulgara-dev
> > >
> > >
> > _______________________________________________
> > Mulgara-dev mailing list
> > Mulgara-dev at mulgara.org
> > http://mulgara.org/mailman/listinfo/mulgara-dev
> >

> _______________________________________________
> Mulgara-dev mailing list
> Mulgara-dev at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-dev




More information about the Mulgara-dev mailing list