RDF to JDOM?

View: New views
7 Messages — Rating Filter:   Alert me  

RDF to JDOM?

by Oliver Ruebenacker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

     Hello,

  Do you know of a way to convert RDF (e.g. a Jena Model) to JDOM
(corresponding to RDF/XML) or vice versa? Thanks!

     Take care
     Oliver

--
Oliver Ruebenacker, Computational Cell Biologist
BioPAX Integration at Virtual Cell (http://vcell.org/biopax)
Center for Cell Analysis and Modeling
http://www.oliver.curiousworld.org
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@...

Re: RDF to JDOM?

by polx :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Have you tried OWLAPI? It has a huge lot of such converters and can  
serialize to XML.
I think a Jena Model can also export to RDF-XML.

paul


Le 11-mai-09 à 17:11, Oliver Ruebenacker a écrit :

>  Hello,
>
> Do you know of a way to convert RDF (e.g. a Jena Model) to JDOM
> (corresponding to RDF/XML) or vice versa? Thanks!
>
>  Take care
>  Oliver
>


_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@...

smime.p7s (2K) Download Attachment

Re: RDF to JDOM?

by Oliver Ruebenacker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

     Hello Paul, All,

  I don't know OWLAPI. Some browsing did not reveal any interfaces to
jena, DOM or JDOM. Can you give me a hint?

  Jena interfaces, for example, with input and output streams to
serialize and deserialize models as RDF/XML text. It also allows to
read a model from a DOM document. To read from a JDOM document, I need
to convert to DOM first. And I do not know how to convert from a Jena
model to a DOM or JDOM document.

     Take care
     Oliver

On Mon, May 11, 2009 at 6:03 PM, Paul Libbrecht <paul@...> wrote:

> Have you tried OWLAPI? It has a huge lot of such converters and can
> serialize to XML.
> I think a Jena Model can also export to RDF-XML.
>
> paul
>
>
> Le 11-mai-09 à 17:11, Oliver Ruebenacker a écrit :
>
>>  Hello,
>>
>> Do you know of a way to convert RDF (e.g. a Jena Model) to JDOM
>> (corresponding to RDF/XML) or vice versa? Thanks!
>>
>>  Take care
>>  Oliver
>>
>



--
Oliver Ruebenacker, Computational Cell Biologist
BioPAX Integration at Virtual Cell (http://vcell.org/biopax)
Center for Cell Analysis and Modeling
http://www.oliver.curiousworld.org

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@...

Parent Message unknown Re: RDF to JDOM?

by Tatu Saloranta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message




--- On Tue, 5/12/09, Oliver Ruebenacker <curoli@...> wrote:

> From: Oliver Ruebenacker <curoli@...>
> Subject: Re: [jdom-interest] RDF to JDOM?
> To: "Paul Libbrecht" <paul@...>
> Cc: jdom-interest@...
> Date: Tuesday, May 12, 2009, 12:03 PM
>      Hello Paul,
> All,
>
>   I don't know OWLAPI. Some browsing did not reveal
> any interfaces to
> jena, DOM or JDOM. Can you give me a hint?
>
>   Jena interfaces, for example, with input and output
> streams to
> serialize and deserialize models as RDF/XML text. It also
> allows to
> read a model from a DOM document. To read from a JDOM
> document, I need
> to convert to DOM first. And I do not know how to convert
> from a Jena
> model to a DOM or JDOM document.

Unless performance is a concern, an easy way would be to just serialize to RDF xml serialization, then (re)parse (as JDOM or Jena model).
Parsing/serializing xml is surprisingly fast these days.

-+ Tatu +-



     
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@...

Parent Message unknown Re: RDF to JDOM?

by Tatu Saloranta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message




--- On Tue, 5/12/09, Oliver Ruebenacker <curoli@...> wrote:

> From: Oliver Ruebenacker <curoli@...>
> Subject: Re: [jdom-interest] RDF to JDOM?
> To: "Paul Libbrecht" <paul@...>
> Cc: jdom-interest@...
> Date: Tuesday, May 12, 2009, 12:03 PM
>      Hello Paul,
> All,
>
>   I don't know OWLAPI. Some browsing did not reveal
> any interfaces to
> jena, DOM or JDOM. Can you give me a hint?
>
>   Jena interfaces, for example, with input and output
> streams to
> serialize and deserialize models as RDF/XML text. It also
> allows to
> read a model from a DOM document. To read from a JDOM
> document, I need
> to convert to DOM first. And I do not know how to convert
> from a Jena
> model to a DOM or JDOM document.

Unless performance is a concern, an easy way would be to just serialize to RDF xml serialization, then (re)parse (as JDOM or Jena model).
Parsing/serializing xml is surprisingly fast these days.

-+ Tatu +-



     
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@...

Re: RDF to JDOM?

by polx :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Sorry, I don't know on the jena side.
I suppose jena (and http://owlapi.sourceforge.net/ ) has a way to fire  
sax events.
JDOM can have this as well, opening the hood of SAXBuilder.


paul


Le 12-mai-09 à 21:04, Tatu Saloranta a écrit :

>
>
>
> --- On Tue, 5/12/09, Oliver Ruebenacker <curoli@...> wrote:
>
>> From: Oliver Ruebenacker <curoli@...>
>> Subject: Re: [jdom-interest] RDF to JDOM?
>> To: "Paul Libbrecht" <paul@...>
>> Cc: jdom-interest@...
>> Date: Tuesday, May 12, 2009, 12:03 PM
>>     Hello Paul,
>> All,
>>
>>  I don't know OWLAPI. Some browsing did not reveal
>> any interfaces to
>> jena, DOM or JDOM. Can you give me a hint?
>>
>>  Jena interfaces, for example, with input and output
>> streams to
>> serialize and deserialize models as RDF/XML text. It also
>> allows to
>> read a model from a DOM document. To read from a JDOM
>> document, I need
>> to convert to DOM first. And I do not know how to convert
>> from a Jena
>> model to a DOM or JDOM document.
>
> Unless performance is a concern, an easy way would be to just  
> serialize to RDF xml serialization, then (re)parse (as JDOM or Jena  
> model).
> Parsing/serializing xml is surprisingly fast these days.
>
> -+ Tatu +-
>
>
>
>


_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@...

smime.p7s (2K) Download Attachment

Parent Message unknown RE: RDF to JDOM?

by David Patterson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've been doing some work with Jena and it can read and write XML, but I'm
not aware of any methods to read into Jena directly from a DOM object. I
think it has nothing to do with JDom. You could go Jena -> XML -> JDOM or
the reverse, and use something like a StringWriter or StringReader to
process them in storage. From my experience, the sequence of XML going into
Jena does not match the sequence going out. Jena is very forgiving in being
able to read Individuals and Classes in pretty much any order.

Also, I spent a lot of time trying to process and interpret OWL data as XML
content with JDOM. It is complex data and the Jena team has pretty good code
to build something similar to a DOM object. It is not a real DOM since DOM
is a tree structure and OWL data is a Graph. So, instead of Elements and
Attibutes, you have OntClasses, Individuals, Restrictions, Properties, etc.
It is very common to have multiple superclasses of a Class. Trying to build
your own internal Graph even from a JDom tree of the XML will be difficult.

In the Jena discussion group, they often state that although OWL can be
coded as XML, that is but one of several ways the data can be expressed.
(From my experience, it may not be the best way to describe the data. I've
got enough XML background that writing XML by hand is not an issue for me.
Check out the "Turtles" format -- it is a shorthand for triple that allows
you to elide parts of triples when they match the previous triple.)

Also, with Jena, there are "reasoners" that can be used to create transitive
relations as if they were coded originally.

Jena can do a lot of good things that are extremely difficult to do in JDom.
(And I am not trying to dump on JDom, it just seemed to me to be the wrong
tool for my data for this application.)

Dave Patterson

__________________________________________________________________________
This message and all attachments are PRIVATE, and contain information that
is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to
transmit or otherwise disclose this message or any attachments to any
third party whatsoever without the express written consent of Intelligent
Automation, Inc. If you received this message in error or you are not
willing to view this message or any attachments on a confidential basis,
please immediately delete this email and any attachments and notify
Intelligent Automation, Inc.

_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@...