Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for TempTripleStore in GeoSpatialServiceFactory #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
import com.bigdata.rdf.spo.SPO;
import com.bigdata.rdf.spo.SPOKeyOrder;
import com.bigdata.rdf.store.AbstractTripleStore;
import com.bigdata.rdf.store.TempTripleStore;
import com.bigdata.relation.IRelation;
import com.bigdata.relation.accesspath.AccessPath;
import com.bigdata.relation.accesspath.BlockingBuffer;
Expand Down Expand Up @@ -166,11 +167,7 @@ public BigdataServiceCall create(final ServiceCallCreateParams createParams) {

final AbstractTripleStore store = createParams.getTripleStore();

final Properties props = store.getIndexManager() != null
&& store.getIndexManager() instanceof AbstractJournal ? ((AbstractJournal) store
.getIndexManager()).getProperties() : null;

final GeoSpatialDefaults dflts = new GeoSpatialDefaults(props);
final GeoSpatialDefaults dflts = new GeoSpatialDefaults(getStoreProperties(store));

final ServiceNode serviceNode = createParams.getServiceNode();

Expand Down Expand Up @@ -199,7 +196,7 @@ public BigdataServiceCall create(final ServiceCallCreateParams createParams) {

validateSearch(searchVar, statementPatterns);

/**
/*
* Get the service call configuration from annotations (attachable via query hints).
* Here's how to define the hints:
*
Expand Down Expand Up @@ -255,6 +252,20 @@ public BigdataServiceCall create(final ServiceCallCreateParams createParams) {

}

/**
* Extract properties from store.
*/
private static Properties getStoreProperties(AbstractTripleStore store) {
if ( store.getIndexManager() != null
&& store.getIndexManager() instanceof AbstractJournal) {
return ((AbstractJournal) store
.getIndexManager()).getProperties();
} else if (store instanceof TempTripleStore) {
return store.getProperties();
}
throw new IllegalArgumentException("Failed to get store properties");
}

/**
* Validate the search request. This looks for search magic predicates and
* returns them all. It is an error if anything else is found in the group.
Expand Down