spaziocodice / SolRDF

An RDF plugin for Solr
Apache License 2.0
113 stars 20 forks source link

Stateless LocalGraph and LocalDatasetGraph loose named graph information #83

Closed agazzarini closed 9 years ago

agazzarini commented 9 years ago

The current LocalGraph implementation is completely stateless and therefore an new instance is created for each (query / update) request. That causes some problems because the graph names collection management (inherited from the Jena superclasses) is completely transient.

Specifically, the collection is held in memory, so two subsequent calls on containsGraph() will be applied to different DatasetGraph instances (therefore always resulting false))

agazzarini commented 9 years ago

Issue has been fixed by overriding listGraphNodes and _containsGraph. Those methods were looking in a in-memory structure in order to produce their results. Now, since we are creating a dedicated graph and dataset graph for each request, that transient structure was always empty, even if we previously loaded some data in a given (named) graph.

The current implementation of listGraphNodes always does a faceted search on C field in order to retrieve the currently stored (named) graphs.