Apache Jena
  1. Apache Jena
  2. JENA-222

Graph.size() reports '0' for TDB "urn:x-arq:UnionGraph"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: TDB 0.9.1
    • Component/s: TDB
    • Labels:
      None
    • Environment:

      tdb version 0.8.9 (via Apache Clerezza)

      Description

      using

      Dataset dataset = TDBFactory.createDataset(dir);
      Model model dataset.getNamedModel("urn:x-arq:UnionGraph");
      Graph graph = model.getGraph();
      int size = graph.size();

      size will always report zero regardless of the amount of triples stored in the different named models of the dataset.

      I think this is because com.hp.hpl.jena.tdb.store.GraphNamedTDB#countThis() would need special treatment in case of "isQuadUnionGraph(graphNode) == true"

        Activity

        Hide
        Andy Seaborne added a comment -

        Yes - countThis needs to be sensitive to the union graph. It's also going to have to be sensitive to duplicates because multiple named graph can have duplicate triples. It'll take an Iter.distinct to do that so it will be non-trivial additional cost but anything like counting does not make sense at scale anyway.

        Implemented in TDB SVN and in a snapshot build tonight.

        Show
        Andy Seaborne added a comment - Yes - countThis needs to be sensitive to the union graph. It's also going to have to be sensitive to duplicates because multiple named graph can have duplicate triples. It'll take an Iter.distinct to do that so it will be non-trivial additional cost but anything like counting does not make sense at scale anyway. Implemented in TDB SVN and in a snapshot build tonight.

          People

          • Assignee:
            Andy Seaborne
            Reporter:
            Rupert Westenthaler
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development