You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Haemmerle Fabian (CR/APA3)" <Fa...@de.bosch.com> on 2016/02/18 08:48:04 UTC

How to parse individual to JSON-LD

Hi,

I want to parse parts of an ontology with Apache Jena to JSON-LD. But I can only find ways to write the whole model to JSON-LD with the functions

        OntModel model;
        model.write(System.out, "JSON-LD");

or

               DFDataMgr.write(System.out, model, RDFFormat.JSONLD_PRETTY);

But I want to parse only an individual (and it's dataproperties) which is linked to a model. Can you help me out how to do that?
Thanks a lot in advance!


Mit freundlichen Grüßen / Best regards

Fabian Haemmerle

Control Technology (CR/APA3)
Tel. +49(711)811-11451 | Mobil +491734512854 | fabian.haemmerle@de.bosch.com<ma...@de.bosch.com>



Re: How to parse individual to JSON-LD

Posted by Andy Seaborne <an...@apache.org>.
On 18/02/16 07:48, Haemmerle Fabian (CR/APA3) wrote:
> Hi,
>
> I want to parse parts of an ontology with Apache Jena to JSON-LD. But I can only find ways to write the whole model to JSON-LD with the functions
>
>          OntModel model;
>          model.write(System.out, "JSON-LD");
>
> or
>
>                 DFDataMgr.write(System.out, model, RDFFormat.JSONLD_PRETTY);
>
> But I want to parse only an individual (and it's dataproperties) which is linked to a model. Can you help me out how to do that?
> Thanks a lot in advance!

Fabian,

Are you trying to write out one individual?  If so, create a second 
model, put all the statement from the first the first you want and print 
that.

A format like JSON-LD requires all the data present to decide how to 
print i.e. a model.

     Andy