3 Replies Latest reply on Apr 19, 2007 5:24 PM by Mannamal-Oracle

    Class as values in RDF

      I have the following problem... I have a bunch of triples of the form

      osgb1 hasForm Heath
      osgb2 hasForm ConiferousTrees
      Heath rdf:subClassOf Vegetation
      ConiferousTrees rdf:subClassOf Vegetation
      Vegetation rdf:subClassOf Land

      I then want to find objects with a given form, and I want to be able to query up and at all levels in my hierarchy. So for example "find me things with form Heath" would return osgb1, and "find me things with form Vegetation" would return both osgb1 and osgb2.

      The problem here is that the object in the triples is a class, and also

      osgb1 hasForm Heath

      does not entail

      osgb1 hasForm Vegetation

      I suppose what I really would like to say (if I had OWL) is:

      osgb1 rdf:type hasForm some Heath

      However, we cannot do this in RDF/Oracle (yet). Current SWBP recommend creating an instance for each class as follows:

      land rdf:type Land
      heath rdf:type Heath

      then constructing triples of the form:

      osgb hasForm heath

      and then if I want to find all the "Land" I do a SPARQL query like:

      select ?x
      ?x hasForm ?y
      ?y rdf:type Land

      This should work, but seems potentially clunky.

      Just curious if anyone has tried alternative solutions to this problem, or has an experience of how it scales.


        • 1. Re: Class as values in RDF
          Hi John,

          Scaling should not be an issue. Defining an instance for every class would at worst double the number of triples (if every triple contained a class for which you will be defining an instance). Entailing and querying will of course be a little slower with double the data, but since the Oracle RDF store scales well, the slow down in performance will not be directly proportional to the fact that the number of triples doubled. Depending on the absolute number of triples, queries will be slightly slower but barely so. With the type of queries you have outlined above there is likely to be no noticeable difference because of the internal indexes that are built on the data.

          I would also be curious to know whether other alternatives have been tried by other users.

          I wonder whether the usage of user-defined rules available in Oracle RDF would help. For instance, defining a rule that:
          (osgb1 hasForm Heath) and (Heath subClassOf Vegetation)
          => (osgb1 hasForm Vegetation)

          and a transitive property rule:
          (Heath subClassOf Vegetation) and (Vegetation subClassOf Land)
          => (Heath subClassOf Land)

          I wonder whether this makes sense with the semantics you have in mind for your data?

          • 2. Re: Class as values in RDF
            This is exactly what OWL is for and exactly the problem I have. How long until Oracle rolls out OWL support in queries?
            • 3. Re: Class as values in RDF

              Support for a subset of OWL are planned in the next release, which will be later this year. Please see the post at Oracle 11g and changes in RDF support? for some details on what is planned.