views:

368

answers:

4

I'm working on a team investigating a technology stack for a green-field systems integration project. Part of our favored technology stack use Hibernate to persist its internal state and exposes hooks into the Hibernate transactions so that business entities stay synchronized with the state of this utility. Great, except we need to maintain information about entities of an unknown type and link that data to the predefined types. We need a scalable data store that does not require the schema to be defined upfront. The sweet spot would be to blend RDF data and Hibernate managed entities.

Have you faced a similar requirement and what approaches can you recommend? Any RDF/ORM blend would need to support infrequent large-scale queries for reporting and data exploration and also frequent focused read and write operations in support of transactions.

+1  A: 

I am using RDF in my project and what we have done is use OWL to define an ontology for the RDF data and give it some structure. From there we generate C# classes from the OWL ontology. The nice thing about this is that you can still add additional data about your subject but still have a class structure that is meaningful in most of your cases.

Aaron Weiker
Uh-oh the O word! Since we don't actually know the schema upfront, generating code from anything is out of the question. Consider OWL in this case to a be a runtime input. Having changes to the RDF take-part in some sort of transaction alongside SQL DML is also essential.
Simon Gibbs
A: 

One solution is to keep the object model at the RDF triplestore level, for example by having classes for

  • nodes: uris, blanks and literals
  • statements: collections of three or more nodes (three for the RDF triple, additional node(s) for meta)

Running queries on such a storage is essentially doing triple/n-tuple pattern-matching on the statements.

laalto
A: 

Have you considered defining a hibernate model for known data and adding CLOBs with XML to store the unknown stuff? This way you keep your normal hibernate code mostly and only when you need to access the additional stuff you load the XML from CLOB fields and process it.

Take a look here for a similar problem with similar solution.

Gregory Mostizky
A: 

On Tripresso wiki page there is a list of Object-RDF mappers that let you work with RDF data in object-oriented way. I doubt that any of them integrates directly with Hibernate but they at least provide something similar.

Pēteris Caune