XML to Java to Stardog with Pinto

3 views
Skip to first unread message

Dallas Phillips

unread,
Nov 2, 2016, 12:21:13 PM11/2/16
to Stardog

Our team is using an off-the-shelf library to deserialize some XML into Java objects.  We want to turn these java objects into a reasonable RDF representation in order to work with them in Stardog. We looked at the pinto project(https://github.com/stardog-union/pinto) and found that it does almost exactly what we want, except with some undesirable results for java object properties with types like “XMLGregorianCalendar”. This class has many properties that we don’t care to see in our RDF result and would like to ignore all together. Where an XML serialization would simply output a timestamp, pinto seems to do examine a lot of unnecessary properties and generates RDF that is more complex than what is desired. Does pinto or any other library that you guys might know of, allow a fine tuning of the mapping used to get from Java to RDF?

 

Thanks for your help!

Dallas Phillips

Champion Technology Company

Kendall Clark

unread,
Nov 2, 2016, 12:41:16 PM11/2/16
to sta...@clarkparsia.com
Dallas,

I'm not aware of anything else, but Pinto "allow[s] a fine tuning of the mapping": it's open source with a liberal license and we're happy to accept good PRs.

Cheers,
Kendall



--
-- --
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

Michael Grove

unread,
Nov 2, 2016, 12:42:50 PM11/2/16
to stardog
On Wed, Nov 2, 2016 at 12:21 PM, Dallas Phillips <dallasph...@gmail.com> wrote:

Our team is using an off-the-shelf library to deserialize some XML into Java objects.  We want to turn these java objects into a reasonable RDF representation in order to work with them in Stardog. We looked at the pinto project(https://github.com/stardog-union/pinto) and found that it does almost exactly what we want, except with some undesirable results for java object properties with types like “XMLGregorianCalendar”. This class has many properties that we don’t care to see in our RDF result and would like to ignore all together. Where an XML serialization would simply output a timestamp, pinto seems to do examine a lot of unnecessary properties and generates RDF that is more complex than what is desired. Does pinto or any other library that you guys might know of, allow a fine tuning of the mapping used to get from Java to RDF?


In some cases, @Transient might be enough, but it doesn't support that yet [1].

Your better bet would be to use a codec and do the serialization yourself [2].

Cheers,

Mike

 

 

Thanks for your help!

Dallas Phillips

Champion Technology Company

--
-- --
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

Martynas Jusevičius

unread,
Nov 2, 2016, 12:44:37 PM11/2/16
to sta...@clarkparsia.com
Why not use XSLT to transform the XML format to RDF/XML?

https://www.w3.org/TR/grddl/
> --
> -- --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Stardog" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to stardog+u...@clarkparsia.com.

Zachary Whitley

unread,
Nov 2, 2016, 12:56:00 PM11/2/16
to Stardog
....or RML http://rml.io/


> For more options, visit this group at
> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Stardog" group.
> To unsubscribe from this group and stop receiving emails from it, send an


--
-- --
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

For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+unsubscribe@clarkparsia.com.


Håvard Ottestad

unread,
Nov 3, 2016, 5:46:34 PM11/3/16
to Stardog
I would also like to mention XmlToRdf that I have developed at Acando together with DIFI, the agency for Public Management and eGovernment in Norway.

It does a straight forward conversion from XML to RDF with a fair number of configurable conversion options. The most important focus has been speed and low memory footprint. It support converting XML to RDF turtle and an output stream or to a Sesame Repository or Jena Model for further transformations with Sparql.

We use it to convert Noark 4 and 5 to RDF and then store that in Stardog.

https://github.com/AcandoNorway/XmlToRdf

Dallas Phillips

unread,
Nov 7, 2016, 12:38:00 PM11/7/16
to Stardog

Thanks all for the suggestions.

 

We chose not to use XSLT because we're dealing with a fairly complex XML schema.  Fortunately, the providers that schema offer a jaxb based library to de/serialize their XML and our current strategy is use this library in combination with pinto and hopefully avoid the work of creating lots of scary xslt transforms.

 

Michael,  thanks for pointing me to the RDFCodec example.  I think this is the missing piece for us.  :)

 

-Dallas Phillips

Champion Technology Company.

Reply all
Reply to author
Forward
0 new messages