3 Ответы Последний ответ: 20.03.2009 14:54, автор: alwu-Oracle

    Jena Adaptor: Listing and deleting models.

    691732
      I'm building an application that will be dynamically creating and dropping RDF models via the Jena API to hold user content. Specifically, I need the following operations:

      1. List all RDF model names in the semantic network.
      2. Delete a named model.
      3. Check for existence of a model (this can be accomplished by searching for an entry in the list returned from 1. if necessary)
      4. Separate methods for creating and opening models. As far as I can tell, these are both done by the GraphOracleSem constructor, the semantics of which seem to be "open the model if it exists, otherwise create and open it."

      Are any of these features provided by the Oracle Jena adaptor, or do I have to drop down into SQL to get what I need?

      On a related note, are there any plans to implement the Jena model and/or graph factory classes (such as ModelMaker)? These would be a welcome addition, as they already provide the above features, and I think would make life a lot easier for developers of existing applications built on top of Jena to migrate to an Oracle back-end.
        • 1. Re: Jena Adaptor: Listing and deleting models.
          alwu-Oracle
          Right now, Jena adaptor does not have these utility functions. However, they are not hard to support.

          If you want to do it yourself, you can query MDSYS.RDF_MODEL$ view for 1) and 3).

          2) is just a simple call to sem_apis.drop_sem_model API.

          4) is doable. However, I'd like to know what is the reasoning behind your request. The constructor is designed like this for ease of use.

          Jena Model API has been implemented since the first release. Factory API has not. Could you please provide a use case for it?

          Thanks,

          Zhe Wu
          • 2. Re: Jena Adaptor: Listing and deleting models.
            691732
            Take a look at the Jena ModelMaker interface (in the com.hp.hpl.jena.rdf.model package). It provides methods with the following signatures:

            * openModel(String name, boolean strict) - If the named model doesn't exist and "strict" is true, then it throws an exception; if "strict" is false then it creates the model.

            * createModel(String name, boolean strict) - If the named model already exists and "strict" is true, then it throws an exception; if "strict" is false then it opens and returns the existing model.

            Our application allows users to create and manage ontology content organized into models. Our application is explicitly managing the lifecycle of these models, and we don't want the details of whether the model actually exists to be hidden from us. If, for example, a user tries to open a model that they think already exists, and it doesn't, then something went wrong and we want to alert the user instead of opening up a new, empty model.

            As I said before, I'm sure that I can drop down into SQL to get whatever features aren't provided by the Jena interface. My point is that I'm sure I'm not the only person trying to migrate an application already written for Jena to use an Oracle back-end, and the process would be a lot easier with some implementations of the higher-level factory interfaces.
            • 3. Re: Jena Adaptor: Listing and deleting models.
              alwu-Oracle
              Fair enough. Let us have a private discussion on the core APIs that you need. We will post them once they are ready.

              Cheers,

              Zhe

              alan dot wu at oracle dot com
              1 пользователь считает эту информацию полезной