Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-2290

GraphRDFS doesn't implement contains

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 4.4.0
    • Jena 4.5.0
    • Core
    • None

    Description

      While trying to use the RDFS dataset to use light-weight reasoning I recognized that the contains method isn't implemented properly?
      I can't say if this holds for all contains calls as there is some contains method directly in the dataset.

      But the following path is what I got trouble with:
      Given D being a DatasetGraphRDFS and then getting the named model M for a particular graph which in fact is then backed by a GraphRDFS instance G this G doesn't seem to make use of the inferred triples when we call contains. This method is still only implemented in the GraphWrapper superclass and doesn't make use of the overridden find method.

      Don't what would be best place to implement it. Sure, we could make use of find directly in the GraphRDFS class, e.g.

      @Override
      public boolean contains(Node s, Node p, Node o) {
          return find(s, p, o).hasNext();
      }
      
      @Override
      public boolean contains(Triple t) {
          return contains(t.getSubject(), t.getPredicate(), t.getObject());
      } 

      But I'm wondering about efficiency as I don't know how efficient the inference streams are built. I mean we could maybe terminate way earlier in the MatchRDFS but it would of course lead to some more lines of code.

      Attachments

        Issue Links

          Activity

            People

              andy Andy Seaborne
              LorenzB Lorenz Bühmann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: