Lorenz Bühmann created JENA-2290: ------------------------------------ Summary: GraphRDFS doesn't implement contains Key: JENA-2290 URL: https://issues.apache.org/jira/browse/JENA-2290 Project: Apache Jena Issue Type: Bug Components: Core Affects Versions: Jena 4.4.0 Reporter: Lorenz Bühmann
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. {code:java} @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()); } {code} 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. -- This message was sent by Atlassian Jira (v8.20.1#820001)