Announcement Announcement Module
Collapse
No announcement yet.
Spring Data RDF Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data RDF

    I am interested in creating a Spring Data RDF implementation.
    I have identified the RDFBeans and RDF2Go project as a reasonable starting point.

    RDFBeans used RDF2Go and provides mapping from RDF statements to annotated Java objects.
    RDF2Go provides and abstraction to multiple versions of implementations of Jena and Sesame.
    Jena and Sesame are the to widely used APIs for accessing RDF stores. Most store provide implementations of either one or both APIs.

    I have used Spring Data JPA on a recent project and understand the working as a user and I also created some custom methods etc.
    After working through the code for Spring Data JPA and Spring Data Neo4J I am still trying to figure out the various patterns. It seems as if Spring Data Commons have gone through some major changes and some new patterns have been added recently.
    I need some pointers on how to go about putting together an RDFRepository.
    What is needed to instantiate the repository implementation?
    How does the find method queries work?
    What support is provided by spring Data Commons?

    I have started some work on RDFBeans to remove the need for binding information in the data store.
    I will continue my investigation of the existing code and focus on Spring Data JPA since I understand it best along with the underlying JPA.

    Anybody who would like to collaborate please pitch in.

  • #2
    made some progress

    I created:
    • interface RDFRepository<T, ID extends Serializable> extends CrudRepository<T, ID>
    • class RDFRepositoryFactory extends RepositoryFactorySupport
    • SimpleRDFRepository<T, ID extends Serializable> implements RDFRepository<T, ID>
    • and some unit tests.


    now I'm trying to figure out the configuration part to bootstrap the factory.

    Comment


    • #3
      You're on the right track already. As these questions have tended to pop up more often recently I am about to prepare an implementation guideline probably filling the black spot of the README missing in the Spring Data Commons Github repository. Give me time until early next week and you'll get a complete write-up of the interesting bits and pieces.

      Comment


      • #4
        XML error

        So far I have also added
        • class RdfRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable> extends RepositoryFactoryBeanSupport<T, S, ID>
        • class SimpleRdfRepositoryConfiguration extends RepositoryConfig<SimpleRdfRepositoryConfiguration. RdfRepositoryConfiguration, SimpleRdfRepositoryConfiguration>
        • class RdfRepositoryNameSpaceHander extends NamespaceHandlerSupport
        • class RdfRepositoryConfigDefinitionParser extends AbstractRepositoryConfigDefinitionParser<SimpleRdf RepositoryConfiguration, RdfRepositoryConfiguration>

        I have run into a very silly problem I cannot resolve with the bean XML
        Code:
        <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns="http://www.springframework.org/schema/beans"
        	xmlns:rdf="http://www.springframework.org/schema/data/rdf"
        	xsi:schemaLocation="http://www.springframework.org/schema/data/rdf http://www.springframework.org/schema/data/rdf/spring-rdf-1.0.xsd
        		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
        		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
        	<bean id="modelFactory" class="org.ontoware.rdf2go.RDF2Go" factory-method="getModelFactory" />
        	<rdf:repositories base-package="org.springframework.data.rdf.simple" model-factory-ref="modelFactory">
        	</rdf:repositories>
        </beans>
        org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'rdf:repositories'.

        I even added a spring.schemas file but to no avail.
        I get the same message for <repository:repositories> with xmlns:repository="http://www.springframework.org/schema/data/repository"

        Comment


        • #5
          Project process

          On a slightly different topic:

          At what point would SpringSource be interested in taking the project into the fold?
          How does the process work?

          Comment


          • #6
            I have a working CrudRepository!
            Do you want to take a look at the code?

            Comment


            • #7
              Awesome! Do you have a GitHub repo to look at it?

              Comment


              • #8
                My first foray into the world of git.

                git://github.com/corneil/spring-data-rdf.git

                Comment


                • #9
                  Cool, thanks. I'll have a look and ask around internally to find out how we're going to deal with complete module contributions from the community. I assume we'll go down a similar route as Spring Social does for their connector projects.

                  Comment


                  • #10
                    Now to get the QueryDSL stuff going.
                    I need to do some more investigation on SPARQL to determine how to return graphs of objects instead of simple results.

                    Comment


                    • #11
                      As I investigate the QueryDSL stuff I come across mysema rdfbean project. Which has done a lot of the same as I am trying with Spring Data RDF.
                      With some refactoring we should be able to incorporate rdfbean instead of RDFBeans and gain the QueryDSL support at the same time.

                      Comment


                      • #12
                        refactored to support mysema.rdfbean.
                        Some issues remain outstanding with basic crud.
                        RDFBeans had elegant mechanism for dealing with the subject. created explicit UID for now.
                        RDFBeans support attributes occuring many times and could map to array. mysema.rdfbean requires a collection.

                        Comment


                        • #13
                          very intresting topic, is there a working example app?

                          thank you

                          Comment

                          Working...
                          X